:root {
  --navy: #0F2739;
  --navy-2: #163349;
  --paper: #FAF7F2;
  --ink: #0F2739;
  --muted: #4A5D72;
  --faint: #8494A5;
  --accent: #E5A00D;
  --accent-hover: #F0AE1F;
  --accent-ink: #0F2739;
  --accent-text: #9A6600;
  --accent-soft: rgba(229, 160, 13, .14);
  --line: rgba(15, 39, 57, .08);
  --line-2: rgba(15, 39, 57, .14);
  --card: #FFFFFF;
  --shadow: 0 1px 2px rgba(15, 39, 57, .05);
  --shadow-lg: 0 24px 48px rgba(15, 39, 57, .18), 0 2px 6px rgba(15, 39, 57, .08);
  --radius: 16px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --green: #1F8A5B; --green-soft: rgba(31, 138, 91, .12);
  --blue: #2C6CB0; --blue-soft: rgba(44, 108, 176, .12);
  --red: #C2412D; --red-soft: rgba(194, 65, 45, .12);
  --slate: #4A5D72; --slate-soft: rgba(74, 93, 114, .12);
  --amber-soft: rgba(229, 160, 13, .16);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 24px; color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
.ic { flex: none; display: block; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border-radius: 12px; border: 1px solid var(--line-2);
  background: #fff; color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: transform .18s var(--ease), background-color .18s, border-color .18s, box-shadow .18s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: rgba(15, 39, 57, .28); }
.btn:active { transform: scale(.98); }
.btn:focus-visible, .nav a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .chip:focus-visible, .role-card:focus-visible {
  outline: 3px solid rgba(229, 160, 13, .5); outline-offset: 2px;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); background: var(--red-soft); }
.btn-danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(15, 39, 57, .05); border-color: transparent; }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 12px 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; padding: 0; }
.link { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px;
  background: #fff; transition: border-color .18s, box-shadow .18s;
}
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(229, 160, 13, .2); }
.input.invalid { border-color: var(--red); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.span-2 { grid-column: span 2; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 10px; }
.pw-eye:hover { background: rgba(15, 39, 57, .05); color: var(--ink); }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; min-height: 44px; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 44px; height: 26px; border-radius: 999px; background: rgba(15, 39, 57, .18); position: relative; transition: background-color .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s var(--ease); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid rgba(229, 160, 13, .5); outline-offset: 2px; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art .brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; }
.login-art h1 { font-size: 40px; line-height: 48px; max-width: 480px; margin-bottom: 16px; }
.login-art p { color: rgba(255,255,255,.72); max-width: 440px; margin: 0; font-size: 16px; line-height: 26px; }
.login-art .art { width: 100%; max-width: 520px; margin: 32px 0; }
.login-art .foot { color: rgba(255,255,255,.5); font-size: 13px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.login-card { width: 100%; max-width: 420px; }
.login-card h2 { font-size: 24px; line-height: 32px; margin-bottom: 4px; }
.role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.role-card { border: 1px solid var(--line-2); background: #fff; border-radius: 14px; padding: 12px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 88px; transition: transform .18s var(--ease), border-color .18s, box-shadow .18s; }
.role-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(15,39,57,.08); transform: translateY(-1px); }
.role-card .rc-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
.role-card b { font-size: 13px; line-height: 18px; }
.role-card span { font-size: 12px; line-height: 16px; color: var(--muted); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 24px 0 16px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.acct-toggle { width: 100%; justify-content: space-between; }
.acct-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.hint-box { background: var(--accent-soft); border-radius: 12px; padding: 12px; font-size: 13px; line-height: 20px; color: var(--ink); }

/* Shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #fff; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px; z-index: 40; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.logo-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--navy); display: grid; place-items: center; flex: none; }
.side-brand b { display: block; font-size: 15px; line-height: 20px; }
.side-brand span { display: block; font-size: 12px; line-height: 16px; color: rgba(255,255,255,.6); }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 44px; border-radius: 12px; color: rgba(255,255,255,.78); text-decoration: none; font-weight: 500; transition: background-color .18s, color .18s; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: var(--accent); color: var(--navy); font-weight: 700; }
.nav .nav-count { margin-left: auto; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.14); border-radius: 999px; padding: 0 8px; line-height: 20px; }
.nav a.active .nav-count { background: rgba(15,39,57,.16); }
.side-foot { border-top: 1px solid rgba(255,255,255,.1); padding-top: 16px; font-size: 12px; color: rgba(255,255,255,.5); padding-left: 8px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.demo-strip { background: var(--navy); color: rgba(255,255,255,.86); font-size: 13px; line-height: 20px; padding: 8px 24px; display: flex; align-items: center; gap: 12px; }
.demo-strip .ds-text { flex: 1; }
.demo-strip button { background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; padding: 4px; text-decoration: underline; text-underline-offset: 3px; }
.demo-strip .ds-x { color: rgba(255,255,255,.6); text-decoration: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; }
.demo-strip .ds-x:hover { background: rgba(255,255,255,.1); }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 16px 32px; background: rgba(250, 247, 242, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 24px; line-height: 32px; flex: none; }
.hamburger { display: none; }
.top-search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.top-search .input { padding-left: 40px; background: #fff; }
.top-search .ic { position: absolute; left: 12px; top: 12px; color: var(--muted); pointer-events: none; }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 8px; max-height: 360px; overflow-y: auto; z-index: 50; }
.search-results button { display: flex; width: 100%; gap: 12px; align-items: center; text-align: left; border: 0; background: none; padding: 8px; border-radius: 10px; cursor: pointer; min-height: 44px; }
.search-results button:hover, .search-results button.on { background: var(--accent-soft); }
.search-results .sr-k { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: #fff; border: 1px solid var(--line); flex: none; }
.top-search + .user-chip { margin-left: 0; }
.topbar .user-chip:first-of-type { margin-left: auto; }
.top-search ~ .user-chip { margin-left: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.user-chip b { display: block; font-size: 13px; line-height: 16px; }
.user-chip span { display: block; font-size: 12px; line-height: 16px; color: var(--muted); }
.content { padding: 24px 32px 64px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .sub { color: var(--muted); flex: 1; min-width: 200px; }
.scrim { display: none; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 16px; line-height: 24px; flex: 1; }
.card-body { padding: 16px 24px 24px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi { padding: 20px 24px; display: flex; flex-direction: column; gap: 4px; }
.kpi .k-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi .k-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
.kpi .k-val { font-size: 28px; line-height: 36px; font-weight: 700; color: var(--ink); margin-top: 8px; }
.kpi .k-val.accent { color: var(--accent-text); }
.kpi .k-sub { font-size: 13px; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 24px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px; padding: 2px 10px; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-waiting { background: var(--slate-soft); color: var(--slate); }
.p-progress { background: var(--amber-soft); color: #8A5A00; }
.p-ready { background: var(--green-soft); color: var(--green); }
.p-released { background: rgba(15,39,57,.07); color: var(--ink); }
.p-cancelled { background: var(--red-soft); color: var(--red); }
.p-reserved { background: var(--blue-soft); color: var(--blue); }
.p-out { background: var(--amber-soft); color: #8A5A00; }
.p-returned { background: var(--green-soft); color: var(--green); }
.p-overdue { background: var(--red-soft); color: var(--red); }
.p-low { background: var(--red-soft); color: var(--red); }
.p-ok { background: var(--green-soft); color: var(--green); }
.p-available { background: var(--green-soft); color: var(--green); }
.p-maintenance { background: var(--slate-soft); color: var(--slate); }
.p-approved { background: var(--green-soft); color: var(--green); }
.p-pending { background: var(--red-soft); color: var(--red); }
.tag { display: inline-block; font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 8px; background: rgba(15,39,57,.06); color: var(--muted); font-weight: 600; }
.tag.wash { background: var(--blue-soft); color: var(--blue); }
.tag.repair { background: var(--amber-soft); color: #8A5A00; }
.plate { display: inline-flex; align-items: center; font-weight: 700; letter-spacing: .06em; font-size: 13px; line-height: 20px; padding: 2px 8px; border-radius: 6px; border: 1.5px solid var(--ink); background: #fff; white-space: nowrap; }

/* Tables */
.tbl-wrap { overflow: auto; max-height: 640px; border-radius: 0 0 var(--radius) var(--radius); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { position: sticky; top: 0; background: #fff; text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 16px; border-bottom: 1px solid var(--line-2); z-index: 1; white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background-color .15s; }
.tbl tbody tr:hover { background: rgba(229, 160, 13, .06); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl .r, .tbl th.r { text-align: right; }
.tbl td.r { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .t-main { font-weight: 600; }
.tbl .t-sub { font-size: 13px; color: var(--muted); }
.tbl .actions { white-space: nowrap; text-align: right; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.toolbar .search { position: relative; flex: 1; min-width: 220px; }
.toolbar .search .input { padding-left: 40px; }
.toolbar .search .ic { position: absolute; left: 12px; top: 12px; color: var(--muted); pointer-events: none; }
.toolbar select.input { width: auto; min-width: 150px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { text-decoration: none; border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 6px 14px; min-height: 36px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); transition: background-color .18s, color .18s, border-color .18s; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: rgba(15,39,57,.3); color: var(--ink); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .cc { font-size: 12px; opacity: .75; }
.tbl-foot { padding: 12px 24px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .ic { color: var(--faint); }

/* Rows list (rankings) */
.rows { display: flex; flex-direction: column; }
.rowi { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-height: 52px; }
.rowi:last-child { border-bottom: 0; }
.rowi .rk { width: 28px; height: 28px; border-radius: 8px; background: rgba(15,39,57,.06); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); flex: none; }
.rowi .rk.top { background: var(--accent-soft); color: var(--accent-text); }
.rowi .ri-main { flex: 1; min-width: 0; }
.rowi .ri-main b { display: block; font-weight: 600; font-size: 14px; line-height: 20px; }
.rowi .ri-main .pill { display: inline-flex; }
.rowi .ri-main span:not(.pill) { display: block; font-size: 13px; line-height: 18px; color: var(--muted); }
.rowi .ri-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; white-space: nowrap; }
.rowi .ri-val span { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.pill-m { display: none !important; }
.status-rows .rowi { padding: 10px 0; }
.status-count { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Chart */
.chart { position: relative; width: 100%; height: 280px; }
.chart svg { display: block; overflow: visible; }
.chart .grid-line { stroke: rgba(15,39,57,.08); }
.chart .axis-t { font-size: 12px; fill: var(--faint); font-family: inherit; }
.chart-tip { position: absolute; pointer-events: none; background: var(--navy); color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 12px; line-height: 18px; white-space: nowrap; transform: translate(-50%, -100%); opacity: 0; transition: opacity .15s; z-index: 2; }
.chart-tip b { display: block; font-size: 12px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* Bays board */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.bay { background: rgba(15,39,57,.035); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 12px; min-height: 180px; }
.bay-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 0; }
.bay-head h3 { font-size: 15px; line-height: 22px; flex: 1; }
.bay-head .bay-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #fff; color: var(--muted); }
.bay-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--faint); font-size: 13px; border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 16px; }
.jcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s; }
.jcard:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(15,39,57,.08); }
.jcard .jc-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.jcard .jc-car { font-weight: 600; font-size: 14px; line-height: 20px; }
.jcard .jc-svc { font-size: 13px; line-height: 18px; color: var(--muted); }
.jcard .jc-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.jcard .jc-meta span { display: inline-flex; align-items: center; gap: 4px; }
.jcard .btn { margin-top: 4px; }
.steps { display: flex; gap: 4px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: rgba(15,39,57,.1); }
.steps i.on { background: var(--accent); }
.steps i.done { background: var(--green); }

/* My jobs (phone first) */
.myjobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.mj { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.mj .mj-car { font-size: 18px; line-height: 26px; font-weight: 700; }
.mj ul { margin: 0; padding-left: 20px; color: var(--ink); }
.mj .note { background: var(--paper); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--muted); }

/* Modal */
#modal-root .overlay { position: fixed; inset: 0; background: rgba(15, 39, 57, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto; animation: fade .2s var(--ease); }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); animation: rise .28s var(--ease); display: flex; flex-direction: column; }
.modal.wide { max-width: 860px; }
.modal.xwide { max-width: 980px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; line-height: 26px; flex: 1; }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--line); flex-wrap: wrap; background: #fff; border-radius: 0 0 20px 20px; }
.modal-foot .spacer { flex: 1; }
.section-t { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 8px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* Service picker */
.svc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.svc-opt { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; cursor: pointer; min-height: 48px; transition: border-color .18s, background-color .18s; }
.svc-opt:hover { border-color: rgba(15,39,57,.3); }
.svc-opt input { width: 18px; height: 18px; accent-color: var(--navy); flex: none; }
.svc-opt .so-name { flex: 1; font-size: 14px; line-height: 20px; font-weight: 500; }
.svc-opt .so-price { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.svc-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.part-row { display: grid; grid-template-columns: 1fr 90px 120px 40px; gap: 8px; align-items: center; }
.part-row .pr-total { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }
.summary { background: var(--paper); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.summary .s-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.summary .s-total { font-size: 18px; font-weight: 700; border-top: 1px solid var(--line-2); padding-top: 8px; margin-top: 4px; }
.summary .s-total span:last-child { color: var(--accent-text); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline div { display: flex; gap: 12px; font-size: 13px; align-items: center; }
.timeline i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.alert-box { display: flex; gap: 12px; align-items: flex-start; background: var(--red-soft); color: var(--ink); border-radius: 12px; padding: 12px; font-size: 14px; }
.alert-box .ic { color: var(--red); margin-top: 2px; }
.info-box { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); border-radius: 12px; padding: 12px; font-size: 14px; }
.pay-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pay-opt { border: 1px solid var(--line-2); border-radius: 12px; padding: 10px; text-align: center; cursor: pointer; font-weight: 600; font-size: 14px; min-height: 44px; background: #fff; }
.pay-opt.on { border-color: var(--navy); background: var(--navy); color: #fff; }

/* Toast */
#toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 440px; }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 14px; display: flex; gap: 12px; align-items: center; animation: rise .25s var(--ease); pointer-events: auto; }
.toast.err { background: var(--red); }
.toast .ic { color: var(--accent); }
.toast.err .ic { color: #fff; }

/* Rentals calendar */
.cal-wrap { overflow-x: auto; }
.cal { display: grid; min-width: 960px; }
.cal-row { display: grid; grid-template-columns: 200px 1fr; border-bottom: 1px solid var(--line); min-height: 56px; }
.cal-row:last-child { border-bottom: 0; }
.cal-unit { padding: 8px 16px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); background: #fff; position: sticky; left: 0; z-index: 2; }
.cal-unit b { font-size: 13px; line-height: 18px; }
.cal-unit span { font-size: 12px; line-height: 16px; color: var(--muted); }
.cal-days { position: relative; display: grid; }
.cal-day { border-right: 1px solid var(--line); cursor: pointer; transition: background-color .15s; }
.cal-day:hover { background: var(--accent-soft); }
.cal-day.today { background: rgba(229,160,13,.07); }
.cal-day.wkend { background: rgba(15,39,57,.025); }
.cal-head .cal-day { cursor: default; text-align: center; font-size: 12px; line-height: 16px; padding: 8px 0; color: var(--muted); font-weight: 600; }
.cal-head .cal-day:hover { background: transparent; }
.cal-head .cal-day b { display: block; font-size: 14px; color: var(--ink); }
.cal-head .cal-day.today b { color: var(--accent-text); }
.cal-bar { position: absolute; top: 10px; height: 36px; border-radius: 10px; padding: 0 10px; font-size: 12px; font-weight: 600; display: flex; align-items: center; overflow: hidden; white-space: nowrap; cursor: pointer; border: 0; z-index: 1; text-align: left; transition: transform .18s var(--ease), box-shadow .18s; }
.cal-bar:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15,39,57,.15); }
.cal-bar.reserved { background: #DCE8F5; color: #1E4F85; }
.cal-bar.out { background: var(--accent); color: var(--navy); }
.cal-bar.overdue { background: #F3D4CE; color: #8E2A1B; }
.cal-bar.returned { background: #E3EDE7; color: #2A6A4A; }
.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.fleet-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.fleet-card .fc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fleet-card h3 { font-size: 16px; line-height: 24px; }
.fuel { display: inline-flex; gap: 3px; vertical-align: middle; }
.fuel i { width: 8px; height: 12px; border-radius: 2px; background: rgba(15,39,57,.12); }
.fuel i.on { background: var(--green); }
.fuel.low i.on { background: var(--red); }
.tabs { display: flex; gap: 4px; background: rgba(15,39,57,.05); padding: 4px; border-radius: 14px; width: max-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 8px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; min-height: 40px; white-space: nowrap; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.extra-row { display: grid; grid-template-columns: 1fr 140px 40px; gap: 8px; align-items: center; }

/* Print docs */
.doc { background: #fff; color: #111; font-size: 13px; line-height: 20px; padding: 32px; border: 1px solid var(--line); border-radius: 12px; }
.doc .d-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #111; padding-bottom: 12px; margin-bottom: 16px; }
.doc .d-head h2 { font-size: 20px; line-height: 28px; }
.doc .d-title { text-align: right; }
.doc .d-title b { display: block; font-size: 16px; letter-spacing: .08em; }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.doc th, .doc td { border-bottom: 1px solid #ddd; padding: 6px 4px; text-align: left; }
.doc th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #555; }
.doc .r { text-align: right; }
.doc .d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; }
.doc .d-tot td { font-weight: 700; font-size: 15px; border-bottom: 0; }
.doc .d-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 40px; }
.doc .d-sign div { border-top: 1px solid #111; padding-top: 4px; font-size: 12px; text-align: center; }
.doc .d-note { font-size: 12px; color: #555; margin-top: 16px; }
#print-root { display: none; }
@media print {
  body { background: #fff; }
  #app, #modal-root, #toast-root { display: none !important; }
  #print-root { display: block; }
  #print-root .doc { border: 0; padding: 0; }
}

/* Responsive */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); }
  .shell.drawer .sidebar { transform: none; }
  .shell.drawer .scrim { display: block; position: fixed; inset: 0; background: rgba(15,39,57,.4); z-index: 35; animation: fade .2s; }
  .hamburger { display: inline-flex; width: 44px; height: 44px; }
  .topbar { padding: 12px 16px; gap: 8px; flex-wrap: wrap; }
  .topbar h1 { font-size: 20px; line-height: 28px; flex: 1; }
  .top-search { order: 5; flex-basis: 100%; max-width: none; }
  .user-chip { padding: 2px; }
  .user-chip .uc-text { display: none; }
  .content { padding: 16px 16px 48px; }
  .split { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 24px; }
  .login-art h1 { font-size: 28px; line-height: 36px; }
  .login-art .art { margin: 16px 0 0; max-width: 360px; }
  .login-art .foot { display: none; }
  .login-panel { padding: 24px 16px 48px; }
  .demo-strip { padding: 6px 16px; font-size: 12px; line-height: 18px; }
}
@media (max-width: 760px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 16px; }
  .kpi .k-val { font-size: 20px; line-height: 28px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .svc-grid { grid-template-columns: 1fr; }
  .pay-opts { grid-template-columns: 1fr 1fr; }
  .card-head, .toolbar { padding: 12px 16px; }
  .card-body { padding: 12px 16px 16px; }
  .card-pad { padding: 16px; }
  .toolbar select.input { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .card-head.cal-hb { flex-wrap: wrap; }
  .card-head.cal-hb h3 { flex-basis: 100%; order: -1; margin-left: 0 !important; }
  .cal-hb .legend { flex-basis: 100%; gap: 12px; }
  .cal-row { grid-template-columns: 128px 1fr; }
  .cal-unit { padding: 8px 10px; }
  .jrow > .pill { display: none; }
  .jrow .pill-m { display: inline-flex !important; margin-top: 4px; }
  .toolbar .search { min-width: 100%; }
  .tbl-wrap { max-height: none; overflow: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .tbl td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; min-height: 28px; align-items: center; }
  .tbl td::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; flex: none; }
  .tbl td[data-label=""]::before { display: none; }
  .tbl td > div { min-width: 0; }
  .tbl .actions { justify-content: flex-end; }
  .modal-body { padding: 16px; }
  .modal-head, .modal-foot { padding: 16px; }
  #modal-root .overlay { padding: 16px 8px; }
  .modal-foot .btn { flex: 1; }
  .modal-foot .spacer { display: none; }
  .part-row { grid-template-columns: 1fr 72px 40px; }
  .part-row .pr-total { display: none; }
  .kv { grid-template-columns: 1fr 1.4fr; }
  .page-head .btn { flex: 1; }
  .role-cards { grid-template-columns: 1fr 1fr 1fr; }
  .role-card { padding: 10px; min-height: 96px; }
  .doc { padding: 16px; }
  .doc .d-head { flex-direction: column; }
  .doc .d-title { text-align: left; }
  .myjobs { grid-template-columns: 1fr; }
  .mj .btn-lg { width: 100%; }
  .extra-row { grid-template-columns: 1fr 100px 40px; }
  .chart { height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Shared demo strip colours: identical on every EulClavie demo */
.demo-strip { background: #FFF6E5; color: #6B4A00; border-bottom: 1px solid rgba(183, 121, 31, .22); font-size: 13px; line-height: 20px; font-weight: 500; }
.demo-strip .ic, .demo-strip > svg { color: #6B4A00; }
.demo-strip button[data-reset] { color: #6B4A00; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; background: none; }
.demo-strip button[data-reset]:hover { background: rgba(183, 121, 31, .12); }
.demo-strip .ds-x { color: #6B4A00; text-decoration: none; background: none; }
.demo-strip .ds-x:hover { background: rgba(183, 121, 31, .14); color: #6B4A00; }
