/* TidyMate admin: deep-navy glass theme (dark by default, light on request).
   Brand: indigo #4B3BFF, violet #8B6CFF, blue #2F6BFF, navy #070B24 */
:root {
  --bg: #070b24; --bg2: #0b1033; --side: rgba(9, 13, 42, .92); --card: rgba(20, 27, 68, .72); --card2: rgba(26, 34, 84, .78);
  --text: #eef0ff; --muted: #9aa3cf; --line: rgba(120, 132, 220, .18); --line2: rgba(120, 132, 220, .28);
  --accent: #4f7bff; --accent-h: #3a63f0; --accent-soft: rgba(79, 123, 255, .16); --violet: #8b6cff;
  --ok: #22c55e; --warn: #f59e0b; --danger: #ef4444; --wa: #25D366; --input: rgba(10, 15, 48, .75);
  --radius: 18px; --glow: 0 10px 30px rgba(47, 107, 255, .35); color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef0fb; --bg2: #e6e9fa; --side: rgba(255, 255, 255, .92); --card: rgba(255, 255, 255, .9); --card2: #ffffff;
  --text: #141a3a; --muted: #5d6488; --line: rgba(40, 50, 120, .12); --line2: rgba(40, 50, 120, .2);
  --accent: #3a5cf5; --accent-h: #2f4de0; --accent-soft: rgba(58, 92, 245, .1); --input: #f6f7fe;
  --glow: 0 10px 26px rgba(58, 92, 245, .25); color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); font: 15px/1.5 "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 85% -10%, rgba(79, 123, 255, .22), transparent 60%),
              radial-gradient(900px 500px at 20% 110%, rgba(139, 108, 255, .16), transparent 60%), var(--bg); background-attachment: fixed; }
:root[data-theme="light"] body { background: radial-gradient(1200px 600px at 85% -10%, rgba(79, 123, 255, .12), transparent 60%), var(--bg); }
a { color: var(--accent); }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 18px; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0 0 12px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: Consolas, ui-monospace, monospace; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; backdrop-filter: blur(14px); }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 6px 20px; }
.brand img { width: 46px; height: 46px; border-radius: 14px !important; object-fit: cover; box-shadow: 0 8px 22px rgba(108, 80, 255, .45); }
.brand b { display: block; font-size: 20px; letter-spacing: -.01em; } .brand span { color: var(--muted); font-size: 12.5px; }
.side nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.side nav a { display: flex; align-items: center; gap: 13px; padding: 11px 14px; border-radius: 13px; color: var(--muted); text-decoration: none;
  font-weight: 500; border: 1px solid transparent; transition: background .15s, color .15s; }

.side nav a:hover { background: var(--accent-soft); color: var(--text); }
.side nav a.on { color: #fff; font-weight: 600; background: linear-gradient(135deg, #2f6bff, #5a4dff); border-color: rgba(160, 180, 255, .45);
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .18); }
.side nav a span { flex: 1; }
.nbadge { font-style: normal; font-size: 11.5px; font-weight: 700; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 99px;
  display: inline-grid; place-items: center; background: #2f6bff; color: #fff; box-shadow: 0 0 0 3px rgba(47, 107, 255, .18); }
.side nav a.on .nbadge { background: rgba(255, 255, 255, .22); box-shadow: none; }
.navhead { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); opacity: .75; padding: 14px 14px 5px; }
.who { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.who div { flex: 1; min-width: 0; } .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--muted); font-size: 12px; } .who form { margin: 0; }
.av { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #5a4dff, #2f6bff); box-shadow: 0 0 0 2px rgba(255, 255, 255, .12); }
.av.sm { width: 34px; height: 34px; font-size: 14px; }
.iconbtn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 11px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer; }
.iconbtn:hover { color: var(--text); border-color: var(--line2); }
.credit { font-size: 11px; color: var(--muted); padding: 10px 8px 0; opacity: .8; }
.content { min-width: 0; display: flex; flex-direction: column; }
main { padding: 8px 32px 36px; width: 100%; max-width: 1440px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 16px; padding: 20px 32px 18px; position: sticky; top: 0; z-index: 10;
  background: linear-gradient(var(--bg) 55%, transparent); }
.gsearch { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 48px; border-radius: 15px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted); backdrop-filter: blur(10px); }
.gsearch:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gsearch input { margin: 0; border: 0; background: transparent; padding: 0; height: 100%; outline: none !important; color: var(--text); }
kbd { font: 11px/1 inherit; color: var(--muted); border: 1px solid var(--line2); border-radius: 6px; padding: 4px 6px; white-space: nowrap; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.theme { height: 44px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; border-radius: 14px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.theme .sun { color: var(--text); } :root[data-theme="light"] .theme .sun { color: var(--muted); } :root[data-theme="light"] .theme .moon { color: var(--text); }
.chip { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px 0 6px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); }

/* ---------- surfaces ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 20px 22px; border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 12px 30px rgba(0, 0, 0, .18); backdrop-filter: blur(12px); }
:root[data-theme="light"] .card { box-shadow: 0 8px 24px rgba(30, 40, 110, .07); }
.card.flush { padding: 0; overflow-x: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat b { display: block; font-size: 28px; color: var(--text); letter-spacing: -.01em; } .stat span { color: var(--muted); font-size: 13px; }
.stats .stat:nth-child(4n+1) { background: linear-gradient(140deg, rgba(47, 107, 255, .35), var(--card) 70%); }
.stats .stat:nth-child(4n+2) { background: linear-gradient(140deg, rgba(34, 197, 94, .28), var(--card) 70%); }
.stats .stat:nth-child(4n+3) { background: linear-gradient(140deg, rgba(139, 108, 255, .34), var(--card) 70%); }
.stats .stat:nth-child(4n+4) { background: linear-gradient(140deg, rgba(245, 158, 11, .25), var(--card) 70%); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: rgba(120, 132, 220, .06); white-space: nowrap; }
tbody tr, table tr { transition: background .12s; } tr:hover td { background: rgba(120, 132, 220, .05); }
tr:last-child td { border-bottom: 0; }
tr.revoked td { opacity: .55; } tr.revoked td b::after { content: "  REVOKED"; color: var(--danger); font-size: 11px; }
.actions { white-space: nowrap; } .actions form { display: inline; } .actions .inline input { width: 120px; padding: 5px 8px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 12px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 10px 13px; font: inherit; color: var(--text);
  background: var(--input); border: 1px solid var(--line2); border-radius: 11px; }
select option { background: var(--bg2); color: var(--text); }
input[type=checkbox] { width: auto; margin: 0; display: inline; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input:disabled { opacity: .5; }
textarea.mono { font-size: 13px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; } .row > label { flex: 1; min-width: 140px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 11px; border: 1px solid var(--line2);
  background: var(--card2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(135deg, #2f6bff, #4f7bff); border-color: rgba(160, 180, 255, .5); color: #fff; box-shadow: var(--glow); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.whatsapp { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 10px; } .btn.wide { width: 100%; margin-top: 6px; justify-content: center; }
.btn.big { padding: 13px 22px; font-size: 16px; }
.btn.link { background: none; border: 0; color: var(--accent); padding: 0; cursor: pointer; font: inherit; }
.flash { padding: 12px 16px; border-radius: 13px; margin-bottom: 16px; background: var(--accent-soft); color: var(--text); border: 1px solid rgba(79, 123, 255, .35); }
.flash.ok { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .35); }
.flash.error { background: color-mix(in srgb, var(--danger) 14%, transparent); color: #ffb4b4; border-color: rgba(239, 68, 68, .4); }
:root[data-theme="light"] .flash.error { color: var(--danger); }
.bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; } .bar h1 { margin: 0; flex: 1; }
.search { display: flex; gap: 8px; } .search input { margin: 0; width: 280px; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: min(400px, 100%); text-align: center; } .login label { text-align: left; }
.avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; } .avatar.big { width: 130px; height: 130px; }
.hero { max-width: 880px; margin: 0 auto; padding: 60px 16px; text-align: center; }
.hero h1 { font-size: 40px; margin: 14px 0 6px; } .lead { font-size: 19px; color: var(--muted); }
.center-row { justify-content: center; margin: 26px 0; }
.features { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; text-align: left; }
.features li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--muted); font-size: 14px; }
.features b { display: block; color: var(--text); margin-bottom: 4px; }
[hidden] { display: none !important; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
.pill { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 1px 9px; font-size: 11px; font-weight: 600; }
.pricegrid td, .pricegrid th { padding: 6px; } .pricegrid input { margin: 0; }
.note { background: var(--accent-soft); }
textarea { resize: vertical; }
.login-bg { background: linear-gradient(rgba(7, 11, 36, .62), rgba(7, 11, 36, .62)), var(--photo) center/cover no-repeat; }
.logo-img { width: 76px; height: 76px; border-radius: 18px; }

/* ---------- page header ---------- */
.phead { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 4px 0 22px; }
.phead .pic { width: 58px; height: 58px; border-radius: 17px; display: grid; place-items: center; color: #6f9bff;
  background: var(--card); border: 1px solid var(--line); }
.phead .pic .ic { width: 30px; height: 30px; stroke-width: 2.3; }
.phead h1 { margin: 0; } .phead p { margin: 2px 0 0; color: var(--muted); }
.phead .grow { flex: 1; min-width: 200px; }
.phead form { margin: 0; }
.selectwrap { position: relative; display: inline-flex; align-items: center; }
.selectwrap .ic { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.selectwrap select { margin: 0; height: 48px; padding: 0 40px 0 44px; border-radius: 14px; font-weight: 600; appearance: none; cursor: pointer;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239aa3cf' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
.btn.tall { height: 48px; padding: 0 22px; border-radius: 14px; }

/* ---------- KPI cards ---------- */
.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.55fr); gap: 18px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; border-radius: 20px; padding: 22px 22px 20px; min-height: 196px; color: #fff;
  border: 1px solid rgba(255, 255, 255, .16); display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .2); }
.kpi.blue { background: linear-gradient(145deg, #2f6bff 0%, #1d3fd6 55%, #142c9e 100%); }
.kpi.green { background: linear-gradient(145deg, #12b76a 0%, #08875a 55%, #075e45 100%); }
.kpi.purple { background: linear-gradient(145deg, #8b5cf6 0%, #6d3fe0 55%, #4b23ad 100%); }
.kpi svg.wave { position: absolute; right: -8px; top: 26px; width: 70%; height: 90px; opacity: .55; }
.kpi .kic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3); position: relative; }
.kpi .kic .ic { width: 26px; height: 26px; stroke-width: 2.2; }
.kpi .kv { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; position: relative; margin-top: 18px; }
.kpi .kv b { font-size: 34px; line-height: 1.1; letter-spacing: -.02em; word-break: break-all; }
.kpi .kl { opacity: .88; font-size: 15px; position: relative; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; color: #b7ffcf; }
.delta .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.delta.down { color: #ffd0d0; } .delta.flat { color: rgba(255, 255, 255, .75); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18); min-width: 0; }
:root[data-theme="light"] .panel { box-shadow: 0 8px 24px rgba(30, 40, 110, .07); }
.panel h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 17px; }
.panel h3 .ic { color: #6f9bff; }
.panel .ph { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; } .panel .ph h3 { flex: 1; }
.panel .ph .tag { font-size: 12.5px; color: var(--muted); border: 1px solid var(--line2); border-radius: 10px; padding: 5px 10px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .ln { fill: none; stroke: #4f8bff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 4px 10px rgba(79, 139, 255, .55)); }
.chart .dot { fill: #fff; stroke: #4f8bff; stroke-width: 3; }
.chart .hit { fill: transparent; cursor: default; }
.chart g.pt:hover .dot { r: 7; }
.chart .bub { opacity: 0; transition: opacity .12s; pointer-events: none; }
.chart g.pt:hover .bub { opacity: 1; }
.chart .bub rect { fill: var(--bg2); stroke: var(--line2); }
.chart .bub text { fill: var(--text); font-size: 11.5px; font-weight: 600; }
.empty-chart { display: grid; place-items: center; height: 160px; color: var(--muted); font-size: 14px; }

/* ---------- orders table area ---------- */
.lower { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.tablecard { padding: 0; overflow: hidden; }
.tablehead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; }
.tablehead h3 { flex: 1; min-width: 150px; }
.tabs { display: inline-flex; flex-direction: row; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 8px 16px; border-radius: 99px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 14px;
  background: var(--card2); border: 1px solid var(--line); }
.tabs a:hover { border-color: var(--line2); }
.tabs a.on { background: linear-gradient(135deg, #2f6bff, #4f7bff); color: #fff; border-color: transparent; box-shadow: var(--glow); }
.tabs a em { font-style: normal; opacity: .75; font-weight: 500; margin-left: 4px; }
.tsearch { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px; background: var(--input);
  border: 1px solid var(--line2); color: var(--muted); min-width: 230px; }
.tsearch input { margin: 0; border: 0; background: transparent; padding: 0; outline: none !important; }
.otable { overflow-x: auto; }
.otable table { min-width: 860px; }
.otable td { font-size: 14px; }
.otable .oid { white-space: nowrap; font-size: 13.5px; } .otable .nw { white-space: nowrap; }
.cust { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cust b { display: block; } .cust small { color: var(--muted); font-size: 12.5px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.badge .ic { width: 14px; height: 14px; stroke-width: 2.8; }
.badge.paid { background: rgba(34, 197, 94, .16); color: #4ade80; border: 1px solid rgba(34, 197, 94, .45); box-shadow: 0 0 14px rgba(34, 197, 94, .25); }
.badge.pending { background: rgba(245, 158, 11, .16); color: #fbbf24; border: 1px solid rgba(245, 158, 11, .45); }
.badge.failed { background: rgba(239, 68, 68, .14); color: #f87171; border: 1px solid rgba(239, 68, 68, .4); }
:root[data-theme="light"] .badge.paid { color: #15803d; } :root[data-theme="light"] .badge.pending { color: #b45309; } :root[data-theme="light"] .badge.failed { color: #b91c1c; }
.sent { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-size: 13.5px; } .sent .ic { width: 15px; height: 15px; color: var(--ok); stroke-width: 2.6; }
.sent.bad { color: var(--danger); }
details.menu { position: relative; display: inline-block; }
details.menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 11px;
  background: var(--card2); border: 1px solid var(--line2); font-weight: 600; font-size: 13.5px; }
details.menu summary::-webkit-details-marker { display: none; }
details.menu summary .ic { width: 15px; height: 15px; }
details.menu .mlist { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; padding: 6px; border-radius: 14px;
  background: var(--bg2); border: 1px solid var(--line2); box-shadow: 0 18px 40px rgba(0, 0, 0, .4); display: flex; flex-direction: column; gap: 2px; }
details.menu .mlist a, details.menu .mlist button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 10px; border: 0;
  background: none; color: var(--text); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; }
details.menu .mlist a:hover, details.menu .mlist button:hover { background: var(--accent-soft); }
details.menu .mlist form { display: block; margin: 0; }
.tfoot { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.tfoot .pager { margin-left: auto; display: flex; gap: 6px; }
.pager a, .pager span { min-width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; text-decoration: none;
  color: var(--text); background: var(--card2); border: 1px solid var(--line); font-weight: 600; font-size: 14px; padding: 0 6px; }
.pager .on { background: #2f6bff; color: #fff; border-color: transparent; box-shadow: var(--glow); }
.pager .off { opacity: .4; }
.hint { font-size: 13px; color: var(--muted); margin: 12px 2px 0; }

/* ---------- sales report ---------- */
.report .big { font-size: 34px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.report .big .rate { font-size: 12.5px; padding: 3px 9px; border-radius: 99px; background: rgba(34, 197, 94, .16); color: #4ade80; border: 1px solid rgba(34, 197, 94, .4); }
.report .sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 96px; margin-bottom: 16px; }
.bars i { flex: 1; min-height: 4px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #4f8bff, #5a4dff); box-shadow: 0 6px 14px rgba(79, 123, 255, .3); }
.bars i.zero { background: var(--line2); box-shadow: none; }
.legend { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; font-size: 14px; }
.legend li { display: flex; align-items: center; gap: 10px; } .legend b { min-width: 18px; }
.legend .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.legend .dot .ic { width: 13px; height: 13px; stroke-width: 3; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--danger); }

/* ---------- mobile ---------- */
.mbar { display: none; }
.menu-btn { width: 44px; height: 44px; border: 1px solid var(--line2); border-radius: 12px; background: var(--card); cursor: pointer;
  padding: 0; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.menu-btn span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--text); transition: transform .2s, opacity .2s; }
.nav-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .menu-btn span:nth-child(2) { opacity: 0; }
.nav-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.scrim { display: none; }
@media (max-width: 1280px) {
  .dash { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dash .overview { grid-column: 1 / -1; }
}
@media (max-width: 1100px) { .lower { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .dash { grid-template-columns: 1fr; } .kpi { min-height: 160px; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .mbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 10px 16px;
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .mbar .brand { padding: 0; flex: 1; } .mbar .brand img { width: 36px; height: 36px; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: min(290px, 86vw); height: 100%;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .5); background: var(--bg2); }
  .nav-open .side { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(3, 6, 22, .6); }
  .topbar { position: static; padding: 14px 16px 6px; background: none; }
  .gsearch kbd, .chip b { display: none; } .chip { padding: 0 6px; }
  main { padding: 8px 16px 28px; }
  .grid2 { grid-template-columns: 1fr; } .search input { width: 100%; }
  h1 { font-size: 25px; }
  .phead .pic { width: 48px; height: 48px; }
  .phead > form, .phead > a { flex: 1; } .selectwrap, .selectwrap select { width: 100%; } .phead .btn.tall { width: 100%; justify-content: center; }
  .tsearch { min-width: 0; width: 100%; }
  .kpi .kv b { font-size: 30px; }
  .phead > form { flex: 1 1 140px; } .phead > a.btn { flex: 1 1 160px; }
  /* orders table becomes one card per order */
  .otable table { min-width: 0; } .otable tr.thead { display: none; }
  .otable tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "cust st" "id amt" "date act";
    gap: 6px 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .otable td { display: block; padding: 0; border: 0; background: none !important; }
  .otable .c-n, .otable .c-plan, .otable .c-mail { display: none; }
  .otable .c-cust { grid-area: cust; min-width: 0; } .otable .c-st { grid-area: st; text-align: right; }
  .otable .c-id { grid-area: id; color: var(--muted); } .otable .c-amt { grid-area: amt; text-align: right; } .otable .c-amt br, .otable .c-amt small { display: none; }
  .otable .c-date { grid-area: date; color: var(--muted); align-self: center; } .otable .c-date br { display: none; } .otable .c-date span::before { content: " "; }
  .otable .c-act { grid-area: act; text-align: right; }
  .cust small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52vw; }
  .tfoot { flex-wrap: wrap; } .tfoot .pager { margin-left: 0; }
}

/* ---------- reports ---------- */
.rgrid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.mbars { display: flex; align-items: flex-end; gap: 10px; height: 230px; padding-top: 12px; }
.mcol { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.mcol i { width: 100%; max-width: 42px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #4f8bff, #5a4dff);
  box-shadow: 0 8px 18px rgba(79, 123, 255, .3); }
.mcol i.zero { background: var(--line2); box-shadow: none; }
.mval { font-size: 11.5px; font-weight: 700; color: var(--text); white-space: nowrap; min-height: 16px; }
.mlab { font-size: 12px; color: var(--muted); }
.share { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 4px; }
.share i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2f6bff, #8b5cf6); }
@media (max-width: 1000px) { .rgrid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .mbars { gap: 4px; height: 190px; } .mval { display: none; } }
