:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --font-ui: "Segoe UI Variable", "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  --canvas: #171A1D;
  --shell: #1D2023;
  --sidebar: #202427;
  --surface: #272B2E;
  --surface-raised: #2D3134;
  --surface-active: #3A3030;
  --text: #F4F3F0;
  --text-muted: #A6AAA9;
  --divider: rgba(255,255,255,.07);
  --accent: #FF574D;
  --accent-hover: #FF6B61;
  --info: #61A3FF;
  --info-foreground: #8FC1FF;
  --warning: #FFBE32;
  --warning-foreground: #FFD166;
  --danger: #FF5B55;
  --danger-foreground: #FF8B85;
  --success: #42D485;
  --success-foreground: #42D485;
  --badge-danger: #FF5B55;
  --badge-on-danger: #171A1D;
  --badge-on-accent: #171A1D;
}

:root[data-theme="light"] {
  color-scheme: light;
  --canvas: #E4E1DA;
  --shell: #F5F3EF;
  --sidebar: #FCFCFA;
  --surface: #FFFFFF;
  --surface-raised: #F0EFEB;
  --surface-active: #FFF0EB;
  --text: #283235;
  --text-muted: #596467;
  --divider: rgba(40,50,53,.09);
  --accent: #FF704D;
  --accent-hover: #F45F3D;
  --info: #357DE8;
  --info-foreground: #174F9C;
  --warning: #D99500;
  --warning-foreground: #6B4A00;
  --danger: #D94742;
  --danger-foreground: #9F2724;
  --success: #208A57;
  --success-foreground: #14663E;
  --badge-danger: #B63B37;
  --badge-on-danger: #FFFFFF;
  --badge-on-accent: #283235;
}

:root {
  --color-canvas: var(--canvas);
  --color-surface: var(--surface);
  --color-surface-raised: var(--surface-raised);
  --color-surface-muted: var(--surface-raised);
  --color-ink: var(--text);
  --color-muted: var(--text-muted);
  --color-text: var(--text);
  --color-text-muted: var(--text-muted);
  --color-border: var(--divider);
  --color-border-strong: color-mix(in srgb, var(--text) 18%, transparent);
  --color-accent: var(--accent);
  --color-accent-strong: var(--accent-hover);
  --color-accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --color-accent-border: color-mix(in srgb, var(--accent) 36%, transparent);
  --color-violet: var(--info);
  --color-violet-soft: color-mix(in srgb, var(--info) 14%, transparent);
  --color-teal: var(--success);
  --color-teal-soft: color-mix(in srgb, var(--success) 14%, transparent);
  --color-coral: var(--danger);
  --color-coral-soft: color-mix(in srgb, var(--danger) 14%, transparent);
  --color-success: var(--success);
  --color-success-soft: color-mix(in srgb, var(--success) 14%, transparent);
  --color-warning: var(--warning);
  --color-warning-soft: color-mix(in srgb, var(--warning) 14%, transparent);
  --color-danger: var(--danger);
  --color-danger-soft: color-mix(in srgb, var(--danger) 14%, transparent);
  --radius-small: 8px;
  --radius-control: 13px;
  --radius-card: 20px;
  --radius-dialog: 16px;
  --shadow-card: 0 12px 32px rgb(0 0 0 / 10%);
  --shadow-raised: 0 24px 72px rgb(0 0 0 / 24%);
  --sidebar-width: 244px;
  --sidebar-rail-width: 84px;
  --header-height: 64px;
  --topbar-height: var(--header-height);
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  font-family: var(--font-ui);
  font-size: 16px;
  font-synthesis: none;
  color: var(--text);
  background: var(--canvas);
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--color-ink);
  background: var(--color-canvas);
}

body,
button,
input,
select,
textarea {
  font-family: var(--font-ui);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .52;
}

a {
  color: var(--color-accent-strong);
  text-underline-offset: .18em;
}

a:hover {
  color: var(--color-accent);
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

code {
  padding: .14rem .3rem;
  border-radius: 5px;
  color: var(--text);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: .82em;
  background: var(--surface-raised);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 2px;
}

::selection {
  color: #fff;
  background: var(--color-accent);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: .75rem;
  left: .75rem;
  padding: .6rem .8rem;
  border-radius: var(--radius-control);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  background: var(--color-ink);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--canvas);
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100svh;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--space-6);
  padding: var(--space-5) var(--space-4);
  border-right: 1px solid var(--divider);
  background: var(--sidebar);
}

.sidebar-brand {
  padding: 0 var(--space-2);
}

.brand {
  display: inline-flex;
  gap: var(--space-3);
  align-items: center;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -.03em;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  color: var(--badge-on-accent);
  font-size: .9rem;
  background: var(--accent);
}

.app-navigation {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: var(--space-1);
}

.nav-link {
  display: flex;
  min-height: 44px;
  gap: var(--space-3);
  align-items: center;
  padding: .65rem .75rem;
  border-radius: 13px;
  color: var(--text-muted);
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease;
}

.nav-link > i {
  flex: 0 0 auto;
  font-size: 1.15rem;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.nav-link[aria-current="page"] {
  color: var(--accent);
  background: var(--surface-active);
}

.nav-link-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-count-badge {
  display: inline-grid;
  min-width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  margin-left: auto;
  padding: 0 .35rem;
  border-radius: 999px;
  color: var(--badge-on-danger);
  font-size: .65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: var(--badge-danger);
}

.nav-count-badge-dashboard {
  color: var(--badge-on-accent);
  background: var(--accent);
}

.nav-count-badge-pulse {
  animation: nav-count-pulse 420ms ease-out;
}

.sidebar-account {
  display: flex;
  min-width: 0;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border-radius: 14px;
  background: var(--surface-raised);
}

.sidebar-account-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: var(--surface-active);
}

.sidebar-account-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.sidebar-account-copy > span {
  color: var(--text-muted);
  font-size: .68rem;
}

.sidebar-account-copy > strong {
  overflow: hidden;
  font-size: .78rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-workspace {
  min-width: 0;
  min-height: 100vh;
  background: var(--shell);
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: var(--header-height);
  justify-content: flex-end;
  align-items: center;
  padding: 0 clamp(1rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--divider);
  background: color-mix(in srgb, var(--shell) 94%, transparent);
  backdrop-filter: blur(12px);
}

.header-account {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
  gap: var(--space-2);
  align-items: center;
}

.header-logout-form {
  display: flex;
  flex: 0 0 auto;
}

.utility-button,
.logout-button,
.sound-toggle,
.nav-toggle {
  display: inline-flex;
  min-width: 40px;
  min-height: 40px;
  justify-content: center;
  gap: var(--space-2);
  align-items: center;
  padding: .5rem .7rem;
  border: 1px solid var(--divider);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  background: var(--surface);
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}

.utility-button:hover,
.logout-button:hover,
.sound-toggle:hover,
.nav-toggle:hover {
  border-color: color-mix(in srgb, var(--text) 24%, transparent);
  color: var(--text);
  background: var(--surface-raised);
}

.nav-toggle {
  display: none;
  margin-right: auto;
}

.sound-toggle {
  padding: 0;
}

.sound-toggle[aria-pressed="false"] {
  color: var(--text-muted);
}

.theme-toggle {
  position: relative;
  padding: 0;
}

.theme-toggle .theme-icon-dark,
.theme-toggle[aria-checked="true"] .theme-icon-light {
  display: none;
}

.theme-toggle[aria-checked="true"] .theme-icon-dark {
  display: inline-block;
}

.shift-utility {
  font-variant-numeric: tabular-nums;
}

.shift-utility-copy {
  display: inline-flex;
  gap: var(--space-1);
  align-items: baseline;
}

.shift-utility time {
  color: var(--text);
  font-size: .7rem;
}

.notification-center-link {
  position: relative;
  padding: 0;
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-grid;
  min-width: 1.2rem;
  height: 1.2rem;
  place-items: center;
  padding: 0 .25rem;
  border: 2px solid var(--shell);
  border-radius: 999px;
  color: var(--badge-on-danger);
  font-size: .58rem;
  font-weight: 700;
  line-height: 1;
  background: var(--badge-danger);
}

.notification-badge[hidden] {
  display: none;
}

.notification-toast-region {
  position: fixed;
  z-index: 80;
  top: calc(var(--header-height) + 1rem);
  right: 1rem;
  display: grid;
  width: min(390px, calc(100vw - 2rem));
  gap: var(--space-3);
  pointer-events: none;
}

.notification-toast {
  display: grid;
  gap: var(--space-2);
  padding: .9rem 1rem;
  border-radius: 14px;
  color: var(--text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  pointer-events: auto;
}

.notification-toast > strong {
  font-size: .86rem;
}

.notification-toast p {
  margin: 0;
  color: var(--text-muted);
  font-size: .76rem;
  line-height: 1.5;
}

.notification-toast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.notification-toast-link,
.notification-toast-read {
  min-height: 34px;
  padding: .4rem .55rem;
  border: 1px solid var(--divider);
  border-radius: 9px;
  color: var(--text);
  font: inherit;
  font-size: .7rem;
  font-weight: 700;
  background: var(--surface);
  text-decoration: none;
  cursor: pointer;
}

.notification-toast-link:hover,
.notification-toast-read:hover {
  border-color: color-mix(in srgb, var(--text) 24%, transparent);
  color: var(--text);
  background: var(--surface-active);
}

.app-nav-backdrop {
  display: none;
}

.page-shell {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2.5rem) 5rem;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  align-items: end;
  margin-bottom: var(--space-6);
}

.page-heading h1,
.page-heading p {
  margin: 0;
}

.page-heading h1 {
  margin-top: .35rem;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -.04em;
}

.page-heading p {
  max-width: 650px;
  margin-top: .5rem;
  color: var(--color-muted);
  font-size: .9rem;
  line-height: 1.55;
}

.page-heading-meta {
  display: grid;
  min-width: 92px;
  gap: .1rem;
  justify-items: end;
}

.page-heading-meta span {
  color: var(--color-muted);
  font-size: .68rem;
  font-weight: 650;
  text-transform: uppercase;
}

.page-heading-meta strong {
  font-size: 1.65rem;
  letter-spacing: -.04em;
}

.eyebrow,
.cell-label {
  color: var(--color-muted);
  font-size: .64rem;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.muted {
  color: var(--color-muted);
}

.button {
  display: inline-flex;
  min-height: 40px;
  justify-content: center;
  gap: .5rem;
  align-items: center;
  padding: .6rem .85rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-control);
  color: var(--color-ink);
  font-size: .8rem;
  font-weight: 680;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  background: var(--color-surface);
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.button:hover {
  border-color: color-mix(in srgb, var(--text) 24%, transparent);
  color: var(--color-ink);
  background: var(--surface-raised);
}

.button-primary {
  border-color: var(--accent);
  color: #171A1D;
  background: var(--accent);
}

.button-primary:hover {
  border-color: var(--accent-hover);
  color: #171A1D;
  background: var(--accent-hover);
}

.button-secondary {
  border-color: var(--divider);
  color: var(--color-ink);
  background: var(--surface-raised);
}

.button-secondary:hover {
  background: var(--surface-active);
}

.button-ghost {
  color: var(--text-muted);
  background: transparent;
}

.button-danger-soft {
  border-color: color-mix(in srgb, var(--danger) 32%, transparent);
  color: var(--danger-foreground);
  background: var(--color-danger-soft);
}

.button-danger-soft:hover {
  border-color: var(--danger);
  color: var(--danger-foreground);
  background: color-mix(in srgb, var(--danger) 18%, transparent);
}

.button-large {
  min-height: 44px;
  padding: .7rem 1rem;
  font-size: .84rem;
}

.button-small {
  min-height: 34px;
  padding: .42rem .65rem;
  border-radius: var(--radius-control);
  font-size: .73rem;
}

.button-block {
  width: 100%;
}

.field {
  display: grid;
  min-width: 0;
  gap: .4rem;
}

.field label,
.field-label {
  color: var(--text);
  font-size: .75rem;
  font-weight: 650;
}

.field small,
.field-hint {
  color: var(--color-muted);
  font-size: .69rem;
  line-height: 1.4;
}

.field input,
.field select,
.field textarea,
.field .receipt-operation-datetime-field-trigger,
.table-form input:not([type="checkbox"]),
.table-form select,
.admin-create-row input,
.admin-create-row select {
  width: 100%;
  min-height: 44px;
  padding: .58rem .68rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-control);
  color: var(--color-ink);
  background: var(--surface-raised);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field textarea {
  min-height: 105px;
  resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.field .receipt-operation-datetime-field-trigger:hover,
.table-form input:not([type="checkbox"]):hover,
.table-form select:hover,
.admin-create-row input:hover,
.admin-create-row select:hover {
  border-color: color-mix(in srgb, var(--text) 24%, transparent);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.field .receipt-operation-datetime-field-trigger:focus-visible,
.table-form input:not([type="checkbox"]):focus-visible,
.table-form select:focus-visible,
.admin-create-row input:focus-visible,
.admin-create-row select:focus-visible {
  border-color: var(--color-accent);
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"],
.field .receipt-operation-datetime-field-trigger[aria-invalid="true"] {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

.status-pill,
.team-chip {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: .24rem .5rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: .66rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  background: var(--surface-raised);
}

.status-success,
.status-ready,
.status-completed {
  border-color: color-mix(in srgb, var(--success) 32%, transparent);
  color: var(--success-foreground);
  background: var(--color-success-soft);
}

.status-warning,
.status-duplicate,
.status-needs_amount,
.status-needs_rates {
  border-color: color-mix(in srgb, var(--warning) 32%, transparent);
  color: var(--warning-foreground);
  background: var(--color-warning-soft);
}

.status-danger,
.status-error,
.status-deleted {
  border-color: color-mix(in srgb, var(--danger) 32%, transparent);
  color: var(--danger-foreground);
  background: var(--color-danger-soft);
}

.banner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: .85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  font-size: .8rem;
  background: var(--color-surface);
}

.banner-success {
  border-color: color-mix(in srgb, var(--success) 32%, transparent);
  color: var(--success);
  background: var(--color-success-soft);
}

.banner-warning {
  border-color: color-mix(in srgb, var(--warning) 32%, transparent);
  color: var(--warning);
  background: var(--color-warning-soft);
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-content: center;
  justify-items: center;
  padding: 2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  text-align: center;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.empty-state h2,
.empty-state p {
  margin: 0;
}

.empty-state h2 {
  margin-top: .65rem;
  font-size: 1.2rem;
}

.empty-state p {
  max-width: 420px;
  margin-top: .4rem;
  color: var(--color-muted);
  font-size: .84rem;
  line-height: 1.5;
}

.empty-state-compact {
  min-height: 170px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .79rem;
  background: var(--color-surface);
}

.data-table th,
.data-table td {
  padding: .75rem .85rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}

.data-table thead th {
  color: var(--color-muted);
  font-size: .65rem;
  font-weight: 750;
  letter-spacing: .045em;
  white-space: nowrap;
  text-transform: uppercase;
  background: var(--surface-raised);
}

.data-table tbody tr:last-child > * {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: var(--surface-active);
}

.pagination {
  display: grid;
  width: 100%;
  max-width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3) var(--space-5);
  align-items: center;
  margin-top: 1.5rem;
  color: var(--color-muted);
  font-size: .78rem;
}

.pagination-navigation,
.pagination-meta,
.pagination-jump,
.pagination-size,
.pagination-jump label,
.pagination-size label {
  display: flex;
  min-width: 0;
  align-items: center;
}

.pagination-navigation {
  gap: var(--space-2);
}

.pagination-meta {
  justify-content: flex-end;
  gap: var(--space-4);
  white-space: nowrap;
}

.pagination-action {
  min-width: 44px;
  min-height: 44px;
  gap: var(--space-1);
}

.pagination-action[disabled] {
  opacity: .42;
}

.pagination-jump,
.pagination-size {
  gap: var(--space-2);
}

.pagination-jump label,
.pagination-size label {
  gap: var(--space-2);
}

.pagination-jump input,
.pagination-size select {
  min-height: 44px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-control);
  color: var(--color-ink);
  background: var(--color-surface-raised);
}

.pagination-jump input {
  width: 4.25rem;
  min-width: 0;
  padding: .5rem .65rem;
  text-align: center;
}

.pagination-size select {
  min-width: 4.5rem;
  padding: .5rem 1.75rem .5rem .65rem;
}

.pagination-jump .button,
.pagination-size .button {
  min-height: 44px;
}

.pagination-found strong,
.pagination-position strong {
  color: var(--color-ink);
}

.pagination-error {
  grid-column: 1 / -1;
  margin: 0;
  padding: .7rem .85rem;
  border: 1px solid color-mix(in srgb, var(--color-danger) 45%, var(--color-border));
  border-radius: var(--radius-control);
  color: var(--danger-foreground);
  background: var(--color-danger-soft);
}

dialog {
  width: min(calc(100% - 2rem), 470px);
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  color: var(--color-ink);
  background: var(--color-surface);
  box-shadow: var(--shadow-raised);
}

dialog::backdrop {
  background: rgb(0 0 0 / 52%);
  backdrop-filter: blur(2px);
}

dialog form {
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem;
}

.dialog-heading {
  display: grid;
  gap: .45rem;
}

.dialog-heading h2,
.dialog-heading p {
  margin: 0;
}

.dialog-heading h2 {
  font-size: 1.3rem;
  letter-spacing: -.025em;
}

.dialog-heading p {
  color: var(--color-muted);
  font-size: .84rem;
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}

.shift-handoff-dialog {
  width: min(calc(100% - 2rem), 520px);
}

.shift-handoff-dialog[open] {
  animation: shift-handoff-enter 180ms ease-out both;
}

.shift-handoff-dialog-shell {
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem;
}

.shift-handoff-dialog form {
  display: block;
  padding: 0;
}

.shift-handoff-dialog form[hidden] {
  display: none;
}

.shift-handoff-countdown {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin: 0;
  padding: .85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  color: var(--color-muted);
  background: var(--color-surface-muted);
  font-size: .82rem;
}

.shift-handoff-countdown strong {
  color: var(--color-ink);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.shift-handoff-live-status {
  position: fixed;
  z-index: 55;
  top: calc(var(--header-height) + .75rem);
  left: 50%;
  width: min(calc(100% - 2rem), 560px);
  margin: 0;
  padding: .85rem 1rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-control);
  color: var(--color-ink);
  background: var(--color-surface);
  box-shadow: var(--shadow-raised);
  transform: translateX(-50%);
}

.shift-handoff-fallback {
  display: grid;
  gap: .75rem;
  margin-bottom: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.shift-handoff-fallback h2,
.shift-handoff-fallback p {
  margin: 0;
}

.shift-handoff-fallback h2 {
  font-size: 1.1rem;
}

.shift-handoff-fallback p {
  color: var(--color-muted);
  font-size: .84rem;
  line-height: 1.5;
}

.shift-handoff-fallback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

@keyframes shift-handoff-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-page {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  background: var(--canvas);
}

.login-shell {
  width: min(100%, 400px);
}

.login-card {
  padding: clamp(1.75rem, 7vw, 2.5rem);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 64px rgb(0 0 0 / 18%);
}

.login-brand {
  margin: 0 0 1.75rem;
  text-align: center;
  font-size: clamp(2rem, 8vw, 2.5rem);
  font-weight: 720;
  letter-spacing: -.04em;
  line-height: 1;
}

.login-error {
  margin-bottom: 1rem;
  padding: .8rem .9rem;
  border-radius: 12px;
  color: var(--danger-foreground);
  font-size: .82rem;
  font-weight: 620;
  line-height: 1.45;
  background: var(--color-danger-soft);
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-form .button {
  min-height: 48px;
  margin-top: .35rem;
}

.login-form input {
  min-height: 48px;
  background: var(--surface-raised);
}

.error-page {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  background: var(--canvas);
}

.error-shell {
  width: min(100%, 440px);
}

.error-card {
  padding: clamp(1.75rem, 7vw, 2.5rem);
  border-radius: 22px;
  text-align: center;
  background: var(--surface);
  box-shadow: 0 24px 64px rgb(0 0 0 / 18%);
}

.error-brand {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--color-ink);
  font-size: 1.35rem;
  font-weight: 720;
  letter-spacing: -.04em;
  text-decoration: none;
}

.error-brand:hover {
  color: var(--color-ink);
}

.error-status {
  display: inline-flex;
  min-height: 30px;
  padding: .35rem .72rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--danger-foreground);
  font-size: .75rem;
  font-weight: 700;
  background: var(--color-danger-soft);
}

.error-card h1 {
  margin: .9rem 0 0;
  font-size: clamp(1.55rem, 6vw, 2rem);
  letter-spacing: -.035em;
}

.error-card p {
  max-width: 34ch;
  margin: .65rem auto 1.5rem;
  color: var(--color-muted);
  font-size: .9rem;
  line-height: 1.55;
}

@media (max-width: 1260px) {
  .app-shell {
    grid-template-columns: var(--sidebar-rail-width) minmax(0, 1fr);
  }

  .app-sidebar {
    width: var(--sidebar-rail-width);
    padding-inline: var(--space-3);
  }

  .sidebar-brand {
    padding: 0;
    text-align: center;
  }

  .brand > span:last-child,
  .sidebar-account-copy {
    display: none;
  }

  .nav-link-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .brand,
  .nav-link,
  .sidebar-account {
    justify-content: center;
  }

  .nav-link {
    position: relative;
    padding-inline: var(--space-2);
  }

  .nav-count-badge {
    position: absolute;
    top: 1px;
    right: 0;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 .25rem;
  }
}

@keyframes nav-count-pulse {
  0% {
    transform: scale(.86);
  }

  55% {
    transform: scale(1.18);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes status-breathe {
  0%,
  100% {
    opacity: .72;
    transform: scale(.94);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    width: min(320px, calc(100vw - 2rem));
    padding: var(--space-5) var(--space-4) max(var(--space-5), env(safe-area-inset-bottom));
    box-shadow: var(--shadow-raised);
    transform: translateX(-105%);
    transition: transform 180ms cubic-bezier(.22, 1, .36, 1);
  }

  .nav-open .app-sidebar {
    transform: translateX(0);
  }

  .brand > span:last-child {
    display: inline;
  }

  .nav-link-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }

  .sidebar-account-copy {
    display: grid;
  }

  .brand,
  .nav-link,
  .sidebar-account {
    justify-content: flex-start;
  }

  .nav-link {
    padding-inline: .75rem;
  }

  .nav-count-badge {
    position: static;
    min-width: 1.35rem;
    height: 1.35rem;
    margin-left: auto;
  }

  .app-nav-backdrop {
    position: fixed;
    z-index: 35;
    inset: 0;
    display: block;
    border: 0;
    background: rgb(0 0 0 / 52%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease-out;
  }

  .nav-open .app-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-open {
    overflow: hidden;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .app-header {
    padding-inline: max(.85rem, env(safe-area-inset-left)) max(.85rem, env(safe-area-inset-right));
  }

  .utility-button,
  .nav-toggle {
    inline-size: 44px;
    min-inline-size: 44px;
    max-inline-size: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    padding: 0;
  }

  .button,
  .button-small,
  .notification-toast-link,
  .notification-toast-read,
  .field input,
  .field select,
  .field textarea,
  .table-form input:not([type="checkbox"]),
  .table-form select,
  .admin-create-row input,
  .admin-create-row select {
    min-inline-size: 44px;
    min-height: 44px;
  }

  .shift-utility span,
  .logout-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
}

@media (max-width: 360px) {
  .app-header {
    padding-inline: max(.625rem, env(safe-area-inset-left)) max(.625rem, env(safe-area-inset-right));
  }

  .header-account {
    gap: var(--space-1);
  }
}

@media (max-width: 700px) {
  .logout-button,
  .nav-toggle {
    min-height: 44px;
  }

  .page-shell {
    padding: 1.5rem 1rem 4rem;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading-meta {
    display: flex;
    align-items: baseline;
    justify-items: start;
  }

  .page-heading-meta strong {
    font-size: 1.4rem;
  }

  .banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-wrap {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions .button {
    width: 100%;
  }

  .login-card {
    padding: 1.5rem;
  }

  .error-card {
    padding: 1.5rem;
  }
}

@media (max-width: 560px) {
  .shift-handoff-dialog {
    width: calc(100% - 1rem);
  }

  .shift-handoff-dialog-shell {
    gap: 1rem;
    padding: 1rem;
  }

  .shift-handoff-actions,
  .shift-handoff-fallback-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .shift-handoff-actions form,
  .shift-handoff-actions .button,
  .shift-handoff-fallback-actions form,
  .shift-handoff-fallback-actions .button {
    width: 100%;
  }

  .pagination {
    gap: var(--space-3);
  }

  .pagination-navigation {
    display: grid;
    grid-template-columns: repeat(4, 44px);
    gap: var(--space-2);
    justify-content: space-between;
  }

  .pagination-action {
    width: 44px;
    padding-inline: 0;
  }

  .pagination-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .pagination-action[data-page-action="first"] {
    grid-column: 1;
    grid-row: 1;
  }

  .pagination-action[data-page-action="previous"] {
    grid-column: 2;
    grid-row: 1;
  }

  .pagination-action[data-page-action="next"] {
    grid-column: 3;
    grid-row: 1;
  }

  .pagination-action[data-page-action="last"] {
    grid-column: 4;
    grid-row: 1;
  }

  .pagination-jump {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .pagination-jump label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pagination-jump input {
    width: 100%;
  }

  .pagination-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-2);
    white-space: normal;
  }

  .pagination-position {
    text-align: right;
  }

  .pagination-size {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .pagination-size label {
    justify-content: space-between;
  }
}

@media (max-width: 960px) {
  .pagination {
    grid-template-columns: minmax(0, 1fr);
  }

  .pagination-navigation,
  .pagination-meta {
    flex-wrap: wrap;
  }

  .pagination-meta {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }

  .shift-handoff-dialog[open] {
    animation: none;
  }
}
