/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --ink:            #18181b;
  --ink-2:          #3f3f46;
  --muted:          #71717a;
  --faint:          #a1a1aa;
  --line:           #e6e7eb;
  --line-soft:      #f0f1f3;
  --surface:        #ffffff;
  --canvas:         #f4f5f7;
  --rail:           #17171a;
  --rail-hover:     #26262b;
  --rail-text:      #a7a7ae;
  --accent:         #e07b39;
  --accent-soft:    #fdf1e7;
  --focus:          #2563eb;

  --present:        #15803d;  --present-bg:  #dcfce7;
  --absent:         #b91c1c;  --absent-bg:   #fee2e2;
  --late:           #b45309;  --late-bg:     #fef3c7;
  --leave:          #6d28d9;  --leave-bg:    #ede9fe;
  --early:          #0e7490;  --early-bg:    #cffafe;
  --half:           #1d4ed8;  --half-bg:     #dbeafe;
  --holiday:        #0f766e;  --holiday-bg:  #ccfbf1;
  --weekoff:        #475569;  --weekoff-bg:  #e2e8f0;
  --unmarked:       #52525b;  --unmarked-bg: #f1f1f3;

  --r-sm: 8px; --r-md: 11px; --r-lg: 15px; --r-pill: 999px;
  --shadow: 0 1px 2px rgba(24,24,27,.05), 0 1px 3px rgba(24,24,27,.04);
  --shadow-lg: 0 8px 28px rgba(24,24,27,.10);
  --rail-w: 244px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, monospace;
}

/* ==========================================================================
   Theme overrides
   Each block flips the five tokens that carry a theme's identity. Status
   colors and everything else stay put on purpose - a theme is a coat of
   paint, not a redesign. Keep this in sync with app/themes.py.
   ========================================================================== */
:root[data-theme="navy"] {
  --rail: #0f1729;   --rail-hover: #1b2740;
  --accent: #c2703d; --accent-soft: #fbeee2;
  --focus: #3b82f6;
}
:root[data-theme="forest"] {
  --rail: #10261e;   --rail-hover: #1a3a2c;
  --accent: #c9962f; --accent-soft: #fbf1dd;
  --focus: #16a34a;
}
:root[data-theme="slate"] {
  --rail: #111827;   --rail-hover: #1f2937;
  --accent: #0d9488; --accent-soft: #e6f7f5;
  --focus: #2563eb;
}
:root[data-theme="espresso"] {
  --rail: #1c1310;   --rail-hover: #2b1e19;
  --accent: #b3532e; --accent-soft: #f7e6de;
  --focus: #d97706;
}
:root[data-theme="maroon"] {
  --rail: #241012;   --rail-hover: #331a1d;
  --accent: #8b2e2e; --accent-soft: #f6e6e6;
  --focus: #b91c1c;
}
:root[data-theme="inkblue"] {
  --rail: #0b1220;   --rail-hover: #16223a;
  --accent: #65a30d; --accent-soft: #ecfccb;
  --focus: #2563eb;
}
:root[data-theme="graphite"] {
  --rail: #18181b;   --rail-hover: #27272a;
  --accent: #be123c; --accent-soft: #fce7ec;
  --focus: #2563eb;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.012em; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }

/* ==========================================================================
   Shell
   ========================================================================== */
.shell { display: flex; min-height: 100vh; }

.rail {
  width: var(--rail-w);
  flex: 0 0 var(--rail-w);
  background: var(--rail);
  color: var(--rail-text);
  display: flex;
  flex-direction: column;
  padding: 16px 14px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.rail__brand {
  display: flex; align-items: center; gap: 10px;
  background: #fff; color: var(--ink);
  border-radius: var(--r-lg);
  padding: 11px 13px;
  font-weight: 650; font-size: 13px;
  margin-bottom: 22px;
  text-decoration: none;
}
.rail__brand-mark {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center;
  background: var(--ink); color: #fff;
  border-radius: 7px; font-size: 11px; font-weight: 700;
}
.rail__brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rail__group { margin-bottom: 4px; }
.rail__label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
  color: #5d5d66; padding: 14px 12px 6px; font-weight: 600;
}

.rail a.rail__item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--r-md);
  color: var(--rail-text); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.rail a.rail__item:hover { background: var(--rail-hover); color: #f4f4f5; }
.rail a.rail__item.is-active { background: var(--rail-hover); color: #fff; font-weight: 600; }
.rail__item svg { width: 17px; height: 17px; flex: none; opacity: .85; }

.rail__sub { padding-left: 14px; margin-top: 2px; }
.rail__sub a.rail__item {
  font-size: 13px; padding: 7px 12px;
  position: relative;
}
.rail__sub a.rail__item::before {
  content: ""; position: absolute; left: -2px; top: 50%;
  width: 9px; height: 1px; background: #46464e;
}

.tag {
  margin-left: auto; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--r-pill);
  background: rgba(224,123,57,.16); color: var(--accent);
  letter-spacing: .03em;
}

.rail__foot { margin-top: auto; padding-top: 18px; }
.rail__user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--rail-hover);
}
.rail__user strong { color: #fff; font-size: 13px; display: block; }
.rail__user span { font-size: 11.5px; color: #7f7f89; text-transform: capitalize; }

/* ==========================================================================
   Workspace
   ========================================================================== */
.work { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 58px; flex: none;
  background: var(--rail);
  display: flex; align-items: center; gap: 16px;
  padding: 0 22px;
}
.topbar__search {
  flex: 1; max-width: 620px; margin: 0 auto;
  position: relative;
}
.topbar__search input {
  width: 100%; height: 36px;
  background: #26262b; border: 1px solid #303036;
  border-radius: var(--r-md);
  color: #ededf0; font-size: 13.5px;
  padding: 0 12px 0 34px;
}
.topbar__search input::placeholder { color: #7a7a84; }
.topbar__search svg {
  position: absolute; left: 11px; top: 9px;
  width: 16px; height: 16px; color: #7a7a84;
}
.topbar__me { color: #e4e4e7; font-size: 12.5px; text-align: right; line-height: 1.25; }
.topbar__me small { display: block; color: #7f7f89; font-size: 11px; }

.page { padding: 24px 26px 56px; max-width: 1500px; width: 100%; }

.page__head {
  display: flex; align-items: flex-start; gap: 16px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.page__head h1 { line-height: 1.2; }
.page__head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.page__actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card__head h2 { font-size: 15.5px; }
.card__head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.card__head .spacer { margin-left: auto; }
.card__body { padding: 20px; }
.card__body--tight { padding: 0; }
.card__foot {
  padding: 13px 20px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.greeting h2 { font-size: 21px; }
.greeting p { color: var(--muted); margin: 6px 0 12px; }
.greeting__org {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 650; color: var(--accent); font-size: 14px;
}
.greeting__org .box {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}

/* ==========================================================================
   Stat rail
   ========================================================================== */
.stats {
  display: flex; align-items: stretch; gap: 0;
  flex-wrap: wrap; padding: 18px 20px;
}
.stats__title {
  min-width: 130px; padding-right: 20px;
  display: flex; flex-direction: column; gap: 10px; justify-content: center;
}
.stats__title h3 { font-size: 16px; line-height: 1.25; }
.stats__grid {
  flex: 1; display: grid; gap: 0 0;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}
.stat {
  padding: 4px 14px; border-left: 3px solid var(--line);
  margin-bottom: 14px;
}
.stat__label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 600;
}
.stat__value { font-size: 22px; font-weight: 620; letter-spacing: -.02em; margin-top: 2px; }
.stat--present  { border-left-color: var(--present); }
.stat--absent   { border-left-color: var(--absent); }
.stat--unmarked { border-left-color: var(--faint); }
.stat--late     { border-left-color: var(--late); }
.stat--leave    { border-left-color: var(--leave); }
.stat--early    { border-left-color: var(--early); }
.stat--neutral  { border-left-color: var(--ink); }

.stats__divider { height: 1px; background: var(--line-soft); width: 100%; margin: 2px 0 14px; }

/* Tile row used on the profile page */
.tiles { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.tile {
  min-width: 104px; flex: none;
  border-radius: var(--r-md); padding: 10px 12px;
  border-left: 3px solid currentColor;
}
.tile b { display: block; font-size: 19px; font-weight: 620; color: var(--ink); }
.tile span { font-size: 11.5px; font-weight: 600; }
.tile small { font-size: 11px; color: var(--muted); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px;
  background: var(--ink); color: #fff;
  border: 1px solid var(--ink); border-radius: var(--r-md);
  font: inherit; font-size: 13.5px; font-weight: 550;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, opacity .12s ease;
}
.btn:hover { background: #000; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--canvas); border-color: #d6d7dc; }
.btn--danger { background: #dc2626; border-color: #dc2626; }
.btn--danger:hover { background: #b91c1c; }
.btn--quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--quiet:hover { background: var(--line-soft); }
.btn--sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn--icon { width: 32px; padding: 0; }
.btn--block { width: 100%; }
.btn--lg { height: 46px; font-size: 15px; padding: 0 22px; }

/* ==========================================================================
   Tabs & filters
   ========================================================================== */
.tabs {
  display: flex; gap: 4px; padding: 10px 12px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line-soft); align-items: center;
}
.tabs a, .tabs button.tab {
  padding: 7px 14px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 550; color: var(--ink-2);
  text-decoration: none; border: none; background: none; cursor: pointer;
}
.tabs a:hover, .tabs button.tab:hover { background: var(--line-soft); }
.tabs a.is-active, .tabs button.tab.is-active {
  background: var(--line-soft); color: var(--ink); font-weight: 620;
}
.tabs .spacer { margin-left: auto; display: flex; gap: 7px; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: #fff; font-size: 13px; color: var(--ink-2); text-decoration: none;
}
.chip svg { width: 15px; height: 15px; opacity: .7; }

/* ==========================================================================
   Forms
   ========================================================================== */
.field { margin-bottom: 16px; }
.field > label,
.label {
  display: block; font-size: 13px; font-weight: 550;
  color: var(--ink-2); margin-bottom: 6px;
}
.label .req { color: #dc2626; margin-left: 2px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

input[type=text], input[type=password], input[type=email], input[type=tel],
input[type=number], input[type=date], input[type=time], input[type=month],
input[type=search], input[type=file], select, textarea {
  width: 100%; min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: #fff; color: var(--ink);
  font: inherit; font-size: 13.5px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
textarea { min-height: 84px; resize: vertical; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  padding-right: 32px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.grid { display: grid; gap: 0 18px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.check {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 2px 0 14px; cursor: pointer;
}
.check input { width: 17px; height: 17px; margin: 1px 0 0; flex: none; accent-color: var(--ink); }
.check b { display: block; font-size: 13.5px; font-weight: 550; }
.check small { color: var(--muted); font-size: 12.5px; }

.radio-row { display: flex; gap: 9px; }
.radio-pill {
  flex: 1; display: flex; align-items: center; gap: 8px; justify-content: center;
  height: 40px; border: 1px solid var(--line); border-radius: var(--r-md);
  cursor: pointer; font-size: 13.5px; background: #fff;
}
.radio-pill input { accent-color: var(--present); }
.radio-pill:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }

.form-split { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 26px; }
.form-split__aside h3 { font-size: 14.5px; }
.form-split__aside p { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

.form-tabs {
  display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.form-tabs button {
  padding: 9px 15px; background: none; border: none; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 550; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.form-tabs button.is-active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 620; }
.form-panel { display: none; }
.form-panel.is-active { display: block; }

.avatar-picker { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.avatar-ring {
  width: 108px; height: 108px; border-radius: 50%;
  background: var(--line-soft); border: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden; flex: none;
}
.avatar-ring img { width: 100%; height: 100%; object-fit: cover; }
.avatar-ring span { font-size: 26px; font-weight: 650; color: var(--faint); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-2);
  padding: 11px 14px; background: #fafafb;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td {
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.data tbody tr:hover { background: #fcfcfd; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tfoot td {
  padding: 11px 14px; font-weight: 650; background: #fafafb;
  border-top: 1px solid var(--line);
}

.person { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.person__avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  object-fit: cover; background: var(--line-soft);
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 650; color: var(--muted);
}
.person__name { font-weight: 600; color: var(--ink); text-decoration: none; }
.person__name:hover { text-decoration: underline; }
.person__meta { font-size: 12px; color: var(--muted); }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty p { margin: 0 0 16px; font-size: 13.5px; }

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 620; white-space: nowrap;
  background: var(--unmarked-bg); color: var(--unmarked);
}
.badge--present, .badge--approved, .badge--active, .badge--published,
.badge--paid { background: var(--present-bg); color: var(--present); }
.badge--absent, .badge--rejected, .badge--archived { background: var(--absent-bg); color: var(--absent); }
.badge--late, .badge--pending, .badge--draft { background: var(--late-bg); color: var(--late); }
.badge--paid-leave, .badge--unpaid-leave { background: var(--leave-bg); color: var(--leave); }
.badge--early { background: var(--early-bg); color: var(--early); }
.badge--half-day { background: var(--half-bg); color: var(--half); }
.badge--holiday { background: var(--holiday-bg); color: var(--holiday); }
.badge--week-off { background: var(--weekoff-bg); color: var(--weekoff); }
.badge--not-marked { background: var(--unmarked-bg); color: var(--unmarked); }
.badge--finalised { background: var(--half-bg); color: var(--half); }

.punch { display: flex; gap: 6px; align-items: center; }
.punch__slot { text-align: center; min-width: 56px; }
.punch__slot b {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .05em;
  padding: 2px 8px; border-radius: var(--r-pill);
}
.punch__slot small { font-size: 11.5px; color: var(--muted); }
.punch__in b  { background: var(--present-bg); color: var(--present); }
.punch__out b { background: var(--late-bg); color: var(--late); }

/* ==========================================================================
   Flash messages
   ========================================================================== */
.flashes { margin-bottom: 16px; display: flex; flex-direction: column; gap: 9px; }
.flash {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--r-md);
  font-size: 13.5px; border: 1px solid;
}
.flash svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.flash--success { background: var(--present-bg); border-color: #bbf7d0; color: #14532d; }
.flash--error   { background: var(--absent-bg);  border-color: #fecaca; color: #7f1d1d; }
.flash--warning { background: var(--late-bg);    border-color: #fde68a; color: #78350f; }
.flash--info    { background: #eff6ff;           border-color: #bfdbfe; color: #1e3a8a; }

/* ==========================================================================
   Calendar
   ========================================================================== */
.cal { width: 100%; border-collapse: separate; border-spacing: 5px; }
.cal th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 600; padding-bottom: 4px;
}
.cal td { width: 14.28%; }
.cal__day {
  border: 1px solid var(--line); border-radius: var(--r-md);
  min-height: 64px; padding: 7px 8px;
  display: flex; flex-direction: column; gap: 3px;
  background: #fff;
}
.cal__day.is-out { opacity: .35; }
.cal__day.is-today { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.cal__num { font-size: 12.5px; font-weight: 620; color: var(--ink-2); }
.cal__dot {
  font-size: 10.5px; font-weight: 650; padding: 1px 6px;
  border-radius: var(--r-pill); align-self: flex-start;
}
.cal__time { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Roster grid */
.roster { border-collapse: collapse; font-size: 12px; }
.roster th, .roster td { border: 1px solid var(--line-soft); padding: 5px 6px; }
.roster th { background: #fafafb; font-weight: 600; }
.roster th.sticky, .roster td.sticky {
  position: sticky; left: 0; background: #fff; z-index: 2; min-width: 180px;
  border-right: 1px solid var(--line);
}
.roster th.sticky { background: #fafafb; z-index: 3; }
.roster .cellmark {
  display: block; width: 22px; height: 22px; line-height: 22px;
  border-radius: 6px; text-align: center; font-size: 10.5px; font-weight: 700;
  margin: 0 auto;
}

/* ==========================================================================
   Kiosk
   ========================================================================== */
.kiosk { max-width: 980px; margin: 0 auto; }
.kiosk__stage {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px;
}
.camera {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: #0c0c0e; aspect-ratio: 4 / 3;
  display: grid; place-items: center;
}
.camera video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera__idle { color: #6b6b74; font-size: 13.5px; text-align: center; padding: 24px; }
.camera__guide {
  position: absolute; inset: 12% 22%;
  border: 2px dashed rgba(255,255,255,.32); border-radius: 50%;
  pointer-events: none;
}
.camera__shot {
  position: absolute; right: 12px; bottom: 12px;
  width: 92px; border-radius: var(--r-sm);
  border: 2px solid rgba(255,255,255,.8); display: none;
}
.kiosk__result {
  padding: 12px 14px; border-radius: var(--r-md);
  font-size: 13.5px; display: none; margin-top: 12px;
}
.kiosk__result.is-ok   { background: var(--present-bg); color: #14532d; display: block; }
.kiosk__result.is-bad  { background: var(--absent-bg);  color: #7f1d1d; display: block; }
.kiosk__result.is-busy { background: #eff6ff; color: #1e3a8a; display: block; }

.kiosk__list { max-height: 340px; overflow-y: auto; border-radius: var(--r-md); }
.kiosk__person {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border: 1px solid transparent; border-radius: var(--r-md);
  background: none; cursor: pointer; text-align: left; font: inherit;
}
.kiosk__person:hover { background: var(--line-soft); }
.kiosk__person.is-selected { border-color: var(--ink); background: var(--line-soft); }
.kiosk__person small { display: block; color: var(--muted); font-size: 11.5px; }

/* ==========================================================================
   Auth
   ========================================================================== */
.auth {
  min-height: 100vh; display: grid; place-items: center;
  background: var(--canvas); padding: 32px 20px;
}
.auth__box { width: 100%; max-width: 400px; }
.auth__card { padding: 0; }
.auth__card .card__body { padding: 36px 32px 30px; }
.auth__brand { display: flex; justify-content: center; margin-bottom: 6px; }
.auth__brand img { height: 84px; width: auto; }
.auth__title {
  font-size: 22px; font-weight: 700; text-align: center; color: var(--ink);
  margin: 4px 0 4px;
}
.auth__subtitle {
  text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 22px;
}
.auth__input {
  display: flex; align-items: center; gap: 10px;
  background: var(--line-soft); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 0 13px; height: 42px;
  transition: border-color .12s ease, background .12s ease;
}
.auth__input:focus-within { border-color: var(--accent); background: var(--surface); }
.auth__input svg { width: 17px; height: 17px; color: var(--faint); flex: none; }
.auth__input input {
  border: none; background: none; padding: 0; height: auto; flex: 1;
  font: inherit; font-size: 14px; color: var(--ink);
}
.auth__input input:focus { outline: none; box-shadow: none; }
.auth__footer { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 18px; }

/* ==========================================================================
   Misc
   ========================================================================== */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; text-align: right; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono  { font-family: var(--mono); font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.hr { height: 1px; background: var(--line-soft); margin: 18px 0; border: 0; }

.errors { padding: 60px 20px; text-align: center; max-width: 460px; margin: 0 auto; }
.errors b { font-size: 58px; display: block; color: var(--faint); letter-spacing: -.03em; }

@media (max-width: 1100px) {
  .kiosk__stage { grid-template-columns: 1fr; }
  .form-split { grid-template-columns: 1fr; gap: 14px; }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .rail {
    width: 100%; flex: none; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 6px;
    overflow-x: auto; padding: 10px 12px;
  }
  .rail__brand { margin-bottom: 0; }
  .rail__label, .rail__foot, .rail__sub::before { display: none; }
  .rail__group { display: flex; gap: 4px; }
  .rail__sub { padding-left: 0; display: flex; gap: 4px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .page { padding: 16px 14px 44px; }
  .stats__title { min-width: 100%; padding: 0 0 12px; }
}

@media print {
  .rail, .topbar, .page__actions, .btn, .tabs { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   Theme picker
   ========================================================================== */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.theme-card {
  display: block;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.theme-card:hover { border-color: var(--faint); }
.theme-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.theme-card__swatches { display: flex; gap: 6px; margin-bottom: 10px; }
.theme-card__swatches span { flex: 1; height: 30px; border-radius: 6px; }
.theme-card__label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
