/* FORGELINK design system: white surfaces, deep navy structure, subtle teal accents */
:root {
  --navy-950: #071428;
  --navy-900: #0a1a33;
  --navy-800: #0b1f3a;
  --navy-700: #14325c;
  --navy-600: #1e4a80;
  --navy-100: #e6ecf5;
  --navy-50: #f1f5fa;
  --teal-600: #0b8582;
  --teal-500: #0f9d9a;
  --teal-100: #d5efee;
  --teal-50: #ebf7f6;
  --ink: #0f1b2d;
  --ink-2: #2b3a52;
  --muted: #5b6b82;
  --faint: #8493a8;
  --line: #e3e8f0;
  --line-2: #d0d8e4;
  --bg: #f9fafc;
  --white: #fff;
  --red: #c0392b; --red-bg: #fdecea;
  --amber: #a15c07; --amber-bg: #fdf3e0;
  --green: #1d7a46; --green-bg: #e4f5ea;
  --blue: #1d5fa8; --blue-bg: #e7f0fb;
  --violet: #5b3fa6; --violet-bg: #efeafb;
  --grey: #55657c; --grey-bg: #eef1f6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(10, 26, 51, .05), 0 1px 3px rgba(10, 26, 51, .04);
  --shadow-lg: 0 18px 50px rgba(7, 20, 40, .28);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar: 252px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; color: var(--navy-800); letter-spacing: -.01em; }
a { color: var(--teal-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .strong { font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.right { text-align: right; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--teal-500); outline-offset: 2px; }

/* ---------- boot / spinner ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; }
.boot-mark { font-weight: 800; letter-spacing: .22em; color: var(--navy-800); font-size: 22px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--teal-100); border-top-color: var(--teal-500); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { display: grid; gap: 14px; }
.sk { height: 18px; border-radius: 6px; background: linear-gradient(90deg, var(--navy-50) 25%, #e9eef6 37%, var(--navy-50) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
.sk.lg { height: 90px; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- brand ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .2em; font-size: 19px; color: #fff; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: #fff; display: grid; place-items: center; position: relative; }
.logo-mark svg { width: 20px; height: 20px; }
.logo-mark::after { content: ""; position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--teal-500); border: 2px solid var(--navy-900); }
.logo.dark { color: var(--navy-800); } .logo.dark .logo-mark { background: var(--navy-800); } .logo.dark .logo-mark::after { border-color: #fff; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 5fr) 6fr; }
.auth-brand { background: radial-gradient(1200px 500px at -10% -10%, #17406f 0%, transparent 60%), linear-gradient(160deg, var(--navy-800), var(--navy-950)); color: #cfdaea; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; width: 520px; height: 520px; right: -220px; bottom: -220px; border-radius: 50%; border: 70px solid rgba(15, 157, 154, .13); }
.auth-brand h2 { color: #fff; font-size: 34px; line-height: 1.15; max-width: 440px; margin: 56px 0 14px; letter-spacing: -.02em; }
.auth-brand h2 em { font-style: normal; color: #5fd3cf; }
.auth-brand p { max-width: 430px; line-height: 1.6; margin: 0 0 30px; }
.value-list { display: grid; gap: 16px; max-width: 440px; position: relative; z-index: 1; }
.value-list div { display: flex; gap: 12px; align-items: flex-start; }
.value-list svg { flex: none; width: 20px; height: 20px; color: #5fd3cf; margin-top: 2px; }
.value-list b { color: #fff; display: block; font-weight: 600; }
.auth-foot { font-size: 12px; color: #8ea3bf; position: relative; z-index: 1; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; background: #fff; }
.auth-card { width: 100%; max-width: 480px; }
.auth-card h1 { font-size: 26px; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); margin: 0 0 22px; }
.auth-mobile-logo { display: none; margin-bottom: 22px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--navy-50); border-radius: 10px; margin-bottom: 22px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--muted); }
.tabs button[aria-selected="true"] { background: #fff; color: var(--navy-800); box-shadow: var(--shadow); }
.demo-box { margin-top: 24px; border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 14px 16px; background: var(--bg); }
.demo-box h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 8px; }
.demo-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.demo-row:first-of-type { border-top: 0; }
.demo-row button { border: 1px solid var(--line-2); background: #fff; color: var(--navy-700); border-radius: 7px; padding: 4px 10px; font-weight: 600; cursor: pointer; font-size: 12px; }
.demo-row button:hover { border-color: var(--teal-500); color: var(--teal-600); }

/* ---------- forms ---------- */
.field { display: grid; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.req { color: var(--red); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
textarea { resize: vertical; min-height: 74px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(15, 157, 154, .16); }
input[readonly], input:disabled, select:disabled { background: var(--navy-50); color: var(--muted); }
input[type=checkbox], input[type=radio] { accent-color: var(--teal-600); width: 16px; height: 16px; flex: none; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 14px; }
.form-error { display: none; background: var(--red-bg); color: var(--red); border: 1px solid #f3c6c1; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-weight: 500; }
.form-error.show { display: block; }
.input-group { display: flex; } .input-group > input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > span { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-left: 0; border-radius: 0 8px 8px 0; background: var(--navy-50); color: var(--muted); font-weight: 600; }
.file-drop { border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 16px; background: var(--bg); display: grid; gap: 8px; }
.file-list { display: grid; gap: 4px; font-size: 13px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 9px 16px; font-weight: 600; cursor: pointer; background: var(--navy-800); color: #fff; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--navy-700); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.teal { background: var(--teal-500); } .btn.teal:hover { background: var(--teal-600); }
.btn.ghost { background: #fff; color: var(--navy-800); border-color: var(--line-2); } .btn.ghost:hover { background: var(--navy-50); color: var(--navy-800); }
.btn.danger { background: #fff; color: var(--red); border-color: #efc2bd; } .btn.danger:hover { background: var(--red-bg); color: var(--red); }
.btn.sm { padding: 6px 11px; font-size: 13px; } .btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn .spin { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.ghost .spin, .btn.danger .spin { border-color: var(--line-2); border-top-color: var(--navy-700); }
.icon-btn { border: 0; background: transparent; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.icon-btn:hover { background: var(--navy-50); color: var(--navy-800); } .icon-btn svg { width: 18px; height: 18px; }
.link-btn { border: 0; background: none; color: var(--teal-600); font-weight: 600; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; } .link-btn.danger { color: var(--red); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--navy-900), var(--navy-950)); color: #b6c4d9; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.side-top { padding: 22px 20px 14px; }
.portal-chip { margin: 14px 0 0; display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #5fd3cf; background: rgba(15, 157, 154, .12); border: 1px solid rgba(95, 211, 207, .25); padding: 4px 10px; border-radius: 999px; }
.nav { padding: 8px 12px; display: grid; gap: 2px; overflow-y: auto; flex: 1; align-content: start; }
.nav-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #6f84a3; padding: 14px 10px 6px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; color: #b6c4d9; font-weight: 500; text-decoration: none; position: relative; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, .1); color: #fff; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal-500); }
.nav .count { margin-left: auto; background: var(--teal-500); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.side-foot { padding: 14px 18px 18px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12px; color: #7f93b0; }
.side-foot b { color: #dbe5f3; display: block; font-size: 13px; font-weight: 600; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.topbar { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar .ctx { font-weight: 600; color: var(--navy-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .ctx span { color: var(--muted); font-weight: 500; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--navy-800); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.user-btn .nm { font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.dropdown .who { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dropdown button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 12px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: left; font-weight: 500; }
.dropdown button:hover { background: var(--navy-50); } .dropdown svg { width: 16px; height: 16px; color: var(--muted); }
main#main { padding: 28px; max-width: 1360px; width: 100%; margin: 0 auto; flex: 1; }
.backdrop { display: none; }
.banner { padding: 11px 28px; font-weight: 500; display: flex; gap: 10px; align-items: center; }
.banner.warn { background: var(--amber-bg); color: var(--amber); border-bottom: 1px solid #f0dcb4; }
.banner.bad { background: var(--red-bg); color: var(--red); border-bottom: 1px solid #f3c6c1; }
.banner svg { width: 18px; height: 18px; flex: none; }

/* ---------- page structure ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; } .page-head .sub { color: var(--muted); margin-top: 3px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: inline-flex; gap: 6px; align-items: center; }
.crumb svg { width: 14px; height: 14px; }
.grid { display: grid; gap: 18px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: grid; gap: 18px; align-content: start; grid-template-columns: minmax(0, 1fr); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h3 { font-size: 15px; } .card-body { padding: 20px; } .card-body.flush { padding: 0; }
.card.accent { border-top: 3px solid var(--teal-500); }
.kpi { padding: 18px 20px; display: grid; gap: 4px; position: relative; }
.kpi .lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi .val { font-size: 26px; font-weight: 700; color: var(--navy-800); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12.5px; color: var(--muted); }
.kpi.tone-teal::before, .kpi.tone-amber::before, .kpi.tone-red::before, .kpi.tone-navy::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; }
.kpi.tone-teal::before { background: var(--teal-500); } .kpi.tone-amber::before { background: #e0a030; } .kpi.tone-red::before { background: var(--red); } .kpi.tone-navy::before { background: var(--navy-600); }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 9px 14px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 500; } .kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.empty svg { width: 34px; height: 34px; color: var(--line-2); } .empty b { color: var(--ink-2); }
.notice { padding: 12px 14px; border-radius: 8px; background: var(--teal-50); border: 1px solid var(--teal-100); color: #0a5f5d; display: flex; gap: 10px; align-items: flex-start; }
.notice.warn { background: var(--amber-bg); border-color: #f0dcb4; color: var(--amber); } .notice.bad { background: var(--red-bg); border-color: #f3c6c1; color: var(--red); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.toolbar input, .toolbar select { width: auto; min-width: 150px; } .toolbar .grow { flex: 1; min-width: 180px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 11px 16px; background: var(--bg); border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tr[data-href] { cursor: pointer; } .t tr[data-href]:hover td { background: var(--teal-50); }
.t .sub { display: block; font-size: 12px; color: var(--muted); }
.t tfoot td { background: var(--bg); font-weight: 600; }
.t input, .t select { padding: 7px 9px; }
.t td.pick { background: var(--teal-50); }
.totals { display: grid; gap: 6px; margin-left: auto; width: min(100%, 340px); }
.totals div { display: flex; justify-content: space-between; gap: 18px; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 2px solid var(--teal-500); padding-top: 10px; margin-top: 4px; font-size: 17px; font-weight: 700; color: var(--navy-800); }
.totals .internal { color: var(--amber); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.b-blue { background: var(--blue-bg); color: var(--blue); } .b-amber { background: var(--amber-bg); color: var(--amber); } .b-green { background: var(--green-bg); color: var(--green); }
.b-red { background: var(--red-bg); color: var(--red); } .b-grey { background: var(--grey-bg); color: var(--grey); } .b-teal { background: var(--teal-50); color: var(--teal-600); } .b-violet { background: var(--violet-bg); color: var(--violet); }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 6px; background: var(--navy-50); color: var(--navy-700); font-weight: 600; margin: 1px 4px 1px 0; }
.tag.urgent { background: var(--red-bg); color: var(--red); }

/* ---------- stepper & timeline ---------- */
.stepper { display: flex; gap: 0; margin: 4px 0; overflow-x: auto; padding-bottom: 4px; }
.step { flex: 1; min-width: 92px; text-align: center; position: relative; font-size: 12px; color: var(--faint); font-weight: 600; }
.step::before { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--line-2); z-index: 0; }
.step:first-child::before { display: none; }
.step i { display: block; width: 24px; height: 24px; border-radius: 50%; margin: 0 auto 6px; background: #fff; border: 2px solid var(--line-2); position: relative; z-index: 1; font-style: normal; display: grid; place-items: center; font-size: 11px; }
.step.done { color: var(--ink-2); } .step.done::before, .step.now::before { background: var(--teal-500); }
.step.done i { background: var(--teal-500); border-color: var(--teal-500); color: #fff; }
.step.now { color: var(--navy-800); } .step.now i { border-color: var(--teal-500); box-shadow: 0 0 0 4px rgba(15, 157, 154, .16); color: var(--teal-600); }
.step.stopped i { border-color: var(--red); color: var(--red); } .step.stopped { color: var(--red); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; } .timeline li:last-child { padding-bottom: 0; }
.timeline .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--teal-500); margin-top: 4px; box-shadow: 0 0 0 3px var(--teal-50); }
.timeline .when { font-size: 12px; color: var(--muted); }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; } .chart text { font: 11px var(--font); fill: var(--muted); } .chart .gl { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bar-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 100px; align-items: center; gap: 12px; padding: 6px 0; font-size: 13px; }
.bar-track { height: 10px; border-radius: 999px; background: var(--navy-50); overflow: hidden; } .bar-fill { height: 100%; border-radius: 999px; background: var(--teal-500); }
.pipe { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pipe a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; color: inherit; text-decoration: none; background: #fff; }
.pipe a:hover { border-color: var(--teal-500); background: var(--teal-50); } .pipe b { display: block; font-size: 22px; color: var(--navy-800); line-height: 1.1; } .pipe span { font-size: 12.5px; color: var(--muted); }
.queue { list-style: none; margin: 0; padding: 0; } .queue li a { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.queue li:last-child a { border-bottom: 0; } .queue li a:hover { background: var(--teal-50); }
.queue li a svg { width: 16px; height: 16px; }
.queue .pip { width: 8px; height: 8px; border-radius: 50%; } .pip.red { background: var(--red); } .pip.amber { background: #e0a030; } .pip.teal { background: var(--teal-500); } .pip.blue { background: var(--blue); }

/* ---------- compare matrix / builder ---------- */
.matrix th, .matrix td { vertical-align: top; }
.opt { display: grid; gap: 3px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; background: #fff; min-width: 150px; }
.opt:hover { border-color: var(--teal-500); } .opt.sel { border-color: var(--teal-500); background: var(--teal-50); } .opt.best .price::after { content: "Lowest"; margin-left: 8px; font-size: 10.5px; font-weight: 700; color: var(--teal-600); text-transform: uppercase; letter-spacing: .05em; }
.opt.na { opacity: .5; cursor: not-allowed; background: var(--bg); } .opt .price { font-weight: 700; font-variant-numeric: tabular-nums; } .opt label { display: flex; gap: 8px; align-items: center; cursor: inherit; }
.sticky-summary { position: sticky; top: 76px; }

/* ---------- modal & toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(7, 20, 40, .55); display: grid; place-items: center; padding: 20px; z-index: 100; animation: fade .15s ease; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); animation: pop .18s ease; margin: auto; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); } .modal-head h3 { font-size: 17px; }
.modal-body { padding: 22px; } .modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: var(--bg); border-radius: 0 0 14px 14px; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 200; }
.toast { background: var(--navy-800); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); max-width: 380px; display: flex; gap: 10px; align-items: flex-start; animation: pop .2s ease; }
.toast.err { background: #7a1f16; } .toast.ok svg { color: #5fd3cf; } .toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) { .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: minmax(0, 1fr); } .sticky-summary { position: static; } }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 276px; transform: translateX(-100%); transition: transform .22s ease; }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(7, 20, 40, .5); z-index: 35; }
  .menu-btn { display: grid; } .topbar { padding: 0 14px; } main#main { padding: 20px 16px; } .banner { padding: 11px 16px; }
  .auth { grid-template-columns: minmax(0, 1fr); } .auth-brand { display: none; } .auth-mobile-logo { display: block; }
  .g3, .g2 { grid-template-columns: minmax(0, 1fr); } .row.three, .row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .g5, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .row, .row.three, .row.four { grid-template-columns: minmax(0, 1fr); }
  .kpi { padding: 14px 16px; } .kpi .val { font-size: 21px; } .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dt { margin-top: 8px; }
  .user-btn .nm { display: none; } .user-btn { padding: 4px; } .page-head h1 { font-size: 21px; } .card-body { padding: 16px; }
  .bar-row { grid-template-columns: 78px minmax(0, 1fr) 84px; } .toasts { left: 14px; right: 14px; } .toast { max-width: none; }
  .modal-body { padding: 18px; } .t th, .t td { padding: 10px 12px; }
}
@media print { .sidebar, .topbar, .banner, .toasts, .page-head .actions, .btn { display: none !important; } .shell { display: block; } main#main { padding: 0; } }
