/* Laundry Bhaiya Platform: shared design system
   Brand: Blue #0B63F6 · Orange #FF8A00 · Cream #FFF8EE · Ink #0F172A
   Type: Sora (headings, numbers) · Inter (UI) */

:root {
  --blue: #0B63F6;
  --blue-600: #0A52CC;
  --blue-700: #0A47C4;
  --blue-900: #0B2A6B;
  --blue-100: #DCE8FF;
  --blue-50: #EEF4FF;
  --orange: #FF8A00;
  --orange-600: #A85200;
  --orange-100: #FFE6C7;
  --orange-50: #FFF4E5;
  --cream: #FFF8EE;
  --beige: #F1E7DA;
  --ink: #0F172A;
  --ink-2: #334155;
  --slate: #5B6678;
  --muted: #697488;
  --line: #E8E4DC;
  --line-2: #F1EEE8;
  --bg: #F7F5F0;
  --card: #FFFFFF;

  --green: #10B981; --green-700: #047857; --green-50: #E3F7EF;
  --red: #E5484D;   --red-700: #B42318;   --red-50: #FDECEC;
  --amber: #F59E0B; --amber-700: #8A5A00; --amber-50: #FFF4D6;
  --purple: #7C5CFA; --purple-700: #5B3FD1; --purple-50: #F0ECFF;
  --teal: #0EA5A4;  --teal-700: #0B7C7B;  --teal-50: #DDF6F5;
  --grey-50: #EFF1F5; --grey-700: #475569;

  --font-head: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-hand: "Kalam", "Sora", cursive;

  --r-xs: 6px; --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-2: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -10px rgba(15, 23, 42, .14);
  --shadow-3: 0 24px 60px -16px rgba(15, 23, 42, .28);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5 { font-family: var(--font-head); letter-spacing: -0.02em; margin: 0; line-height: 1.2; font-weight: 600; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--blue-100); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 14px; height: 14px; }
.ic-md { width: 20px; height: 20px; }
.ic-lg { width: 24px; height: 24px; }
.ic-xl { width: 32px; height: 32px; }

/* ---------- type helpers ---------- */
.num, .tabular { font-variant-numeric: tabular-nums; }
.head { font-family: var(--font-head); }
.muted { color: var(--slate); }
.faint { color: var(--muted); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.bold { font-weight: 600; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92em; }
.upper { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 600; color: var(--slate); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blue { color: var(--blue); } .orange { color: var(--orange-600); } .green { color: var(--green-700); } .red { color: var(--red-700); } .amber { color: var(--amber-700); }

/* ---------- layout helpers ---------- */
.row { display: flex; align-items: center; gap: 12px; }
.row-top { display: flex; align-items: flex-start; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } .g5 { grid-template-columns: repeat(5, 1fr); } .g6 { grid-template-columns: repeat(6, 1fr); }
.g-main { grid-template-columns: minmax(0, 1fr) 340px; }
.g-main-wide { grid-template-columns: minmax(0, 1fr) 400px; }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.spacer { flex: 1; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid transparent; font-family: var(--font-body); font-weight: 600; font-size: 13.5px; line-height: 1; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s; user-select: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 1px 2px rgba(11, 99, 246, .35); }
.btn-primary:hover { background: var(--blue-600); }
.btn-secondary { background: #fff; color: var(--ink); border-color: #D9D3C7; box-shadow: var(--shadow-1); }
.btn-secondary:hover { background: #FBFAF7; border-color: #C9C2B3; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(15, 23, 42, .05); }
.btn-soft { background: var(--blue-50); color: var(--blue-700); }
.btn-soft:hover { background: var(--blue-100); }
.btn-orange { background: var(--orange); color: var(--ink); }
.btn-orange:hover { background: #FF9A24; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1E293B; }
.btn-danger { background: #fff; color: var(--red-700); border-color: #F3C6C6; }
.btn-danger:hover { background: var(--red-50); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #0DA372; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn-xl { height: 54px; padding: 0 26px; font-size: 16px; border-radius: 13px; font-family: var(--font-head); }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--slate); }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; background: #fff; border: 1px solid #D9D3C7; border-radius: 9px; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235B6678' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:hover, .select:hover, .textarea:hover { border-color: #C2BAAA; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 99, 246, .14); }
.input::placeholder, .textarea::placeholder { color: #A0A8B7; }
.input-sm, .select-sm { height: 34px; font-size: 13px; }
.input-lg { height: 52px; font-size: 16px; border-radius: 12px; }
.input-wrap { position: relative; }
.input-wrap > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-wrap > .input { padding-left: 38px; }
.input-affix { display: flex; align-items: stretch; }
.input-affix > span { display: flex; align-items: center; padding: 0 12px; background: var(--line-2); border: 1px solid #D9D3C7; border-right: 0; border-radius: 9px 0 0 9px; font-weight: 600; color: var(--ink-2); }
.input-affix > .input { border-radius: 0 9px 9px 0; }
.input-affix.lg > span { font-size: 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border: 1.5px solid #C2BAAA; border-radius: 5px; background: #fff; display: grid; place-items: center; transition: all .12s; flex: none; margin: 0; }
.check input:checked { background: var(--blue); border-color: var(--blue); }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: #CBD2DC; border-radius: 99px; transition: background-color .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(16px); }

/* ---------- chips, badges, status ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--grey-50); color: var(--grey-700); white-space: nowrap; }
.chip .ic { width: 13px; height: 13px; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--grey-50); color: var(--grey-700); white-space: nowrap; }
.b-blue { background: var(--blue-50); color: var(--blue-700); } .b-orange { background: var(--orange-50); color: var(--orange-600); } .b-green { background: var(--green-50); color: var(--green-700); } .b-red { background: var(--red-50); color: var(--red-700); } .b-amber { background: var(--amber-50); color: var(--amber-700); } .b-purple { background: var(--purple-50); color: var(--purple-700); } .b-teal { background: var(--teal-50); color: var(--teal-700); } .b-dark { background: var(--ink); color: #fff; }
.st { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px 0 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--grey-50); color: var(--grey-700); }
.st i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.st-booked { background: var(--grey-50); color: var(--grey-700); }
.st-assigned, .st-accepted { background: var(--blue-50); color: var(--blue-700); }
.st-picked, .st-instore { background: var(--purple-50); color: var(--purple-700); }
.st-process { background: var(--orange-50); color: var(--orange-600); }
.st-qc { background: var(--amber-50); color: var(--amber-700); }
.st-ready { background: var(--teal-50); color: var(--teal-700); }
.st-out { background: var(--blue-100); color: var(--blue-700); }
.st-delivered, .st-paid, .st-won, .st-active, .st-accepted-q { background: var(--green-50); color: var(--green-700); }
.st-cancelled, .st-late, .st-overdue, .st-lost, .st-suspended { background: var(--red-50); color: var(--red-700); }
.st-pending, .st-draft, .st-unpaid, .st-paused { background: var(--grey-50); color: var(--grey-700); }
.st-partial, .st-risk { background: var(--amber-50); color: var(--amber-700); }
.st-sent { background: var(--blue-50); color: var(--blue-700); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-title { font-size: 15px; font-weight: 600; font-family: var(--font-head); letter-spacing: -0.015em; }
.card-sub { font-size: 12.5px; color: var(--slate); margin-top: 2px; }
.card-body { padding: 16px 18px 18px; }
.card-flush { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-link { transition: border-color .15s, box-shadow .15s, transform .2s; cursor: pointer; }
.card-link:hover { border-color: #D3CCBC; box-shadow: var(--shadow-2); }

.kpi { padding: 16px 18px; }
.kpi .k-label { font-size: 12.5px; color: var(--slate); display: flex; align-items: center; gap: 7px; font-weight: 500; }
.kpi .k-label .ic { width: 15px; height: 15px; color: var(--muted); }
.kpi .k-val { font-family: var(--font-head); font-size: 28px; font-weight: 600; letter-spacing: -0.03em; margin-top: 8px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .k-foot { margin-top: 8px; font-size: 12px; display: flex; align-items: center; gap: 6px; color: var(--slate); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.delta .ic { width: 12px; height: 12px; stroke-width: 2.4; }
.delta.up { color: var(--green-700); } .delta.down { color: var(--red-700); }
.kpi.is-alert { border-color: #F3C6C6; }
.kpi.is-alert .k-val { color: var(--red-700); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--slate); padding: 10px 14px; background: #FBFAF7; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.tbl th.right, .tbl td.right { text-align: right; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { transition: background-color .1s; }
.tbl tbody tr.is-link { cursor: pointer; }
.tbl tbody tr.is-link:hover { background: #FBFAF7; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .cell-main { font-weight: 600; }
.tbl .mono { white-space: nowrap; }
.tbl .cell-sub { font-size: 12px; color: var(--slate); }
.tbl tfoot td { background: #FBFAF7; font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; }

/* ---------- tabs, segmented ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 10px 14px; font-weight: 600; font-size: 13.5px; color: var(--slate); background: none; border: 0; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--blue); }
.tab.is-on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--blue); border-radius: 2px; }
.tab .count { margin-left: 6px; font-size: 11px; background: var(--grey-50); color: var(--grey-700); padding: 1px 6px; border-radius: 99px; }
.tab.is-on .count { background: var(--blue-50); color: var(--blue-700); }
.seg { display: inline-flex; padding: 3px; background: #EDE9E0; border-radius: 10px; gap: 2px; }
.seg button { height: 30px; padding: 0 12px; border: 0; background: transparent; border-radius: 8px; font-weight: 600; font-size: 12.5px; color: var(--slate); display: inline-flex; align-items: center; gap: 6px; }
.seg button.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15,23,42,.12); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fchip { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid #D9D3C7; background: #fff; font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.fchip:hover { border-color: #C2BAAA; }
.fchip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.fchip .n { font-size: 11px; opacity: .7; }

/* ---------- misc components ---------- */
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); font-weight: 600; font-size: 12.5px; color: #fff; background: var(--blue); flex: none; letter-spacing: 0; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }
.av-1 { background: var(--blue); } .av-2 { background: var(--orange); color: var(--ink); } .av-3 { background: var(--ink); } .av-4 { background: var(--teal); } .av-5 { background: var(--purple); } .av-6 { background: #E0457B; } .av-7 { background: var(--green); } .av-8 { background: #C2410C; }
.avatar-stack { display: flex; } .avatar-stack .avatar { border: 2px solid #fff; margin-left: -8px; } .avatar-stack .avatar:first-child { margin-left: 0; }
.progress { height: 6px; background: var(--grey-50); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--blue); border-radius: 99px; transition: width .6s var(--ease); }
.progress.green > i { background: var(--green); } .progress.orange > i { background: var(--orange); } .progress.red > i { background: var(--red); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.green { background: var(--green); } .dot.red { background: var(--red); } .dot.orange { background: var(--orange); } .dot.blue { background: var(--blue); } .dot.amber { background: var(--amber); }
.pulse { box-shadow: 0 0 0 0 rgba(16,185,129,.5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.45); } 80%, 100% { box-shadow: 0 0 0 9px rgba(16,185,129,0); } }
.icon-box { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); flex: none; }
.icon-box.o { background: var(--orange-50); color: var(--orange-600); } .icon-box.g { background: var(--green-50); color: var(--green-700); } .icon-box.p { background: var(--purple-50); color: var(--purple-700); } .icon-box.r { background: var(--red-50); color: var(--red-700); } .icon-box.t { background: var(--teal-50); color: var(--teal-700); } .icon-box.d { background: var(--ink); color: #fff; } .icon-box.gr { background: var(--grey-50); color: var(--grey-700); }
.icon-box.lg { width: 44px; height: 44px; border-radius: 12px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; font-size: 13.5px; }
.kv dt { color: var(--slate); } .kv dd { margin: 0; font-weight: 500; }
.demo-chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; background: var(--orange-50); color: var(--orange-600); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: 11px; padding: 1px 6px; border: 1px solid #D9D3C7; border-bottom-width: 2px; border-radius: 5px; background: #fff; color: var(--slate); }
.empty { text-align: center; padding: 40px 20px; color: var(--slate); }
.empty .icon-box { margin: 0 auto 12px; width: 48px; height: 48px; border-radius: 14px; }
.empty h4 { color: var(--ink); margin-bottom: 4px; font-size: 15px; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--blue-50); color: var(--blue-900); font-size: 13px; }
.note.warn { background: var(--amber-50); color: #6B4500; } .note.danger { background: var(--red-50); color: #8A1C14; } .note.ok { background: var(--green-50); color: #05603F; }
.note .ic { margin-top: 1px; }

/* timeline */
.tl { position: relative; }
.tl-item { position: relative; display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; border-left: 2px dashed #DDD6C8; }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #DDD6C8; background: #fff; display: grid; place-items: center; color: #fff; z-index: 1; }
.tl-dot .ic { width: 12px; height: 12px; stroke-width: 3; opacity: 0; }
.tl-item.done .tl-dot { background: var(--green); border-color: var(--green); }
.tl-item.done .tl-dot .ic { opacity: 1; }
.tl-item.done::before { border-left-style: solid; border-color: var(--green); }
.tl-item.now .tl-dot { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 5px var(--blue-50); }
.tl-item.now .tl-dot .ic { opacity: 1; }
.tl-item.bad .tl-dot { background: var(--red); border-color: var(--red); }
.tl-item.bad .tl-dot .ic { opacity: 1; }
.tl-title { font-weight: 600; font-size: 13.5px; color: var(--slate); }
.tl-item.done .tl-title, .tl-item.now .tl-title, .tl-item.bad .tl-title { color: var(--ink); }
.tl-sub { font-size: 12.5px; color: var(--muted); }
.tl-item.now .tl-sub { color: var(--blue); font-weight: 500; }
.tl-time { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* overlays */
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); z-index: 90; opacity: 0; transition: opacity .2s; backdrop-filter: blur(2px); }
.scrim.on { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: #fff; z-index: 91; box-shadow: var(--shadow-3); transform: translateX(100%); transition: transform .3s var(--ease); display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: #FBFAF7; }
.modal { position: fixed; left: 50%; top: 50%; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: #fff; border-radius: 18px; z-index: 91; box-shadow: var(--shadow-3); transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .25s var(--ease), opacity .2s; display: flex; flex-direction: column; }
.modal.on { transform: translate(-50%, -50%); opacity: 1; }
.modal.wide { width: min(760px, calc(100vw - 32px)); }
.modal-head { padding: 18px 20px 0; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-body { padding: 16px 20px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: #FBFAF7; border-radius: 0 0 18px 18px; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-3); animation: toast-in .3s var(--ease); pointer-events: auto; }
.toast .ic { color: #5EE0A9; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }

.menu { position: absolute; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-3); padding: 6px; min-width: 200px; z-index: 80; animation: toast-in .15s var(--ease); }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; font-size: 13.5px; text-align: left; font-weight: 500; }
.menu button:hover, .menu a:hover { background: var(--bg); }
.menu hr { border: 0; height: 1px; background: var(--line); margin: 6px 0; }

/* skeleton / fade */
.fade-in { animation: fade-in .35s var(--ease) both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* invoice document */
.doc { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 36px 40px; font-size: 13px; box-shadow: var(--shadow-2); }
.doc h2 { font-size: 22px; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.doc th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--slate); padding: 8px 10px; border-bottom: 1.5px solid var(--ink); }
.doc td { padding: 10px; border-bottom: 1px solid var(--line-2); }
.doc th.right, .doc td.right { text-align: right; }
.doc .totals { margin-left: auto; width: 280px; margin-top: 14px; }
.doc .totals div { display: flex; justify-content: space-between; padding: 5px 0; }
.doc .totals .grand { border-top: 1.5px solid var(--ink); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 15px; font-family: var(--font-head); }
.stamp { display: inline-block; border: 2px solid var(--green); color: var(--green-700); font-family: var(--font-head); font-weight: 700; letter-spacing: .1em; padding: 4px 12px; border-radius: 8px; transform: rotate(-6deg); font-size: 14px; }

.score-ring { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 14px; background: conic-gradient(var(--blue) calc(var(--s) * 1%), #E6E9F0 0); position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 4px; background: #fff; border-radius: 50%; }
.cand.top .score-ring::before { background: #F8FAFF; }
.score-ring span { position: relative; }

/* charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font-body); font-size: 11px; fill: var(--slate); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--slate); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

@media (max-width: 1100px) { .g-main, .g-main-wide, .g-2-1 { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, 1fr); } .g5, .g6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .g3, .g2 { grid-template-columns: 1fr; } .g5, .g6 { grid-template-columns: repeat(2, 1fr); } .doc { padding: 20px; } }
