:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --canvas: #f1f4f6;
  --surface: #ffffff;
  --subtle: #f7f9fa;
  --input: #ffffff;
  --text: #182b36;
  --muted: #566977;
  --border: #d9e2e7;
  --accent: #0b7168;
  --accent-hover: #08594f;
  --on-accent: #ffffff;
  --selected: #e8f5f1;
  --focus: #12877d;
  --warning-text: #795208;
  --warning-bg: #fff5d9;
  --warning-border: #e5d099;
  --danger: #a52d40;
  --danger-bg: #fff0f2;
  --danger-border: #ebc2c9;
  --shadow: 0 6px 24px rgb(24 43 54 / 4%);
  background: var(--canvas);
  color: var(--text);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #10181f;
  --surface: #18232c;
  --subtle: #1d2b35;
  --input: #132029;
  --text: #e6eef3;
  --muted: #a0b4c2;
  --border: #344650;
  --accent: #79d8c5;
  --accent-hover: #9ce8d9;
  --on-accent: #102b27;
  --selected: #233e3b;
  --focus: #8ce3d0;
  --warning-text: #f4d384;
  --warning-bg: #3c3322;
  --warning-border: #705d30;
  --danger: #ffadbb;
  --danger-bg: #3e2831;
  --danger-border: #75505c;
  --shadow: 0 6px 24px rgb(0 0 0 / 12%);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
}
button, input, select, textarea {
  font: inherit;
}
button, select {
  cursor: pointer;
}
button:disabled, input:disabled {
  cursor: not-allowed;
  opacity: .58;
}
a {
  color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.shell {
  width: min(1720px, calc(100% - 64px));
  margin: 0 auto;
  padding: 32px 0 48px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.eyebrow {
  display: block;
  color: var(--accent);
  font-size: .67rem;
  font-weight: 750;
  letter-spacing: .14em;
  margin-bottom: 8px;
}
.title h1 {
  margin: 0;
  font-size: 1.9rem;
  letter-spacing: -.04em;
  line-height: 1.2;
}
.title p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .85rem;
}
.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.theme-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
}
.theme-picker label {
  color: var(--muted);
  font-size: .78rem;
}
.theme-picker select {
  padding: 9px 28px 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: .8rem;
  min-height: 40px;
}
.primary-button, .secondary-button, .danger-button, .compact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: .82rem;
  font-weight: 650;
  text-decoration: none;
}
.primary-button {
  color: var(--on-accent);
  background: var(--accent);
}
.primary-button:hover:not(:disabled) {
  background: var(--accent-hover);
}
.secondary-button, .compact-button {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}
.secondary-button:hover:not(:disabled), .compact-button:hover:not(:disabled) {
  background: var(--subtle);
  border-color: var(--muted);
}
.secondary-button.active {
  color: var(--accent);
  background: var(--selected);
  border-color: var(--accent);
}
.danger-button {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: var(--danger-border);
}
.compact-button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: .78rem;
}
.danger-text {
  color: var(--danger);
}
.user-chip {
  max-width: 200px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: .8rem;
  padding: 6px 10px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(420px, 1fr);
  gap: 24px;
  align-items: start;
}
.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.editor-panel {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 22px 18px;
}
.list-heading h2 {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 600;
  letter-spacing: -.02em;
}
.count-badge {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  color: var(--accent);
  background: var(--selected);
  font-weight: 700;
  font-size: .85rem;
}
.toolbar {
  display: grid;
  gap: 14px;
  padding: 0 22px 20px;
  border-bottom: 1px solid var(--border);
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tab {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: .8rem;
  font-weight: 600;
}
.tab:hover {
  background: var(--subtle);
  color: var(--text);
}
.tab.active {
  color: var(--accent);
  background: var(--selected);
}
.search {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--subtle);
  color: var(--text);
  font-size: .84rem;
}
input::placeholder, textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.table-wrap {
  width: 100%;
  overflow: auto;
  max-height: calc(100vh - 310px);
  min-height: 240px;
  scrollbar-width: thin;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
  text-align: left;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--subtle);
  color: var(--muted);
  font-size: .67rem;
  font-weight: 650;
  letter-spacing: .025em;
  white-space: nowrap;
}
th, td {
  padding: 15px 12px;
  border-bottom: 1px solid var(--border);
}
th:first-child, td:first-child {
  padding-left: 22px;
}
td {
  vertical-align: top;
  overflow-wrap: anywhere;
  min-width: 75px;
}
tr:last-child td {
  border-bottom: 0;
}
tr.selectable {
  cursor: pointer;
}
tr.selectable:hover {
  background: var(--subtle);
}
tr.selectable.active {
  background: var(--selected);
  box-shadow: inset 3px 0 var(--accent);
}
tr.selectable:focus-visible {
  outline-offset: -3px;
}
.code-cell {
  min-width: 125px;
}
.code-cell strong {
  display: block;
  font-size: .82rem;
  font-weight: 650;
}
.code-cell span, td .small {
  display: block;
  margin-top: 5px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: .73rem;
  line-height: 1.45;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: .67rem;
  font-weight: 650;
  white-space: nowrap;
}
.status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.status.pending {
  color: var(--warning-text);
  background: var(--warning-bg);
}
.status.active {
  color: var(--accent);
  background: var(--selected);
}
.status.expired {
  color: var(--danger);
  background: var(--danger-bg);
}
.status.closed {
  color: var(--muted);
  background: var(--subtle);
}
.hours {
  min-width: 90px;
  font-variant-numeric: tabular-nums;
}
.hours.over {
  color: var(--danger);
  font-weight: 700;
}
.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 22px;
  border-bottom: 1px solid var(--border);
}
.editor-header h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -.02em;
}
.editor-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .8rem;
  overflow-wrap: anywhere;
}
.form {
  display: grid;
  gap: 22px;
  padding: 22px;
}
.form-help {
  margin: 0;
  padding: 12px 14px;
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  background: var(--subtle);
  font-size: .78rem;
  line-height: 1.6;
}
.form-section {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.form-section legend {
  width: 100%;
  margin-bottom: 14px;
  padding: 0 0 9px;
  border-bottom: 1px solid var(--border);
  font-size: .83rem;
  font-weight: 700;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.field.full {
  grid-column: 1 / -1;
}
.field label {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 600;
}
.field-hint {
  font-size: .68rem;
  color: var(--muted);
}
.field input, .field select, .field textarea, .time-form input, .time-row input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--text);
  background: var(--input);
  font-size: .83rem;
}
.field input:hover, .field select:hover, .field textarea:hover {
  border-color: var(--muted);
}
.field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.form-actions {
  position: sticky;
  bottom: 0;
  padding: 14px 0;
  margin-bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 2;
}
.form-actions .primary-button {
  flex: 1;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  border-bottom: 1px solid var(--border);
  background: var(--subtle);
}
.metric {
  min-width: 0;
  padding: 16px 22px;
  border-right: 1px solid var(--border);
}
.metric:last-child {
  border-right: 0;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: .7rem;
}
.metric strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -.03em;
}
.warning, .error, .sync-message {
  border: 1px solid;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: .82rem;
  line-height: 1.5;
}
.warning {
  margin: 14px 22px 0;
  color: var(--warning-text);
  background: var(--warning-bg);
  border-color: var(--warning-border);
}
.error {
  margin-bottom: 16px;
  color: var(--danger);
  background: var(--danger-bg);
  border-color: var(--danger-border);
}
.sync-message {
  margin-bottom: 16px;
  color: var(--accent);
  background: var(--selected);
  border-color: var(--accent);
}
.empty {
  padding: 64px 24px;
  color: var(--muted);
  font-size: .86rem;
  text-align: center;
}
.empty.compact {
  padding: 22px 8px 8px;
  font-size: .78rem;
}
.time-section {
  border-top: 1px solid var(--border);
  padding: 22px;
  background: var(--subtle);
}
.time-section h3 {
  margin: 0 0 16px;
  font-size: .95rem;
}
.time-form, .time-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 8px;
  align-items: center;
}
.time-form input:nth-of-type(3), .time-row input:nth-of-type(3) {
  grid-column: 1 / -1;
}
.time-form button, .time-row .actions {
  justify-self: end;
  grid-column: 1 / -1;
}
.time-row {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.auth-gate {
  display: grid;
  place-items: center;
  min-height: 65vh;
}
.auth-card {
  width: min(420px, 100%);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.auth-card h1, .auth-card p {
  margin: 0;
}
.auth-card h1 {
  letter-spacing: -.04em;
}
.auth-card p {
  line-height: 1.6;
}
@media (max-width: 1280px) {
  .shell {
    width: calc(100% - 40px);
  }
  .workspace {
    gap: 16px;
  }
  .user-chip {
    display: none;
  }
}
@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .editor-panel {
    position: static;
    max-height: none;
    overflow: hidden;
  }
  .workspace.editor-priority .editor-panel {
    order: -1;
  }
  .table-wrap {
    max-height: 60vh;
  }
  .topbar {
    align-items: flex-start;
  }
  .theme-picker label {
    display: none;
  }
}
@media (max-width: 720px) {
  .time-form, .time-row {
    grid-template-columns: 1fr;
  }
  .shell {
    width: calc(100% - 24px);
    padding-top: 22px;
  }
  .topbar {
    flex-direction: column;
    gap: 18px;
    margin-bottom: 20px;
  }
  .title h1 {
    font-size: 1.7rem;
  }
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }
  .theme-picker {
    margin-right: auto;
  }
  .topbar-actions .primary-button {
    margin-left: auto;
  }
  .list-heading, .editor-header, .form, .time-section {
    padding: 18px;
  }
  .toolbar {
    padding: 0 18px 18px;
  }
  .tabs {
    gap: 2px;
  }
  .tab {
    padding-inline: 10px;
  }
  .table-wrap {
    min-height: 0;
  }
  table, tbody {
    display: block;
  }
  thead {
    display: none;
  }
  tr.selectable {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 14px;
    padding: 18px;
    border-bottom: 1px solid var(--border);
  }
  td, td:first-child {
    display: block;
    padding: 0;
    border: 0;
    min-width: 0;
  }
  td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: .65rem;
    margin-bottom: 5px;
  }
  td.code-cell {
    grid-column: 1 / -1;
  }
  .code-cell strong {
    font-size: .94rem;
  }
  .field input, .field select, .field textarea, .time-form input, .time-row input {
    font-size: 1rem;
  }
  .metric {
    padding: 14px 18px;
  }
  .metric strong {
    font-size: 1rem;
  }
  .warning {
    margin-inline: 18px;
  }
}
@media (max-width: 400px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .topbar-actions .secondary-button {
    padding-inline: 9px;
  }
  .tab {
    padding-inline: 8px;
  }
  .auth-card {
    padding: 28px;
  }
}
