/* =========================================================
   Battery Dukaan — Super Admin Web Application
   Shared design system
   ========================================================= */
:root {
  --sb-1: #06261c;
  --sb-2: #0a3a2a;
  --sb-active: #14593f;
  --green: #127a45;
  --green-600: #0f6a3b;
  --green-700: #0b5a31;
  --green-50: #eaf6ee;
  --green-100: #d5eedd;
  --navy: #101828;
  --title: #0f1a3a;
  --text: #344054;
  --muted: #667085;
  --light: #98a2b3;
  --border: #e6e9ef;
  --border-2: #eef0f4;
  --bg: #f5f7fa;
  --card: #ffffff;
  --blue: #1f73e6;
  --blue-50: #eaf2fe;
  --orange: #f59e0b;
  --orange-600: #e8840c;
  --orange-50: #fff5e6;
  --red: #e5383b;
  --red-50: #fdecec;
  --purple: #7c3aed;
  --purple-50: #f3edfe;
  --teal: #0ea5a4;
  --teal-50: #e6f7f7;
  --pink: #db2777;
  --pink-50: #fdeaf3;
  --gray-50: #f2f4f7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .04);
  --sidebar-w: 256px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--navy); }
h1, h2, h3, h4 { margin: 0; color: var(--title); }
p { margin: 0; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sb-2) 0%, var(--sb-1) 100%);
  color: #fff;
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  padding: 16px 12px;
  z-index: 20;
}
.sidebar .brand { padding: 2px 14px 18px; display: block; }
.sidebar .brand img { width: 150px; display: block; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 10px;
  font-size: 14.5px; font-weight: 500; color: #f1f5f2; white-space: nowrap;
  transition: background .15s;
}
.nav a svg.lucide { width: 22px; height: 22px; stroke-width: 1.8; }
.nav a:hover { background: rgba(255, 255, 255, .06); }
.nav a.active { background: var(--sb-active); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.help-card {
  margin-top: 12px; display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 1px solid rgba(255,255,255,.25); border-radius: 10px;
}
.help-card .t1 { font-weight: 600; font-size: 14px; }
.help-card .t2 { font-size: 13px; color: #d8e4dd; }
.help-card .chev { margin-left: auto; }

.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 76px; background: #fff; border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center; gap: 20px; padding: 0 28px;
  position: sticky; top: 0; z-index: 10;
}
.search {
  flex: 1; max-width: 760px; height: 46px; border: 1px solid var(--border); border-radius: 10px;
  display: flex; align-items: center; gap: 12px; padding: 0 16px; color: var(--muted); background: #fff;
}
.search input { border: 0; outline: 0; flex: 1; background: transparent; }
.topbar .spacer { flex: 1; }
.bell { position: relative; color: var(--navy); padding: 8px; }
.bell::after { content: ""; position: absolute; top: 6px; right: 7px; width: 9px; height: 9px; background: #ef4444; border-radius: 50%; border: 2px solid #fff; }
.topbar .divider { width: 1px; height: 34px; background: var(--border); }
.user-chip { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--navy); font-size: 15px; }
.user-chip .av { width: 44px; height: 44px; border-radius: 50%; background: var(--gray-50); display: grid; place-items: center; font-weight: 700; }

.content { padding: 22px 28px 40px; }

/* ---------- Page header ---------- */
.crumbs { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; margin-bottom: 8px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--green); }
.crumbs .sep { color: var(--light); }
.crumbs svg.lucide { width: 16px; height: 16px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
.page-head .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.back-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-weight: 500; margin-bottom: 10px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; overflow-x: auto; }
.tabs a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 16px; font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap;
  border-bottom: 3px solid transparent; border-right: 1px solid var(--border-2);
}
.tabs a:last-child { border-right: 0; }
.tabs a:hover { color: var(--green); }
.tabs a.active { color: var(--navy); font-weight: 600; border-bottom-color: var(--green); background: linear-gradient(180deg, #fff, var(--green-50)); }
.tabs a.active svg.lucide { color: var(--green); }
.tabs.left a { flex: 0 0 auto; padding: 14px 26px; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 4px; gap: 4px; }
.seg a, .seg button { border: 0; background: transparent; padding: 8px 18px; border-radius: 8px; font-weight: 500; color: var(--text); display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.seg .active { background: var(--green-50); color: var(--green-700); font-weight: 600; box-shadow: inset 0 0 0 1px var(--green-100); }
.seg.dark .active { background: var(--green-700); color: #fff; }

/* ---------- Cards / grid ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 700; color: var(--title); }
.card-title .sub, .card-sub { font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.link { color: var(--blue); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.link svg.lucide { width: 16px; height: 16px; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mb { margin-bottom: 18px; }
.mt { margin-top: 18px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.bold { font-weight: 700; color: var(--navy); }
.semi { font-weight: 600; color: var(--navy); }
.right { text-align: right; }
.center { text-align: center; }
.divider-v { width: 1px; align-self: stretch; background: var(--border); }
hr.sep { border: 0; border-top: 1px solid var(--border-2); margin: 16px 0; }

/* Tinted cards */
.tint-green { background: linear-gradient(180deg, #f2faf4, #e9f6ed); }
.tint-blue { background: linear-gradient(180deg, #f2f7fe, #e8f1fd); }
.tint-orange { background: linear-gradient(180deg, #fffaf1, #fff3e1); }
.tint-purple { background: linear-gradient(180deg, #f8f4ff, #f1eafe); }
.tint-red { background: linear-gradient(180deg, #fff6f6, #fdecec); }
.tint-teal { background: linear-gradient(180deg, #f1fbfb, #e5f6f6); }

/* ---------- Icon bubbles ---------- */
.ib { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.ib.sq { border-radius: 10px; }
.ib.sm { width: 36px; height: 36px; }
.ib.sm svg.lucide { width: 18px; height: 18px; }
.ib.lg { width: 56px; height: 56px; }
.ib.lg svg.lucide { width: 26px; height: 26px; }
.ib.xl { width: 72px; height: 72px; }
.ib.xl svg.lucide { width: 32px; height: 32px; }
.ib svg.lucide { width: 22px; height: 22px; }
.ib.green { background: var(--green-50); color: var(--green); }
.ib.blue { background: var(--blue-50); color: var(--blue); }
.ib.orange { background: var(--orange-50); color: var(--orange-600); }
.ib.red { background: var(--red-50); color: var(--red); }
.ib.purple { background: var(--purple-50); color: var(--purple); }
.ib.teal { background: var(--teal-50); color: var(--teal); }
.ib.gray { background: var(--gray-50); color: var(--text); }
.ib.solid-green { background: var(--green-700); color: #fff; }

.c-green { color: var(--green) !important; }
.c-blue { color: var(--blue) !important; }
.c-orange { color: var(--orange-600) !important; }
.c-red { color: var(--red) !important; }
.c-purple { color: var(--purple) !important; }
.c-navy { color: var(--navy) !important; }

/* ---------- Stat / KPI ---------- */
.stat { display: flex; align-items: center; gap: 14px; }
.stat .val { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat .lbl { font-size: 13px; color: var(--muted); }
.kpi { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius); }
.kpi .val { font-size: 24px; font-weight: 800; color: var(--navy); }
.kpi .lbl { font-size: 13px; color: var(--muted); }
.kpi .chev { margin-left: auto; color: var(--muted); }
.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--green); }
.trend svg.lucide { width: 14px; height: 14px; }
.trend.pill { background: #fff; border: 1px solid var(--border-2); padding: 4px 12px; border-radius: 999px; }
.big-num { font-size: 34px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; }

/* Ring / donut gauge (conic) */
/* Usage: <div class="ring" style="--p:62;--c:var(--green)"><div><div class="rv">52</div><div class="rl">Leads</div></div></div>
   Multi-colour: set --seg to a conic-gradient instead of --p/--c. Hole is transparent so it works on tinted cards. */
.ring, .donut {
  --p: 60; --c: var(--green); --t: #e8edf2; --size: 150px; --w: 14px;
  width: var(--size); height: var(--size); border-radius: 50%;
  display: grid; place-items: center; position: relative; flex-shrink: 0;
}
.ring::before, .donut::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--seg, conic-gradient(var(--c) calc(var(--p) * 1%), var(--t) 0));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--w)), #000 calc(100% - var(--w) + 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--w)), #000 calc(100% - var(--w) + 1px));
}
.ring > *, .donut > * { position: relative; text-align: center; }
.ring .rv { font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.ring .rl { font-size: 13px; color: var(--muted); }
.ring.sm { --size: 56px; --w: 6px; }
.ring.sm .rv { font-size: 12px; }
.ring.xs { --size: 40px; --w: 5px; }
.ring.xs .rv { font-size: 10px; font-weight: 700; }
.donut { --size: 170px; --w: 24px; }
.donut .rv { font-size: 26px; font-weight: 800; color: var(--navy); }
.donut .rl { font-size: 13px; color: var(--muted); }

/* Legend */
.legend { display: flex; flex-direction: column; gap: 12px; }
.legend .li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.legend .li .v { margin-left: auto; font-weight: 600; color: var(--navy); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.green { background: var(--green); } .dot.blue { background: var(--blue); } .dot.orange { background: var(--orange); }
.dot.red { background: var(--red); } .dot.purple { background: var(--purple); } .dot.gray { background: #c7cdd6; } .dot.teal { background: var(--teal); }

/* Progress bars */
.bar { height: 8px; background: #edf0f4; border-radius: 99px; overflow: hidden; flex: 1; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--green); }
.bar.thick { height: 12px; }
.bar > span.blue { background: var(--blue); } .bar > span.orange { background: var(--orange); }
.bar > span.red { background: var(--red); } .bar > span.purple { background: var(--purple); }
.bar > span.split { background: linear-gradient(90deg, var(--green) 0 86%, var(--orange) 86% 100%); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border-2); white-space: nowrap; }
.tbl th.center, .tbl td.center { text-align: center; }
.tbl th.right, .tbl td.right { text-align: right; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--border-2); color: var(--navy); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fafbfc; }
.tbl td.muted, .tbl .muted { color: var(--muted); }
.tbl .sub { font-size: 12px; color: var(--muted); }
.tbl .chev { color: var(--muted); width: 24px; }
.who { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.av { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.av.lg { width: 64px; height: 64px; font-size: 22px; }
.av.xl { width: 84px; height: 84px; font-size: 28px; }
.av.green { background: var(--green-50); color: var(--green); }
.av.blue { background: var(--blue-50); color: var(--blue); }
.av.orange { background: var(--orange-50); color: var(--orange-600); }
.av.purple { background: var(--purple-50); color: var(--purple); }
.av.pink { background: var(--pink-50); color: var(--pink); }
.av.red { background: var(--red-50); color: var(--red); }
.av.teal { background: var(--teal-50); color: var(--teal); }
.av.gray { background: var(--gray-50); color: var(--text); }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; color: var(--muted); font-size: 13px; }
.pager { display: flex; gap: 8px; align-items: center; }
.pager a, .pager span { min-width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--border); background: #fff; font-size: 13px; color: var(--navy); padding: 0 6px; }
.pager .active { background: var(--green-700); border-color: var(--green-700); color: #fff; font-weight: 600; }
.pager .gap { border: 0; background: transparent; }
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .search { height: 42px; max-width: none; }
.toolbar .grow { flex: 1; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.badge.dot { width: auto; height: auto; border-radius: 6px; }
.badge.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-50); color: #13803f; }
.badge.blue { background: var(--blue-50); color: var(--blue); }
.badge.orange { background: var(--orange-50); color: var(--orange-600); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.purple { background: var(--purple-50); color: var(--purple); }
.badge.gray { background: var(--gray-50); color: var(--muted); }
.badge.teal { background: var(--teal-50); color: var(--teal); }
.badge.pink { background: var(--pink-50); color: var(--pink); }
.badge.lg { font-size: 14px; padding: 6px 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 6px; font-size: 12.5px; background: var(--gray-50); border: 1px solid var(--border); color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; background: #fff; color: var(--navy); white-space: nowrap;
}
.btn.primary { background: var(--green-700); color: #fff; }
.btn.primary:hover { background: var(--green-600); }
.btn.outline { border-color: var(--border); background: #fff; }
.btn.outline-green { border-color: var(--green); color: var(--green-700); background: #fff; }
.btn.outline-red { border-color: var(--red); color: var(--red); background: #fff; }
.btn.ghost-blue { background: var(--blue-50); color: var(--blue); border-color: #d6e6fc; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; font-weight: 500; }
.btn.lg { height: 50px; padding: 0 28px; font-size: 15px; }
.btn.block { width: 100%; }
.view-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 6px; background: var(--blue-50); color: var(--blue); font-size: 13px; font-weight: 500; border: 1px solid #dbe8fc; }
.view-btn svg.lucide { width: 14px; height: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.form-actions .btn { min-width: 140px; height: 48px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .lbl-f { font-size: 13.5px; font-weight: 500; color: var(--text); }
.req { color: var(--red); }
.input, .select, .textarea {
  height: 44px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
  padding: 0 14px; display: flex; align-items: center; gap: 10px; width: 100%; color: var(--navy);
}
.input input, .input select { border: 0; outline: 0; flex: 1; background: transparent; height: 100%; min-width: 0; }
input.input, select.select { outline: 0; }
select.select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23344054' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 36px; }
.input.disabled, input.input:disabled { background: var(--gray-50); color: var(--muted); }
.textarea { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; outline: 0; }
.input svg.lucide { color: var(--muted); }
.input .ph, ::placeholder { color: var(--light); }
.hint { font-size: 12px; color: var(--muted); }
.fgrid { display: grid; gap: 0 18px; }
.fgrid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fgrid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fgrid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

.step-head { display: flex; align-items: center; gap: 14px; background: var(--green-50); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; font-weight: 700; color: var(--title); font-size: 16px; }
.step-num { width: 32px; height: 32px; border-radius: 7px; background: var(--green-700); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.section { margin-bottom: 18px; }
.section-head { display: flex; align-items: center; gap: 12px; background: var(--green-50); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-weight: 700; color: var(--title); font-size: 16px; }
.section-head svg.lucide { color: var(--green); }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--green-700); }
.radio-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; background: #fff; }
.radio-card.active { border-color: var(--green); background: var(--green-50); box-shadow: inset 0 0 0 1px var(--green); }
.radio-card input { accent-color: var(--green-700); width: 18px; height: 18px; }
.opt-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 13px; position: relative; background: #fff; cursor: pointer; }
.opt-card svg.lucide { width: 24px; height: 24px; color: var(--navy); }
.opt-card.active { border-color: var(--green); background: var(--green-50); box-shadow: inset 0 0 0 1px var(--green); }
.opt-card.active::after { content: "✓"; position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; background: var(--green-700); color: #fff; font-size: 11px; display: grid; place-items: center; }

.toggle { position: relative; width: 44px; height: 24px; display: inline-block; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: #cfd5dd; border-radius: 99px; transition: .2s; cursor: pointer; }
.toggle span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::before { transform: translateX(20px); }

.upload { border: 1.5px dashed #c9d2dc; border-radius: 10px; background: #fafbfc; padding: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: var(--muted); }
.upload .t { color: var(--blue); font-weight: 600; }

.tag-input { min-height: 44px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #fff; }
.tag { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-50); color: var(--blue); padding: 4px 10px; border-radius: 6px; font-size: 13px; }

/* ---------- Key-value list ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 12px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--navy); font-weight: 500; }
.kv.wide { grid-template-columns: 170px 1fr; }
.kv.sep-colon dt::after { content: ""; }
.info-item { display: flex; align-items: center; gap: 14px; }
.info-item .k { font-size: 13px; color: var(--muted); }
.info-item .v { font-size: 15px; color: var(--navy); font-weight: 500; }

/* Notes */
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; background: var(--blue-50); color: var(--text); font-size: 13.5px; align-items: flex-start; }
.note svg.lucide { color: var(--blue); }
.note.orange { background: var(--orange-50); } .note.orange svg.lucide { color: var(--orange-600); }
.note.green { background: var(--green-50); } .note.green svg.lucide { color: var(--green); }
.note.red { background: var(--red-50); } .note.red svg.lucide { color: var(--red); }

/* ---------- Stepper / timeline ---------- */
.stepper { display: flex; align-items: flex-start; position: relative; padding: 8px 0; }
.stepper .st { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; font-size: 13px; }
.stepper .st::before { content: ""; position: absolute; top: 12px; left: -50%; right: 50%; height: 2px; background: #dfe3e8; z-index: 0; }
.stepper .st:first-child::before { display: none; }
.stepper .st.done::before, .stepper .st.current::before { background: var(--green); }
.stepper .st .c { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #cfd5dd; background: #fff; display: grid; place-items: center; position: relative; z-index: 1; margin-bottom: 8px; }
.stepper .st.done .c { background: var(--green); border-color: var(--green); color: #fff; }
.stepper .st.done .c svg.lucide { width: 14px; height: 14px; stroke-width: 3; }
.stepper .st.current .c { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-100); }
.stepper .st.current .c::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--green); }
.stepper .st.current.orange .c { border-color: var(--orange); box-shadow: 0 0 0 4px #fde7c2; }
.stepper .st.current.orange .c::after { background: var(--orange); }
.stepper .st .n { font-weight: 600; color: var(--navy); }
.stepper .st .d { font-size: 12px; color: var(--muted); }
.stepper .st:not(.done):not(.current) .n { color: var(--muted); font-weight: 500; }

.timeline { display: flex; flex-direction: column; gap: 16px; }
.timeline .ti { display: flex; gap: 14px; align-items: center; font-size: 14px; }

/* Lists */
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-2); }
.list-row:last-child { border-bottom: 0; }
.list-row .chev { margin-left: auto; color: var(--muted); }

/* Status chain (dashboard today's status) */
.chain { display: flex; align-items: center; justify-content: space-around; }
.chain .node { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chain .line { flex: 1; height: 2px; max-width: 70px; background: #dbe3ec; margin-bottom: 50px; }

/* Charts (inline svg helpers) */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: inherit; font-size: 11px; fill: var(--muted); }

/* Product image */
.prod-img { width: 120px; height: 100px; object-fit: contain; }
.prod-thumb { width: 44px; height: 36px; object-fit: contain; }

/* Settings tiles */
.tile { display: flex; align-items: center; gap: 18px; padding: 22px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.tile:hover { box-shadow: 0 4px 16px rgba(16,24,40,.08); }

/* ---------- Login ---------- */
.login { display: grid; grid-template-columns: 57% 43%; min-height: 100vh; background: #fff; }
.login .hero { background: url("../img/login-hero.jpg") center / cover no-repeat; }
.login .panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: linear-gradient(180deg, #fff, #f6f8f7); }
.login .box { width: 100%; max-width: 500px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .g-4, .g-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); width: 248px; transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  .menu-btn { display: inline-flex !important; }
  .g-2, .g-3, .g-4, .g-5, .fgrid.c2, .fgrid.c3, .fgrid.c4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .user-chip .name { display: none; }
  .page-head { flex-direction: column; }
  .login { grid-template-columns: 1fr; }
  .login .hero { display: none; }
}
.menu-btn { display: none; border: 0; background: transparent; padding: 6px; color: var(--navy); }

/* Glossy product-image wells */
.prod-img, .prod-thumb { background: linear-gradient(145deg, #ffffff 0%, #f1f3f6 55%, #e6e9ee 100%); border-radius: 12px; box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(16,24,40,.06); padding: 4px; }

/* ---------- Fixed app frame ----------
   The window never scrolls: sidebar and top bar stay fixed at the same size on every
   screen, and only the content area scrolls when a page is taller than the window. */
html, body { height: 100%; overflow: hidden; }
.app { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.sidebar { height: 100vh; height: 100dvh; }
.main { height: 100vh; height: 100dvh; overflow: hidden; }
.topbar { position: relative; flex-shrink: 0; }
.content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.content::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb { background: #cfd5dd; border-radius: 10px; border: 3px solid var(--bg); }
.content::-webkit-scrollbar-track { background: transparent; }
/* Menu never scrolls: on short windows the item spacing tightens instead (design size from ~860px tall). */
.nav { overflow: hidden; gap: clamp(1px, .45vh, 4px); }
.nav a { padding-top: clamp(7px, 1.4vh, 12px); padding-bottom: clamp(7px, 1.4vh, 12px); }
.sidebar .brand { padding-bottom: clamp(8px, 2.1vh, 18px); }
.help-card { padding-top: clamp(9px, 1.6vh, 14px); padding-bottom: clamp(9px, 1.6vh, 14px); }
/* Let cards and rows compress on narrower windows instead of overflowing the content area. */
.content .grid > *, .content .row > *, .content .kpi > *, .content .stat > * { min-width: 0; }
.content .card { min-width: 0; }
.content .page-head { flex-wrap: wrap; }
.content .page-head .actions { flex-wrap: wrap; }
.content .tabs a { min-width: 0; padding-left: 10px; padding-right: 10px; }
.content img, .content svg.chart { max-width: 100%; }
/* Module tabs: no visible scrollbar; tighter on narrower windows */
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 1500px) {
  .content .tabs a { font-size: 13px; gap: 7px; padding-left: 8px; padding-right: 8px; }
  .content .tabs a svg.lucide { width: 16px; height: 16px; }
}

/* =========================================================
   Mobile / tablet layer (< 900px): sidebar becomes a slide-in drawer
   (menu button in the top bar), everything stacks to one column,
   wide tables and tab strips scroll sideways inside themselves.
   ========================================================= */
.nav-backdrop { display: none; }
@media (max-width: 900px) {
  .sidebar { z-index: 60; }
  body.nav-open .sidebar { box-shadow: 0 0 40px rgba(0,0,0,.35); }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(6,20,15,.45); z-index: 50; }
  .topbar { height: 60px; gap: 10px; padding: 0 12px; }
  .topbar .search { height: 40px; padding: 0 12px; min-width: 0; }
  .topbar .search input { min-width: 0; font-size: 14px; }
  .topbar .spacer, .topbar .divider { display: none; }
  .user-chip { gap: 4px; }
  .user-chip .av { width: 36px; height: 36px; font-size: 13px; }
  .user-chip svg.lucide { display: none; }
  .bell { padding: 4px; }

  .content { padding: 14px 14px 28px; }
  .content * { min-width: 0; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 14px; }
  .page-head h1 { font-size: 23px; }
  .page-head .sub { font-size: 13.5px; }
  .page-head .actions { justify-content: flex-start; }
  .page-head .actions > * { max-width: 100%; }
  .crumbs { font-size: 12.5px; gap: 6px; }

  /* tabs: horizontal swipe strip */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .content .tabs a { flex: 0 0 auto; padding: 12px 14px; font-size: 13px; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg a, .seg button { flex: 0 0 auto; }

  /* every grid / form grid becomes one column, even when columns are set inline */
  .content .grid, .content .fgrid { grid-template-columns: 1fr !important; }
  .content .grid > *, .content .fgrid > * { grid-column: auto !important; }
  .span-2, .span-all { grid-column: auto !important; }
  .content .row { flex-wrap: wrap; }
  .card { padding: 14px; }
  .kv, .kv.wide { grid-template-columns: minmax(96px, 40%) 1fr; }

  /* tables scroll sideways inside their card */
  table.tbl { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .table-foot { flex-direction: column; gap: 10px; align-items: flex-start; }
  .toolbar > * { flex: 1 1 100%; max-width: 100%; }

  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .stepper { overflow-x: auto; }
  .stepper .st { min-width: 72px; }
  .chain { flex-wrap: wrap; gap: 14px; }
  .chain .line { display: none; }
  .ring { --size: 130px; }
  .big-num { font-size: 26px; }
  img, svg.chart { max-width: 100%; height: auto; }
}
@media (max-width: 900px) {
  /* KPI rows: two cards per row on phones */
  .content .grid.g-4, .content .grid.g-5 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .content .grid.g-4 .ring, .content .grid.g-5 .ring { --size: 112px; --w: 10px; }
  .content .grid.g-4 .ring .rv, .content .grid.g-5 .ring .rv { font-size: 20px !important; }
  .content .grid.g-4 .ring svg.lucide, .content .grid.g-5 .ring svg.lucide { width: 22px !important; height: 22px !important; }
  /* filters: search full width, dropdowns two per row */
  .toolbar > * { flex: 1 1 calc(50% - 6px); }
  .toolbar > .search, .toolbar > .grow, .toolbar > .seg { flex-basis: 100%; }
}
@media (max-width: 360px) {
  .content .grid.g-4, .content .grid.g-5 { grid-template-columns: 1fr !important; }
}
@media (max-width: 900px) {
  /* closed drawer: no shadow bleeding onto the left edge of the page */
  .sidebar { box-shadow: none; }
  body.nav-open .sidebar { box-shadow: 0 0 40px rgba(0,0,0,.35); }
}
@media (max-width: 900px) {
  /* page titles: some pages set 34–40px inline; keep them phone-sized */
  .content .page-head h1, .content h1 { font-size: 24px !important; line-height: 1.25; }
}
@media (max-width: 900px) {
  /* stacked form buttons keep their height even if a page sets flex:1 inline */
  .form-actions .btn { flex: 0 0 auto !important; height: 50px !important; }
}
