/* =========================================================
   Drivora CRM — app styles  (v1.0.0)
   Inter, white / slate surfaces, green accent, tinted stat icons.
   Light + dark themes. Mobile down to 390px.
   ========================================================= */
:root, [data-theme="light"] {
  --bg: #F9FAFB;
  --surface: #FFFFFF;
  --surface-2: #F9FAFB;
  --surface-3: #F3F4F6;
  --ink: #111827;
  --text: #111827;
  --muted: #6B7280;
  --line: #E5E7EB;
  --line-2: #D1D5DB;
  --accent: #15803D;
  --accent-ink: #FFFFFF;
  --accent-soft: #DCFCE7;
  --primary: #15803D;
  --primary-ink: #FFFFFF;
  --focus: #2563EB;
  --green: #15803D; --green-bg: #DCFCE7;
  --red: #DC2626;   --red-bg: #FEE2E2;
  --amber: #B45309; --amber-bg: #FEF3C7;
  --blue: #2563EB;  --blue-bg: #EFF6FF;
  --violet: #7C3AED; --violet-bg: #F5F3FF;
  --gray-bg: #F3F4F6;
  --shadow: 0 1px 2px rgba(16,24,40,.05);
  --shadow-md: 0 6px 16px -8px rgba(16,24,40,.18);
  --shadow-lg: 0 20px 48px -16px rgba(16,24,40,.25);
  --r: 10px;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --code: "SF Mono", Menlo, Consolas, monospace;
  --sb-w: 244px;
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0B1120;
  --surface: #111827;
  --surface-2: #0F172A;
  --surface-3: #1F2937;
  --ink: #F9FAFB;
  --text: #F3F4F6;
  --muted: #9CA3AF;
  --line: #1F2937;
  --line-2: #374151;
  --accent: #22C55E;
  --accent-ink: #052E16;
  --accent-soft: rgba(34,197,94,.15);
  --primary: #22C55E;
  --primary-ink: #052E16;
  --focus: #60A5FA;
  --green: #4ADE80; --green-bg: rgba(74,222,128,.12);
  --red: #F87171;   --red-bg: rgba(248,113,113,.13);
  --amber: #FBBF24; --amber-bg: rgba(251,191,36,.12);
  --blue: #60A5FA;  --blue-bg: rgba(96,165,250,.13);
  --violet: #A78BFA; --violet-bg: rgba(167,139,250,.13);
  --gray-bg: rgba(249,250,251,.07);
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 20px -10px rgba(0,0,0,.7);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
html { overflow-x: hidden; }
body { margin: 0; font: 400 14px/1.5 var(--sans); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
a.link { color: var(--accent); font-weight: 500; }
a.link:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--code); font-size: 12px; }
.ic { flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { height: 100vh; display: grid; place-items: center; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--text);
  font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s, filter .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn--primary:hover { background: var(--primary); border-color: var(--primary); filter: brightness(1.08); }
.btn--dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--dark:hover { background: var(--ink); filter: brightness(1.2); }
.btn--danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn--danger:hover { background: var(--red); border-color: var(--red); filter: brightness(1.08); }
.btn--soft-danger { color: var(--red); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn--block { width: 100%; height: 42px; font-size: 14px; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid currentColor; border-color: var(--muted); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; position: relative; flex: none; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 500; cursor: pointer; font-size: 12.5px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.danger { color: var(--red); }

/* ---------- inputs ---------- */
.input {
  width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface);
  color: var(--text); font: inherit; font-size: 13.5px; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
textarea.input { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.input--sm { height: 32px; font-size: 12.5px; width: auto; min-width: 130px; }
.input::placeholder { color: var(--muted); opacity: .8; }
input[type="date"].input, input[type="datetime-local"].input { min-width: 0; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full, .fsection { grid-column: 1 / -1; }
.field > label { font-size: 12.5px; font-weight: 500; color: var(--text); }
.field small { color: var(--muted); font-size: 12px; }
.field small.err { color: var(--red); }
.field .req { color: var(--red); font-style: normal; }
.field.bad .input { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.fsection { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line); margin-top: 4px; }
.tagbox { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 36px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); }
.tagbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.tagbox input { flex: 1; min-width: 80px; border: 0; outline: none; background: none; font: inherit; font-size: 13px; color: var(--text); height: 24px; }
.tagbox .chip button { border: 0; background: none; padding: 0 0 0 4px; cursor: pointer; color: var(--muted); display: inline-grid; }

/* ---------- chips, badges, pills ---------- */
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: 12px; cursor: pointer; color: var(--text); }
.chip:hover { border-color: var(--muted); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip--static { cursor: default; height: 22px; font-size: 11.5px; background: var(--surface-3); border-color: transparent; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge--green { background: var(--green-bg); color: var(--green); }
.badge--red { background: var(--red-bg); color: var(--red); }
.badge--amber { background: var(--amber-bg); color: var(--amber); }
.badge--blue { background: var(--blue-bg); color: var(--blue); }
.badge--violet { background: var(--violet-bg); color: var(--violet); }
.badge--gray { background: var(--gray-bg); color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--green { background: var(--green-bg); color: var(--green); }
.pill--red { background: var(--red-bg); color: var(--red); }
.pill--amber { background: var(--amber-bg); color: var(--amber); }
.pill--blue { background: var(--blue-bg); color: var(--blue); }
.pill--violet { background: var(--violet-bg); color: var(--violet); }
.pill--gray { background: var(--gray-bg); color: var(--muted); }
.demo-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.demo-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--green); font-weight: 600; flex: none; }
.who { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.who > span:last-child { min-width: 0; }
.who small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .25s ease; }
.shell.collapsed { --sb-w: 66px; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface-2); border-right: 1px solid var(--line); overflow: hidden; }
.sb-brand { display: flex; align-items: center; gap: 10px; margin: 12px 10px 6px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.sb-brand__mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; flex: none; }
.sb-brand__txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sb-brand__txt b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-brand__txt small { color: var(--muted); font-size: 11.5px; text-transform: capitalize; }
.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 10px 12px; scrollbar-width: thin; }
.sb-sec__h { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 7px; white-space: nowrap; }
.sb-link { display: flex; align-items: center; gap: 11px; width: 100%; height: 36px; padding: 0 10px; margin-bottom: 2px; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; font-size: 13.5px; text-align: left; white-space: nowrap; transition: background .15s; }
.sb-link:hover { background: var(--surface-3); }
.sb-link .ic { color: var(--muted); }
.sb-link.on { background: var(--surface); font-weight: 600; box-shadow: 0 1px 3px rgba(16,24,40,.1), 0 0 0 1px var(--line); }
.sb-link.on .ic { color: var(--accent); }
.sb-lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sb-badge { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
[data-theme="dark"] .sb-badge { color: var(--accent-ink); }
.sb-foot { display: flex; justify-content: space-between; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.sb-foot a:hover { color: var(--text); }
.collapsed .sb-brand__txt, .collapsed .sb-lbl, .collapsed .sb-sec__h, .collapsed .sb-foot, .collapsed .sb-badge { display: none; }
.collapsed .sb-brand { justify-content: center; padding: 8px 0; }
.collapsed .sb-link { justify-content: center; padding: 0; }
.collapsed .sb-sec { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 6px; }

.shell__main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: 60px; padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar__title { font-size: 18px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar__back { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); flex: none; }
.topbar__back:hover { background: var(--surface-3); color: var(--text); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 4px; min-width: 0; }
.gsearch { position: relative; width: 280px; margin-right: 6px; }
.gsearch .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.gsearch .input { padding-left: 33px; height: 36px; background: var(--surface-2); }
.gsearch kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 11px var(--sans); color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; background: var(--surface); }
.gs-pop { width: 380px; max-width: calc(100vw - 16px); max-height: 70vh; overflow-y: auto; padding: 6px; }
.gs-pop h4 { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 9px 4px; }
.gs-pop button small { margin-left: auto; color: var(--muted); font-size: 12px; }
.gs-pop button.hl { background: var(--surface-3); }
.userbtn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; margin-left: 4px; }
.userbtn:hover { background: var(--surface-2); }
.userbtn__name { font-size: 13px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dotcount { position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 600; display: grid; place-items: center; }
.page { flex: 1; padding: 22px 24px 60px; outline: none; min-width: 0; }
.page__inner { max-width: 1480px; margin: 0 auto; min-width: 0; }
.page__inner.anim { animation: pagein .32s var(--ease); }
@keyframes pagein { from { opacity: 0; transform: translateY(6px); } }
.scrim { display: none; }
.only-mobile { display: none !important; }

/* ---------- menu / popovers ---------- */
.menu { position: fixed; z-index: 1000; min-width: 200px; max-width: 340px; padding: 5px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-lg); animation: pop .14s ease; }
.menu > button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 9px; border: 0; border-radius: 7px; background: none; text-align: left; font-size: 13px; cursor: pointer; color: var(--text); }
.menu > button:hover:not(:disabled), .menu > button:focus-visible { background: var(--surface-3); outline: none; }
.menu > button:disabled { color: var(--muted); cursor: default; }
.menu > button.danger { color: var(--red); }
.menu > button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.todaypop { width: 380px; max-width: calc(100vw - 16px); padding: 0; max-height: 75vh; overflow-y: auto; }
.todaypop__head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.todaypop h4 { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 10px 14px 4px; }
.todaypop > button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 14px; text-align: left; cursor: pointer; font-size: 13px; color: var(--text); }
.todaypop > button:hover { background: var(--surface-3); }
.todaypop > button span { flex: 1; min-width: 0; }
.todaypop > button small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todaypop__empty { padding: 8px 14px 12px; color: var(--muted); font-size: 12.5px; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; background: rgba(15,23,42,.45); backdrop-filter: blur(3px); animation: fade .15s; }
.modal-back.out { animation: fade .15s reverse forwards; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(620px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); animation: pop .18s ease; min-width: 0; }
.modal--wide { width: min(1000px, 100%); }
.modal--sm { width: min(440px, 100%); }
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.modal__head h3 { font-size: 16.5px; font-weight: 600; }
.modal__body { padding: 18px 20px; overflow-y: auto; min-width: 0; }
.modal__body > p { margin-bottom: 12px; }
.modal__foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }

/* ---------- toast ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 9px; max-width: 400px; padding: 11px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 13px; animation: toastin .25s var(--ease); transition: opacity .3s, transform .3s; }
.toast--ok .ic { color: #4ADE80; }
[data-theme="dark"] .toast--ok .ic { color: var(--accent-ink); }
.toast--err { background: var(--red); color: #fff; }
.toast--info { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-left: 4px solid var(--accent); }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }

/* ---------- cards / panels / stats ---------- */
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.panel { margin-bottom: 16px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 50px; flex-wrap: wrap; }
.panel__head h3 { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel__head h3 .count { font-size: 12px; font-weight: 500; color: var(--muted); }
.panel__body { padding: 14px 16px; min-width: 0; }
.panel__body--flush { padding: 0; }
.panel__sub { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stats--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); text-align: left; min-width: 0; font: inherit; color: inherit; }
.stat--link { cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.stat--link:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-md); }
.stat__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.stat__top > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat__ic { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-bg); color: var(--blue); flex: none; }
.stat__ic.t-green { background: var(--green-bg); color: var(--green); }
.stat__ic.t-amber { background: var(--amber-bg); color: var(--amber); }
.stat__ic.t-violet { background: var(--violet-bg); color: var(--violet); }
.stat__ic.t-red { background: var(--red-bg); color: var(--red); }
.stat__val { font-size: 24px; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat__sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.grid2 > .panel, .grid3 > .panel, .grid-2-1 > .panel { margin-bottom: 0; }
.gap-b { margin-bottom: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack > .panel { margin-bottom: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: 9px; margin-bottom: 14px; flex-wrap: wrap; max-width: 100%; }
.tabs button { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: none; font-size: 13px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 500; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 9px; flex: none; }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: none; font-size: 12.5px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 500; }

/* ---------- charts ---------- */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar__top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.bar__top span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__top b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar__track { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 999px; background: var(--accent); transform-origin: left; animation: grow .7s var(--ease); }
@keyframes grow { from { transform: scaleX(0); } }
.donut { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; color: var(--text); }
.donut__svg { flex: none; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; flex: 1; min-width: 150px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; padding-left: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cc { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); padding-bottom: 22px; }
.cc__axis { position: relative; }
.cc__axis span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cc__plot { position: relative; min-width: 0; }
.cc__grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.cc__grid.base { border-top-style: solid; }
.cc__bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.cc__col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.cc__bar { width: 64%; max-width: 34px; min-width: 2px; border-radius: 3px 3px 0 0; background: var(--accent); transform-origin: bottom; animation: growy .6s var(--ease); }
.cc__col:hover .cc__bar { background: var(--blue); }
.cc__lbl { position: absolute; top: calc(100% + 5px); left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
@keyframes growy { from { transform: scaleY(0); } }
.meter { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* ---------- list screen ---------- */
.list__toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.list__search { position: relative; flex: 1 1 240px; max-width: 380px; min-width: 0; }
.list__search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.list__search .input { padding-left: 33px; }
.list__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.list__filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.list__filters .lbl { font-size: 12px; color: var(--muted); }
.list__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 2px; font-size: 13px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 6px; }
.pager__n { min-width: 28px; height: 28px; padding: 0 6px; display: grid; place-items: center; border-radius: 7px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 12.5px; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); max-width: 100%; }
.panel .tablewrap { border: 0; box-shadow: none; border-radius: 0 0 var(--r) var(--r); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: var(--surface-2); text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th button { all: unset; cursor: pointer; }
.tbl th button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.tbl th.asc button::after { content: " \2191"; } .tbl th.desc button::after { content: " \2193"; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl td.wrap { white-space: normal; min-width: 180px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 0; }
.tbl--sm td { padding: 7px 10px; }
.cell-main { font-weight: 500; }
.cell-sub { display: block; color: var(--muted); font-size: 12px; }
.ref { font-family: var(--code); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.thumb { width: 52px; height: 34px; border-radius: 6px; object-fit: cover; background: var(--surface-3); display: block; flex: none; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 16px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); }
.empty__ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.empty--sm { padding: 22px 10px; border: 0; background: none; font-size: 13px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
/* skeletons */
.sk-wrap { display: flex; flex-direction: column; gap: 16px; }
.sk-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.sk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sk-row { display: flex; gap: 18px; padding: 6px 0; }
.sk { border-radius: 6px; background: linear-gradient(90deg, var(--surface-3) 0%, var(--line) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kb-col { background: var(--surface-3); border-radius: var(--r); padding: 8px; min-height: 320px; display: flex; flex-direction: column; transition: background .15s, outline .15s; }
.kb-col.over { outline: 2px dashed var(--accent); outline-offset: -2px; background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface-3)); }
.kb-col__head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 600; font-size: 13px; }
.kb-col__head b { font-weight: 500; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--surface); color: var(--muted); }
.kb-col__head i { width: 8px; height: 8px; border-radius: 50%; }
.kb-col__body { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kb-card { padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 5px; cursor: grab; font-size: 13px; text-align: left; color: inherit; width: 100%; transition: transform .15s, box-shadow .15s; }
.kb-card:hover { box-shadow: var(--shadow-md); }
.kb-card.drag { opacity: .45; }
.kb-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 12.5px; border: 1px dashed var(--line-2); border-radius: 9px; }
.kv { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.kv span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }

/* ---------- record pages ---------- */
.rec { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.rec__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.rec__head > div:first-child { min-width: 0; }
.rec__title { font-size: 24px; font-weight: 600; line-height: 1.15; letter-spacing: -.015em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; overflow-wrap: anywhere; }
.rec__meta { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; color: var(--muted); font-size: 13px; }
.rec__meta span { display: inline-flex; align-items: center; gap: 5px; }
.rec__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0; }
.dgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dgrid div.full { grid-column: 1 / -1; }
.dgrid dt { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-bottom: 3px; }
.dgrid dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.lines { width: 100%; border-collapse: collapse; font-size: 13px; }
.lines td { padding: 6px 0; vertical-align: top; }
.lines td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.lines tr.sep td { border-top: 1px solid var(--line); padding-top: 10px; }
.lines tr.total td { font-size: 15px; font-weight: 600; border-top: 1px solid var(--line); padding-top: 10px; }
.lines tr.dim td { color: var(--muted); }
.lines .neg { color: var(--green); }
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 10px; position: relative; padding-bottom: 14px; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.tl-dot { width: 15px; height: 15px; border-radius: 50%; border: 3px solid var(--surface); background: var(--accent); box-shadow: 0 0 0 1px var(--line-2); flex: none; margin-top: 2px; }
.tl-dot.t-blue { background: var(--blue); } .tl-dot.t-amber { background: var(--amber); } .tl-dot.t-red { background: var(--red); } .tl-dot.t-gray { background: var(--muted); } .tl-dot.t-violet { background: var(--violet); }
.tl-body { font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.tl-meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.lifecycle { display: flex; align-items: center; gap: 0; margin-bottom: 16px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
.lc-step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.lc-step b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 11px; font-weight: 600; flex: none; }
.lc-step.done { color: var(--text); } .lc-step.done b { background: var(--accent); color: #fff; }
.lc-step.cur { color: var(--text); font-weight: 600; } .lc-step.cur b { background: var(--accent-soft); color: var(--green); box-shadow: 0 0 0 2px var(--accent); }
.lc-step.bad b { background: var(--red); color: #fff; }
.lc-line { flex: 1; min-width: 24px; height: 2px; background: var(--line); margin: 0 10px; }
.lc-line.done { background: var(--accent); }
.mini { display: flex; gap: 12px; align-items: center; min-width: 0; }
.mini img { width: 96px; height: 62px; border-radius: 8px; object-fit: cover; background: var(--surface-3); flex: none; }
.mini > div { min-width: 0; }
.mini strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border-radius: 8px; font-size: 13px; background: var(--amber-bg); color: var(--amber); margin-bottom: 12px; }
.alert--red { background: var(--red-bg); color: var(--red); }
.alert--blue { background: var(--blue-bg); color: var(--blue); }
.alert--green { background: var(--green-bg); color: var(--green); }
.alert .ic { margin-top: 2px; }
.note-add { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; margin-bottom: 14px; }

/* ---------- dashboard ---------- */
.agenda { display: flex; flex-direction: column; }
.agenda__item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.agenda__item:last-child { border-bottom: 0; }
.agenda__time { font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.agenda__main { min-width: 0; }
.agenda__main a { font-weight: 500; }
.agenda__main a:hover { text-decoration: underline; text-underline-offset: 3px; }
.agenda__main small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed { display: flex; flex-direction: column; }
.feed__item { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.feed__item:last-child { border-bottom: 0; }
.feed__item > div { min-width: 0; overflow-wrap: anywhere; }
.feed__ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex: none; }
.fleetsum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fleetsum div { padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.fleetsum b { display: block; font-size: 20px; font-weight: 600; }
.fleetsum span { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.fleetsum i { width: 8px; height: 8px; border-radius: 50%; }
.upcoming { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.upc-day { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); min-width: 0; }
.upc-day.today { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.upc-day h5 { margin: 0 0 6px; font-size: 12px; font-weight: 600; }
.upc-day h5 small { color: var(--muted); font-weight: 400; }
.upc-day p { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.upc-day p b { color: var(--text); }

/* ---------- fleet ---------- */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.vcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s; text-align: left; font: inherit; color: inherit; padding: 0; }
.vcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.vcard__img { position: relative; height: 0; padding-top: 56.25%; background: var(--surface-3); overflow: hidden; }
.vcard__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard__img .pill { position: absolute; top: 10px; left: 10px; box-shadow: var(--shadow); }
.vcard__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.vcard__title { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.vcard__title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcard__title span { font-weight: 600; white-space: nowrap; }
.plate { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border: 1px solid var(--line-2); border-radius: 5px; font: 600 11.5px var(--code); letter-spacing: .06em; background: var(--surface); white-space: nowrap; }
.imgprev { width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; background: var(--surface-3); }
.hero-img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; border-radius: var(--r) var(--r) 0 0; display: block; background: var(--surface-3); }

/* ---------- gantt (calendar) ---------- */
.gantt-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.gantt-bar strong { font-size: 15px; font-weight: 600; min-width: 170px; }
.gantt-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-left: auto; }
.gantt-legend span { display: inline-flex; align-items: center; gap: 5px; }
.gantt-legend i { width: 12px; height: 8px; border-radius: 3px; }
.gantt-legend i.hatch { background: repeating-linear-gradient(135deg, var(--muted) 0 2px, transparent 2px 5px); border: 1px solid var(--muted); }
.gantt { --lab: 210px; --col: 44px; position: relative; overflow: auto; max-height: calc(100vh - 210px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.gantt__grid { display: grid; grid-template-columns: var(--lab) calc(var(--days) * var(--col)); min-width: max-content; }
.g-corner, .g-lab { position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--line); }
.g-corner { top: 0; z-index: 5; border-bottom: 1px solid var(--line); padding: 8px 12px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); display: flex; align-items: flex-end; }
.g-days { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: repeat(var(--days), var(--col)); background: var(--surface); border-bottom: 1px solid var(--line); }
.g-day { text-align: center; padding: 6px 0; font-size: 11px; color: var(--muted); border-left: 1px solid var(--line); line-height: 1.25; }
.g-day b { display: block; font-size: 13px; color: var(--text); font-weight: 600; }
.g-day.we { background: var(--surface-2); }
.g-day.today b { color: #fff; background: var(--accent); border-radius: 6px; width: 24px; margin: 0 auto; }
[data-theme="dark"] .g-day.today b { color: var(--accent-ink); }
.g-group { grid-column: 1 / -1; position: sticky; left: 0; padding: 6px 12px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.g-group span { position: sticky; left: 12px; }
.g-lab { display: flex; align-items: center; gap: 9px; padding: 0 12px; height: 46px; border-bottom: 1px solid var(--line); min-width: 0; font-size: 12.5px; }
.g-lab img { width: 40px; height: 26px; border-radius: 5px; object-fit: cover; background: var(--surface-3); flex: none; }
.g-lab div { min-width: 0; }
.g-lab a { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-lab a:hover { text-decoration: underline; }
.g-lab small { color: var(--muted); font-size: 11px; font-family: var(--code); }
.g-track { position: relative; height: 46px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(var(--days), var(--col)); }
.g-cell { border: 0; border-left: 1px solid var(--line); background: transparent; padding: 0; cursor: cell; }
.g-cell.we { background: var(--surface-2); }
.g-cell:hover, .g-cell:focus-visible { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); outline: none; }
.g-cell.today { background: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.g-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 2; pointer-events: none; }
.g-evt { position: absolute; top: 8px; height: 30px; border-radius: 6px; padding: 0 8px; display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: #fff; background: var(--c); border: 0; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; z-index: 1; box-shadow: 0 1px 2px rgba(0,0,0,.15); text-align: left; transition: filter .15s, transform .15s; }
.g-evt:hover, .g-evt:focus-visible { filter: brightness(1.1); transform: translateY(-1px); z-index: 2; }
.g-evt span { overflow: hidden; text-overflow: ellipsis; }
.g-evt.clip-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.g-evt.clip-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.g-evt.maint { color: var(--text); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) 35%, transparent) 0 4px, color-mix(in srgb, var(--muted) 12%, transparent) 4px 9px); border: 1px solid var(--line-2); box-shadow: none; }
.g-evt.overdue { box-shadow: 0 0 0 2px var(--red); }

/* ---------- booking form ---------- */
.bform { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.quotebox { position: sticky; top: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.quotebox h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.extras-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.xopt { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: var(--surface); min-width: 0; }
.xopt label { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.xopt label small { color: var(--muted); font-size: 11.5px; }
.xopt input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.xopt input[type=number] { width: 52px; height: 28px; padding: 0 6px; }
.custpick { position: relative; }
.custpick__list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; max-height: 240px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; box-shadow: var(--shadow-lg); padding: 4px; }
.custpick__list button { display: flex; flex-direction: column; width: 100%; padding: 7px 9px; border: 0; background: none; text-align: left; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); }
.custpick__list button:hover, .custpick__list button.hl { background: var(--surface-3); }
.custpick__list small { color: var(--muted); font-size: 12px; }
.custsel { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); }
.custsel > div { flex: 1; min-width: 0; }
.custsel small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.newcust { padding: 12px; border: 1px dashed var(--line-2); border-radius: 9px; background: var(--surface-2); }

/* ---------- settings ---------- */
.set-list { display: flex; flex-direction: column; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.set-row:last-child { border-bottom: 0; }
.set-row small { display: block; color: var(--muted); font-size: 12px; }
.themepick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.themepick button { border: 2px solid var(--line); border-radius: 10px; padding: 10px; background: var(--surface); cursor: pointer; text-align: left; font-size: 13px; font-weight: 500; color: var(--text); }
.themepick button.on { border-color: var(--accent); }
.themepick .sw { height: 56px; border-radius: 6px; margin-bottom: 8px; border: 1px solid var(--line); }

/* ---------- print documents ---------- */
.paper { background: #fff; color: #111827; padding: 44px; border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 12.5px; max-width: 900px; margin: 0 auto; }
.paper h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.paper h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #6B7280; margin: 22px 0 8px; }
.paper table { width: 100%; border-collapse: collapse; }
.paper th { text-align: left; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #6B7280; padding: 8px 6px; border-bottom: 1.5px solid #111827; }
.paper td { padding: 8px 6px; border-bottom: 1px solid #E5E7EB; vertical-align: top; }
.paper .r { text-align: right; font-variant-numeric: tabular-nums; }
.paper .tot td { font-weight: 700; font-size: 14px; border-bottom: 0; border-top: 1.5px solid #111827; }
.pp-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 3px solid #15803D; }
.pp-brand { display: flex; gap: 10px; align-items: center; }
.pp-brand span { width: 36px; height: 36px; border-radius: 9px; background: #15803D; color: #fff; display: grid; place-items: center; }
.pp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 30px; }
.pp-grid dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: #6B7280; }
.pp-grid dd { margin: 0 0 6px; font-weight: 500; }
.pp-terms { font-size: 11px; color: #374151; columns: 2; column-gap: 28px; }
.pp-terms li { margin-bottom: 5px; break-inside: avoid; }
.pp-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 44px; }
.pp-sign div { border-top: 1px solid #111827; padding-top: 6px; font-size: 11px; color: #6B7280; }
.fuelbar { display: inline-flex; gap: 2px; vertical-align: middle; }
.fuelbar i { width: 7px; height: 12px; border-radius: 2px; background: #E5E7EB; }
.fuelbar i.on { background: #15803D; }

/* ---------- auth pages ---------- */
body.auth { background: var(--bg); }
.auth__split { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth__brand { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 40px 48px; background: #0F172A; color: #F9FAFB; position: relative; overflow: hidden; }
.auth__brand::after { content: ""; position: absolute; right: -160px; bottom: -160px; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(34,197,94,.35), transparent 65%); pointer-events: none; }
.auth__logo { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; color: #F9FAFB; }
.auth__logo span.mk { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #16A34A; }
.auth__brand h1 { font-size: clamp(28px, 3.2vw, 42px); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; max-width: 15ch; }
.auth__brand h1 em { color: #4ADE80; font-style: normal; }
.auth__brand p { color: #94A3B8; margin-top: 14px; max-width: 44ch; }
.auth__pills { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 560px; }
.auth__pills li { padding: 12px; border: 1px solid rgba(148,163,184,.25); border-radius: 10px; font-size: 12px; color: #94A3B8; }
.auth__pills b { display: block; color: #F9FAFB; font-weight: 500; margin-bottom: 3px; font-size: 13px; }
.auth__legal { color: #64748B; font-size: 12px; }
.auth__panel { display: grid; place-items: center; padding: 32px 20px; }
.auth__form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.auth__form h2 { font-size: 26px; font-weight: 600; letter-spacing: -.015em; }
.auth__form .input { height: 42px; font-size: 14px; }
.auth__alert { padding: 10px 12px; border-radius: 8px; background: var(--red-bg); color: var(--red); font-size: 13px; }
.auth__hint { padding: 10px 12px; border-radius: 8px; background: var(--amber-bg); color: var(--amber); font-size: 13px; line-height: 1.5; }
.auth__hint code { font-family: var(--code); font-size: 12.5px; color: var(--text); background: var(--surface); padding: 1px 5px; border-radius: 4px; cursor: pointer; border: 1px solid var(--line); }
.pw { position: relative; }
.pw .input { padding-right: 42px; }
.pw .icon-btn { position: absolute; right: 4px; top: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .stats--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gsearch { width: 220px; }
}
@media (max-width: 1100px) {
  .rec { grid-template-columns: minmax(0, 1fr); }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1 { grid-template-columns: minmax(0, 1fr); }
  .bform { grid-template-columns: minmax(0, 1fr); }
  .quotebox { position: static; }
  .upcoming { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell, .shell.collapsed { grid-template-columns: minmax(0, 1fr); --sb-w: 272px; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: 272px; transform: translateX(-100%); transition: transform .25s var(--ease), visibility .25s; box-shadow: var(--shadow-lg); visibility: hidden; }
  .shell.nav-open .sidebar { transform: none; visibility: visible; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(15,23,42,.4); animation: fade .2s; }
  .collapsed .sb-brand__txt, .collapsed .sb-lbl, .collapsed .sb-sec__h, .collapsed .sb-foot, .collapsed .sb-badge { display: revert; }
  .collapsed .sb-link { justify-content: flex-start; padding: 0 10px; }
  .only-desktop { display: none !important; }
  .only-mobile { display: inline-grid !important; }
  .userbtn__name { display: none; }
  .userbtn { padding: 0 3px; }
  .page { padding: 16px 16px 50px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .fgrid, .fgrid--3 { grid-template-columns: minmax(0, 1fr); }
  .dgrid, .dgrid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth__split { grid-template-columns: 1fr; }
  .auth__brand { padding: 26px 22px; gap: 18px; }
  .auth__brand h1 { font-size: 28px; }
  .auth__pills { display: none; }
  .list__actions { margin-left: 0; }
  .list__search { max-width: none; }
  .topbar { padding: 0 10px; gap: 4px; height: 56px; }
  .topbar__title { font-size: 16px; }
  .gsearch { display: none; }
  .extras-pick { grid-template-columns: minmax(0, 1fr); }
  .stats--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; }
  .stat__val { font-size: 20px; }
  .upcoming { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gantt { --lab: 128px; --col: 40px; max-height: none; }
  .g-lab img { display: none; }
  .gantt-legend { margin-left: 0; }
  .paper { padding: 22px; }
  .pp-grid { grid-template-columns: 1fr; }
  .pp-terms { columns: 1; }
  .rec__title { font-size: 20px; }
  .kanban { grid-auto-columns: minmax(240px, 82%); }
  .modal-back { padding: 8px; }
  .modal__body { padding: 16px; }
  .rec__actions .btn span { white-space: nowrap; }
}
@media (max-width: 420px) {
  .dgrid, .dgrid--3 { grid-template-columns: minmax(0, 1fr); }
  .demo-badge span { display: none; }
  .demo-badge { padding: 0 7px; }
}
@media print {
  .sidebar, .topbar, .no-print, .toasts, .scrim { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; }
  body, html { background: #fff !important; }
  .paper { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .page__inner { animation: none !important; max-width: none; }
  @page { margin: 14mm; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
