/* Wadi Drive Car Rental — demo of FutureLine's car rental management system.
   Design system mirrors the real product: warm sand paper ramp, near-black ink rail, brand gold accent,
   orange only for money owed, red for overdue, emerald for settled. Static build: system fonts only. */
:root {
  --z50: oklch(97.2% 0.007 85);
  --z100: oklch(94.5% 0.009 85);
  --z200: oklch(90% 0.011 85);
  --z300: oklch(84% 0.012 85);
  --z400: oklch(64% 0.014 90);
  --z500: oklch(52% 0.016 220);
  --z600: oklch(43% 0.02 225);
  --z700: oklch(35% 0.024 228);
  --z800: oklch(28% 0.026 230);
  --z900: oklch(22% 0.028 232);
  --accent: oklch(72% 0.13 88);
  --accent-strong: oklch(63% 0.125 85);
  --accent-soft: oklch(94% 0.045 95);
  --accent-ink: oklch(18% 0.015 260);
  --ink: oklch(17% 0.012 250);
  --ink-2: oklch(23% 0.014 250);
  --focus: oklch(66% 0.12 88);
  --plate-band: oklch(42% 0.15 262);
  --red-50: #fef2f2; --red-200: #fecaca; --red-500: #ef4444; --red-600: #dc2626; --red-700: #b91c1c;
  --em-50: #ecfdf5; --em-200: #a7f3d0; --em-500: #10b981; --em-600: #059669; --em-700: #047857;
  --or-50: #fff7ed; --or-200: #fed7aa; --or-400: #fb923c; --or-700: #c2410c; --or-800: #9a3412;
  --radius-card: 1rem;
  --radius-field: 0.75rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 1px 2px oklch(22% 0.028 232 / 0.05), 0 4px 16px oklch(22% 0.028 232 / 0.04);
  --display: 'Alexandria', ui-sans-serif, 'Segoe UI', system-ui, -apple-system, sans-serif;
  --body: 'IBM Plex Sans', ui-sans-serif, 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --bar-h: 34px;
}
* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  margin: 0; min-height: 100vh; background: var(--z50); color: var(--z900);
  font: 400 14px/1.5 var(--body); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum";
  padding-top: var(--bar-h); overflow-x: clip;
}
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: oklch(90% 0.07 95); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.ico { flex: none; }
.muted { color: var(--z500); }
.small { font-size: 12px; }
.strong { font-weight: 700; }
.t-or { color: var(--or-700); } .t-em { color: var(--em-700); } .t-red { color: var(--red-700); } .t-em6 { color: var(--em-600); } .t-red6 { color: var(--red-600); }
.nowrap { white-space: nowrap; }

/* ---------- shell: fixed dark rail (desktop) / top bar + bottom tabs (mobile) ---------- */
.side {
  position: fixed; top: var(--bar-h); bottom: 0; left: 0; width: 240px; z-index: 10; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--ink-2), var(--ink) 55%); border-right: 1px solid rgb(255 255 255 / .05);
}
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 22px 18px 18px 20px; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.emblem {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--ink);
  box-shadow: 0 0 0 1px oklch(72% 0.13 88 / .5), 0 2px 8px oklch(72% 0.13 88 / .35); color: var(--accent);
}
.wm-name { display: block; font: 700 16px/1.15 var(--display); color: #fff; }
.wm-tag { display: block; font-size: 10px; font-weight: 600; letter-spacing: .28em; color: var(--accent); }
.bell {
  position: relative; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--z300); text-decoration: none;
  transition: background-color .15s, color .15s;
}
.bell:hover { background: rgb(255 255 255 / .1); color: #fff; }
.bell.active { background: var(--accent); color: var(--accent-ink); }
.bell-count { position: absolute; top: -2px; right: -2px; min-width: 16px; border-radius: 99px; background: var(--red-500); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; padding: 0 4px; }
.nav { display: flex; flex-direction: column; gap: 4px; padding: 12px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; color: var(--z300); text-decoration: none;
  font-size: 14px; font-weight: 500; transition: background-color .15s var(--ease), color .15s var(--ease);
}
.nav-item:hover { background: rgb(255 255 255 / .05); color: #fff; }
.nav-item.active { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 10px oklch(72% 0.13 88 / .35); }
.nav-item span { flex: 1; }
.nav-badge { flex: none !important; border-radius: 99px; background: rgb(239 68 68 / .9); color: #fff; font-size: 10px; font-weight: 700; line-height: 1; padding: 3px 6px; }
.side-foot { margin-top: auto; border-top: 1px solid rgb(255 255 255 / .1); padding: 12px; }
.side-user { padding: 0 12px 8px; }
.side-user b { display: block; color: #fff; font-size: 14px; font-weight: 600; }
.side-user span { color: var(--z400); font-size: 12px; }
.side-actions { display: flex; gap: 8px; padding: 0 12px 4px; }
.side-btn { border: 1px solid rgb(255 255 255 / .15); background: none; border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 500; color: var(--z300); }
.side-btn:hover { border-color: rgb(255 255 255 / .3); color: #fff; }
.side-btn.out { border-color: transparent; color: #fca5a5; }
.side-btn.out:hover { background: rgb(239 68 68 / .15); color: #fecaca; }
.topbar { display: none; }
.tabs { display: none; }
main#view { margin-left: 240px; padding: 32px; }
.wrap { max-width: 72rem; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.wrap.narrow { max-width: 42rem; }

/* ---------- page head ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head h1 { font-size: 24px; font-weight: 700; color: var(--z900); letter-spacing: -0.02em; }
.page-head h1.big { font-size: 30px; }
.page-sub { margin-top: 4px; font-size: 14px; color: var(--z500); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-sub a { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.page-sub a:hover { text-decoration: underline; }
.back { font-size: 14px; color: var(--z500); text-decoration: none; }
.back:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- card ---------- */
.card { background: #fff; border: 1px solid oklch(90% 0.011 85 / .8); border-radius: var(--radius-card); box-shadow: var(--shadow-card); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--z100); }
.card-head h2 { font-size: 14px; font-weight: 600; color: var(--z800); }
.card-head a { font-size: 12px; font-weight: 500; color: var(--accent-strong); text-decoration: none; }
.card-head a:hover { text-decoration: underline; }
.pad { padding: 16px; }
.pad-5 { padding: 20px; }
.stat { position: relative; overflow: hidden; padding: 16px 20px; }
.stat-bar { position: absolute; top: 12px; bottom: 12px; left: 0; width: 4px; border-radius: 0 99px 99px 0; background: var(--z200); }
.stat-label { font-size: 12px; font-weight: 500; color: var(--z500); }
.stat-value { margin-top: 6px; font: 700 24px/1.2 var(--display); letter-spacing: -0.02em; color: var(--z900); }
.tone-danger .stat-bar { background: var(--red-500); } .tone-danger .stat-value { color: var(--red-700); }
.tone-success .stat-bar { background: var(--em-500); } .tone-success .stat-value { color: var(--em-700); }
.tone-warning .stat-bar { background: var(--or-400); } .tone-warning .stat-value { color: var(--or-700); }

/* grids */
.g2 { display: grid; gap: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bento { display: grid; gap: 16px; grid-template-columns: 2fr 1fr 1fr; }
.col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* ---------- badge ---------- */
.badge { display: inline-block; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 600; line-height: 1.5; box-shadow: inset 0 0 0 1px var(--z200); background: var(--z100); color: var(--z600); white-space: nowrap; }
.badge-danger { background: var(--red-50); color: var(--red-700); box-shadow: inset 0 0 0 1px var(--red-200); }
.badge-success { background: var(--em-50); color: var(--em-700); box-shadow: inset 0 0 0 1px var(--em-200); }
.badge-warning { background: var(--or-50); color: var(--or-800); box-shadow: inset 0 0 0 1px var(--or-200); }
.badge-info { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px oklch(72% 0.13 88 / .2); }

/* ---------- plate chip ---------- */
.plate {
  display: inline-flex; align-items: stretch; overflow: hidden; vertical-align: middle; border: 1px solid var(--z300); border-radius: 6px; background: #fff;
  font-family: var(--mono); font-weight: 700; color: var(--z800); box-shadow: inset 0 -1px 2px oklch(22% 0.028 232 / .08); flex: none;
}
.plate-band { display: flex; align-items: center; background: var(--plate-band); color: #fff; font: 700 8px/1 var(--body); letter-spacing: .04em; padding: 0 4px; }
.plate-num { letter-spacing: .08em; font-size: 12px; padding: 1px 8px; white-space: nowrap; }
.plate-lg .plate-band { font-size: 10px; padding: 0 6px; }
.plate-lg .plate-num { font-size: 14px; padding: 3px 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-radius: var(--radius-field); padding: 8px 16px;
  font-size: 14px; font-weight: 600; text-decoration: none; border: 0; white-space: nowrap;
  transition: background-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease), filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: var(--accent-ink);
  box-shadow: 0 1px 2px oklch(22% 0.028 232 / .2), inset 0 1px 0 rgb(255 255 255 / .25);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); box-shadow: 0 2px 8px oklch(72% 0.13 88 / .4); }
.btn-secondary { background: #fff; color: var(--z800); box-shadow: inset 0 0 0 1px var(--z300); }
.btn-secondary:hover { background: var(--z50); box-shadow: inset 0 0 0 1px var(--z400); }
.btn-danger { background: var(--red-700); color: #fff; }
.btn-danger:hover { background: #991b1b; }
.btn-ghost { background: none; color: var(--z600); }
.btn-ghost:hover { background: var(--z100); }
.link-danger { background: none; border: 0; border-radius: 6px; padding: 4px 8px; font-size: 12px; font-weight: 500; color: var(--red-600); }
.link-danger:hover { background: var(--red-50); }
.btn-text-danger { background: none; border: 0; min-height: 44px; padding: 8px 12px; font-size: 14px; font-weight: 600; color: var(--red-600); border-radius: var(--radius-field); }
.btn-text-danger:hover { background: var(--red-50); }
.link-gold { border-radius: 6px; padding: 4px 8px; font-size: 12px; font-weight: 500; color: var(--accent-strong); text-decoration: none; }
.link-gold:hover { background: var(--accent-soft); }
.link-quiet { font-size: 14px; color: var(--z500); text-decoration: none; background: none; border: 0; }
.link-quiet:hover { text-decoration: underline; }

/* ---------- forms ---------- */
.field { display: block; min-width: 0; }
.field-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--z600); }
.req { color: var(--red-600); }
.input {
  width: 100%; min-height: 44px; border-radius: var(--radius-field); border: 1px solid var(--z300); background: #fff; padding: 10px 14px;
  font-size: 14px; color: var(--z900); box-shadow: inset 0 1px 2px oklch(22% 0.028 232 / .04); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--z400); }
.input:hover { border-color: var(--z400); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px oklch(72% 0.13 88 / .22); }
textarea.input { resize: vertical; min-height: 80px; }
.dt-row { display: grid; grid-template-columns: minmax(0, 1fr) 8.75rem; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-row { display: grid; gap: 12px; align-items: end; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.form-row .span-2 { grid-column: span 2; }
.form-col { display: flex; flex-direction: column; gap: 16px; max-width: 42rem; }
.hint { margin-top: 4px; display: block; font-size: 12px; color: var(--z500); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--z700); }
.check input, .radio input { accent-color: var(--accent-strong); width: 16px; height: 16px; }
.radio {
  display: flex; align-items: center; gap: 12px; border-radius: var(--radius-field); border: 1px solid var(--z300); padding: 10px 12px; font-size: 14px;
  color: var(--z700); cursor: pointer; transition: background-color .15s;
}
.radio:hover { background: var(--z50); }
.radio.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; color: var(--accent-strong); }
.radio span { flex: 1; }
.radio .mono { font-family: var(--mono); }
.radios { display: flex; flex-direction: column; gap: 8px; }
.alert-box { border-radius: 8px; background: var(--red-50); color: var(--red-700); padding: 8px 14px; font-size: 14px; font-weight: 500; }
.note-box { border-radius: 8px; background: var(--accent-soft); color: oklch(40% 0.08 85); padding: 10px 14px; font-size: 13px; }
.sum { margin-top: 16px; border-top: 1px solid var(--z200); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.sum div { display: flex; justify-content: space-between; gap: 12px; }
.sum dt { color: var(--z500); }
.sum dd { margin: 0; font-weight: 500; color: var(--z800); }
.sum .b { font-weight: 700; }
.sum.flat { margin-top: 0; border-top: 0; padding-top: 0; }
.disclosure { padding: 16px; }
.disclosure.open { border-bottom: 1px solid var(--z100); }
.sec-title { font-size: 14px; font-weight: 600; color: var(--z800); margin-bottom: 12px; }

/* ---------- table ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl thead tr { border-bottom: 1px solid var(--z200); background: oklch(97.2% 0.007 85 / .6); }
.tbl th { padding: 10px 16px; text-align: left; font-size: 12px; font-weight: 600; color: var(--z500); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-top: 1px solid var(--z100); color: var(--z600); vertical-align: middle; }
.tbl tbody tr:first-child td { border-top: 0; }
.tbl tr[data-href] { cursor: pointer; transition: background-color .15s; }
.tbl tr[data-href]:hover { background: var(--z50); }
.tbl td.lead a { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--z900); text-decoration: none; white-space: nowrap; }
.tbl td.lead a:hover { text-decoration: underline; }
.tbl td.dark { color: var(--z800); }
.tbl td.end { text-align: right; white-space: nowrap; }
.sub { display: block; font-size: 12px; color: var(--z500); }
.empty { padding: 48px 20px; text-align: center; font-size: 14px; color: var(--z400); }
.empty .ico { display: block; margin: 0 auto 8px; color: var(--z300); width: 32px; height: 32px; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--z100); }
.list a, .list .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; text-decoration: none; transition: background-color .15s; }
.list a:hover { background: var(--z50); }
.list .name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; font-weight: 500; color: var(--z800); flex-wrap: wrap; }
.list .who { font-size: 12px; color: var(--z500); margin-top: 2px; }
.list .right { text-align: right; flex: none; font-size: 12px; color: var(--z500); }
.list .trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-row .name { flex-wrap: nowrap; font-weight: 400; color: var(--z700); }

/* details */
.dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 32px; margin: 0; font-size: 14px; }
.dl.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dl dt { font-size: 12px; color: var(--z500); }
.dl dd { margin: 2px 0 0; font-weight: 500; color: var(--z800); overflow-wrap: anywhere; }
.notes { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--z100); display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 14px; }

/* dashboard */
.big-num { margin-top: 4px; font: 700 36px/1.1 var(--display); letter-spacing: -0.02em; color: var(--z900); }
.mid-num { margin-top: 6px; font: 700 24px/1.2 var(--display); letter-spacing: -0.02em; }
.spark { display: block; width: 100%; height: 44px; margin-top: 16px; }
.spark-area { fill: oklch(72% 0.13 88 / .1); }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark-dot { fill: var(--accent); }
.kpi-side { position: relative; overflow: hidden; padding: 20px; }
.kpi-side .stat-bar { top: 16px; bottom: 16px; }
.kpi-foot { margin-top: 12px; font-size: 12px; color: var(--z400); }
.kpi-foot b { color: var(--z600); font-weight: 600; }
.fleet-bar { display: flex; gap: 4px; height: 12px; width: 100%; overflow: hidden; border-radius: 99px; }
.fleet-bar span { border-radius: 99px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--z600); }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.bg-accent { background: var(--accent); } .bg-band { background: var(--plate-band); } .bg-em { background: var(--em-500); } .bg-or { background: var(--or-400); }

/* calendar */
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--z100); }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-nav a { border-radius: 6px; padding: 4px 10px; font-size: 14px; font-weight: 600; color: var(--z600); text-decoration: none; }
.cal-nav a:hover { background: var(--z100); }
.cal-nav .month { min-width: 8rem; text-align: center; font: 700 14px var(--display); color: var(--z900); }
.cal-nav a.today { margin-left: 8px; border: 1px solid var(--z300); font-size: 12px; font-weight: 500; }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cal-legend span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--z500); }
.cal-legend i { display: inline-block; width: 16px; height: 10px; border-radius: 2px; }
.cal-scroll { overflow-x: auto; }
.cal-grid { display: grid; }
.cal-head { border-bottom: 1px solid var(--z200); background: oklch(97.2% 0.007 85 / .6); }
.cal-corner { position: sticky; left: 0; z-index: 3; background: var(--z50); }
.cal-day { border-right: 1px solid var(--z100); padding: 6px 0; text-align: center; }
.cal-day.we { background: oklch(94.5% 0.009 85 / .7); }
.cal-day b { display: block; font-size: 12px; font-weight: 600; color: var(--z600); }
.cal-day.now b { color: var(--accent-strong); }
.cal-day small { display: block; font-size: 10px; color: var(--z400); }
.cal-row { border-bottom: 1px solid var(--z100); }
.cal-label { position: sticky; left: 0; z-index: 3; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; padding: 8px 16px; background: #fff; border-right: 1px solid var(--z200); min-width: 0; }
.cal-label a { font-size: 14px; font-weight: 600; color: var(--z800); text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-label a:hover { text-decoration: underline; }
.cal-track { position: relative; }
.cal-stripes { position: absolute; inset: 0; display: flex; }
.cal-stripes span { flex: 1; height: 100%; border-right: 1px solid var(--z100); }
.cal-stripes span.we { background: var(--z50); }
.cal-stripes span.now { background: oklch(94% 0.045 95 / .6); }
.cal-today { position: absolute; top: 0; bottom: 0; width: 2px; z-index: 2; background: oklch(63% 0.125 85 / .7); }
.cal-bar-item {
  position: absolute; z-index: 1; display: flex; align-items: center; overflow: hidden; padding: 0 8px; font-size: 12px; font-weight: 600;
  text-decoration: none; border-radius: 6px; box-shadow: 0 1px 2px rgb(0 0 0 / .08); transition: transform .15s var(--ease);
}
.cal-bar-item:hover { transform: scale(1.02); z-index: 2; }
.cal-bar-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-bar-item.cs { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bar-item.ce { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tone-booked { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px oklch(72% 0.13 88 / .6); }
.tone-active { background: var(--ink); color: #fff; }
.tone-overdue { background: var(--red-600); color: #fff; }
.tone-returned { background: var(--z200); color: var(--z500); }
.tone-tour { background: var(--plate-band); color: #fff; }
.tone-tourDone { background: oklch(42% 0.15 262 / .25); color: var(--plate-band); box-shadow: inset 0 0 0 1px oklch(42% 0.15 262 / .4); }

/* settings toggles */
.team li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.team-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-name b { font-weight: 500; color: var(--z800); }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.toggle { border: 0; border-radius: 99px; padding: 4px 12px; font-size: 12px; font-weight: 600; background: var(--z100); color: var(--z400); box-shadow: inset 0 0 0 1px var(--z200); transition: color .15s, background-color .15s; }
.toggle:hover { color: var(--z600); }
.toggle.on { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px oklch(72% 0.13 88 / .3); }

/* ---------- printable documents (contract, receipt, voucher) ---------- */
.doc { max-width: 48rem; margin: 0 auto; background: #fff; padding: 32px; color: var(--z900); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.doc.narrow { max-width: 42rem; }
.doc-tools { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.doc-head { text-align: center; border-bottom: 2px solid var(--z900); padding-bottom: 16px; margin-bottom: 24px; }
.doc-head h1 { font-size: 24px; }
.doc-head h2 { font-size: 20px; margin-top: 16px; }
.doc-head .meta { margin-top: 4px; display: flex; justify-content: center; gap: 32px; font-size: 14px; color: var(--z600); }
.doc h3 { font-size: 14px; font-weight: 700; border-bottom: 1px solid var(--z900); padding-bottom: 4px; margin-bottom: 8px; }
.doc-row { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--z200); padding: 6px 0; font-size: 14px; }
.doc-row span:first-child { color: var(--z500); }
.doc-row span:last-child { font-weight: 500; text-align: right; }
.doc-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.doc-2.tight { gap: 0 32px; }
.doc-sec { margin-top: 24px; }
.doc-terms { white-space: pre-wrap; font-size: 12px; line-height: 1.6; color: var(--z700); }
.doc-sign { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 64px; text-align: center; font-size: 14px; }
.doc-sign div { border-top: 1px solid var(--z900); padding-top: 8px; }
.stamp { display: inline-block; margin-top: 12px; border: 2px solid var(--em-700); color: var(--em-700); border-radius: 8px; padding: 6px 16px; font-size: 14px; font-weight: 700; }
.amount-box { margin-bottom: 24px; border: 2px solid var(--z900); border-radius: 12px; padding: 16px 24px; text-align: center; }
.amount-box small { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--z500); }
.amount-box div { margin-top: 4px; font-size: 30px; font-weight: 700; }

/* ---------- login ---------- */
.login { display: grid; grid-template-columns: 5fr 4fr; min-height: calc(100vh - var(--bar-h)); }
.login-art { position: relative; overflow: hidden; background: var(--ink); padding: 40px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art::before {
  content: ''; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: radial-gradient(oklch(72% 0.13 88 / .16) 1px, transparent 1px); background-size: 26px 26px; animation: drift 24s linear infinite;
}
@keyframes drift { to { background-position: 26px 26px; } }
.login-art > * { position: relative; }
.login-art .emblem { width: 56px; height: 56px; }
.login-art .wm-name { font-size: 20px; }
.login-art h1 { color: #fff; font-size: 38px; font-weight: 700; line-height: 1.15; max-width: 28rem; }
.login-art .rule { display: block; margin-top: 24px; height: 6px; width: 96px; border-radius: 99px; background: var(--accent); }
.login-art p { color: var(--z400); font-size: 14px; }
.login-big-emblem { width: 160px; height: 160px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 32px; background: var(--ink-2); color: var(--accent); box-shadow: 0 0 0 2px oklch(72% 0.13 88 / .4), 0 8px 40px oklch(72% 0.13 88 / .3); }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 26rem; }
.login-box h2 { font-size: 24px; font-weight: 700; color: var(--z900); margin-bottom: 4px; }
.login-box > p { font-size: 14px; color: var(--z500); margin-bottom: 20px; }
.login-mobile-brand { display: none; justify-content: center; margin-bottom: 28px; }
.login-mobile-brand .wm-name { color: var(--z900); }
.login-mobile-brand .wm-tag { color: var(--accent-strong); }
.acct {
  width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; text-align: left; padding: 12px 14px; margin-bottom: 8px;
  border-radius: var(--radius-field); border: 1px solid var(--z300); background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease);
}
.acct:hover { border-color: var(--accent); box-shadow: 0 0 0 3px oklch(72% 0.13 88 / .18); }
.acct:active { transform: translateY(1px); }
.acct b { font-size: 14px; font-weight: 600; color: var(--z900); }
.acct small { grid-column: 1; font-size: 12px; color: var(--z500); }
.acct .badge { grid-row: 1 / span 2; grid-column: 2; }
.login-note { margin-top: 16px; font-size: 12px; color: var(--z500); line-height: 1.5; }

/* ---------- modal & toast ---------- */
.backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: oklch(17% 0.012 250 / .45); animation: fade .14s ease; }
.backdrop.out { opacity: 0; transition: opacity .14s; }
.modal { width: 100%; max-width: 26rem; background: #fff; border-radius: var(--radius-card); padding: 20px; box-shadow: 0 20px 60px rgb(0 0 0 / .25); animation: pop .16s var(--ease); }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-text { margin-top: 8px; font-size: 14px; color: var(--z600); }
.modal-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
#toasts { position: fixed; z-index: 70; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; max-width: 22rem; border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 500; background: var(--ink); color: #fff; box-shadow: 0 8px 24px rgb(0 0 0 / .2); animation: pop .16s var(--ease); }
.toast-error { background: var(--red-700); }
.toast-ok { background: var(--em-700); }
.toast.out { opacity: 0; transform: translateY(4px); transition: all .2s; }
.loading { padding: 48px; text-align: center; color: var(--z400); }

/* ---------- demo banner ---------- */
.demo-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--bar-h); display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 14px; background: #0d0f12; color: var(--z400); border-bottom: 1px solid #23262c; font-size: .8rem; line-height: 1;
}
.demo-bar-msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.demo-bar-msg b { color: var(--accent); font-weight: 700; letter-spacing: .02em; }
.demo-bar-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.demo-bar-btn { background: none; border: 1px solid #3a3e46; color: #e6e1d6; border-radius: 8px; padding: 4px 10px; font-size: .76rem; font-weight: 700; transition: border-color .15s, color .15s; }
.demo-bar-btn:hover { border-color: var(--accent); color: #fff; }
.demo-bar-link { color: #e6e1d6; text-decoration: none; font-weight: 600; white-space: nowrap; }
.demo-bar-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .bento > :first-child { grid-column: span 2; }
  .g2 { grid-template-columns: 1fr; }
  .g4, .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  input, select, textarea { font-size: 16px !important; }
  .side { display: none; }
  .side.open { display: flex; position: fixed; top: calc(var(--bar-h) + 60px); bottom: 0; left: 0; right: 0; width: auto; z-index: 30; overflow-y: auto; }
  .side.open .side-top { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; position: sticky; top: var(--bar-h); z-index: 20; height: 60px;
    background: linear-gradient(180deg, var(--ink-2), var(--ink));
  }
  .topbar-actions { display: flex; align-items: center; gap: 8px; }
  .menu-btn { border: 1px solid rgb(255 255 255 / .15); background: none; color: var(--z200); border-radius: 6px; padding: 5px 9px; display: grid; place-items: center; }
  .tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; overflow-x: auto; scrollbar-width: none;
    background: linear-gradient(180deg, var(--ink-2), var(--ink)); border-top: 1px solid rgb(255 255 255 / .1); padding-bottom: env(safe-area-inset-bottom);
  }
  .tab { position: relative; flex: 1; min-width: 4.2rem; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px; font-size: 10px; font-weight: 500; color: var(--z400); text-decoration: none; }
  .tab span { width: 100%; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab.active { color: var(--accent); }
  .tab.active::before { content: ''; position: absolute; top: 0; width: 32px; height: 2px; border-radius: 99px; background: var(--accent); }
  .tab .nav-badge { position: absolute; top: 4px; left: 50%; margin-left: 6px; width: auto; font-size: 9px; padding: 2px 5px; }
  main#view { margin-left: 0; padding: 16px 16px 96px; }
  .page-head h1.big { font-size: 26px; }
  .bento { grid-template-columns: 1fr 1fr; gap: 12px; }
  .g3 { grid-template-columns: 1fr; }
  .g3.keep { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .g3.keep .stat { padding: 12px; }
  .g3.keep .stat-value { font-size: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .notes { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-mobile-brand { display: flex; }
  .doc { padding: 20px; }
  .doc-2, .doc-sign { grid-template-columns: 1fr; gap: 16px; }
  .doc-sign { gap: 40px; }
  .stat-value { font-size: 20px; }
  .big-num { font-size: 30px; }
  .tbl th, .tbl td { padding-left: 12px; padding-right: 12px; }
  .list a, .list .row { padding: 10px 16px; }
}
@media (max-width: 560px) {
  .demo-bar { padding: 0 10px; gap: 8px; font-size: .74rem; }
  .demo-bar-sep { display: none; }
  .demo-bar-actions { gap: 10px; }
  .form-row { grid-template-columns: 1fr; }
  .form-row .span-2 { grid-column: auto; }
  .dt-row { grid-template-columns: minmax(0, 1fr) 9.5rem; }
  .dt-row .input { padding-left: 10px; padding-right: 8px; }
}
@media (max-width: 420px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .g4 .stat { padding: 12px 14px; }
  .g4 .stat-value { font-size: 17px; }
  .dl { grid-template-columns: 1fr 1fr; gap: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@media print {
  body { background: #fff; padding-top: 0; }
  .demo-bar, .side, .topbar, .tabs, #toasts, .no-print { display: none !important; }
  main#view { margin: 0; padding: 0; }
  .doc { box-shadow: none; padding: 0; max-width: none; }
}
