:root {
  --green: #00a36c;
  --green-600: #008458;
  --green-700: #006b47;
  --green-50: #ecfdf5;
  --blue: #3b82f6;   --blue-50: #eff6ff;
  --violet: #8b5cf6; --violet-50: #f5f3ff;
  --amber: #f59e0b;  --amber-50: #fffbeb;
  --red: #ef4444;    --red-50: #fef2f2;
  --ink: #0b1220;
  --ink-2: #344054;
  --muted: #667085;
  --line: #eaecf0;
  --line-2: #f2f4f7;
  --bg: #f7f8fa;
  --card: #fff;
  --side: #07130e;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .03);
  --shadow-lg: 0 12px 32px -12px rgba(16, 24, 40, .18);
  --side-w: 248px;
  --top-h: 68px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--green-600); text-decoration: none; }
a:hover { color: var(--green-700); }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.02em; color: var(--ink); }
h1 { font-size: 1.75rem; margin: 0 0 .25rem; line-height: 1.2; font-weight: 800; }
h2 { font-size: 1.02rem; margin: 0; font-weight: 700; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
h3 { font-size: .92rem; margin: 1.3rem 0 .6rem; }
code, .code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .76rem; color: var(--muted); letter-spacing: .02em; }
.muted { color: var(--muted); }
.small, small { font-size: .8rem; }
.empty { padding: 1.5rem 0; text-align: center; margin: 0; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ── Shell ─────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 20;
  display: flex; flex-direction: column; padding: 1.2rem .9rem;
  background: radial-gradient(120% 60% at 0% 0%, #0f3a28 0%, transparent 60%), var(--side);
  color: #cfe0d8;
}
.brand { display: flex; align-items: center; gap: .7rem; padding: .2rem .5rem 1.4rem; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, #34d399, #00a36c 55%, #047857); color: #fff;
  font-family: var(--font-head); font-weight: 800; font-size: .85rem;
  box-shadow: 0 6px 16px -6px rgba(16, 185, 129, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand-text { font-family: var(--font-head); font-weight: 800; font-size: 1rem; line-height: 1.15; }
.brand-text small { display: block; font-family: var(--font); font-weight: 500; font-size: .72rem; color: #7fa493; letter-spacing: .02em; }
.nav-label { display: block; padding: 0 .75rem .5rem; font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #5f8574; }
.sidenav { display: flex; flex-direction: column; gap: .2rem; }
.sidenav a {
  display: flex; align-items: center; gap: .75rem; padding: .65rem .75rem; border-radius: 11px;
  color: #b7cdc3; font-weight: 500; transition: background .15s, color .15s;
}
.sidenav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidenav a.on { background: rgba(52, 211, 153, .14); color: #fff; box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .18); }
.sidenav a.on .icon { color: #34d399; }
.sidenav a span:first-of-type { flex: 1; }
.count { background: #34d399; color: #04261a; border-radius: 99px; padding: 0 .5rem; font-size: .7rem; font-weight: 700; line-height: 1.5; }
.side-user {
  margin-top: auto; display: flex; align-items: center; gap: .65rem; padding: .7rem;
  border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .06);
}
.side-user-text { flex: 1; min-width: 0; line-height: 1.25; }
.side-user-text strong { display: block; color: #fff; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text small { color: #7fa493; font-size: .74rem; }
.side-user form { margin: 0; }
.side-user-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: .65rem; margin: -.3rem; padding: .3rem; border-radius: 10px; color: inherit; }
.side-user-link:hover, .side-user-link.on { background: rgba(255, 255, 255, .07); color: inherit; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: #b7cdc3; cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.shell { margin-left: var(--side-w); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 10; height: var(--top-h);
  display: flex; align-items: center; gap: 1rem; padding: 0 2rem;
  background: rgba(247, 248, 250, .82); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(234, 236, 240, .8);
}
.topsearch { position: relative; flex: 1; max-width: 520px; }
.topsearch .icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topsearch input[type=search] { width: 100%; padding: .65rem 1rem .65rem 2.6rem; border-radius: 12px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.topmeta { margin-left: auto; display: flex; align-items: center; gap: .45rem; font-size: .82rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(0, 163, 108, .15); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(0, 163, 108, 0); } }

.main { padding: 2rem; max-width: 1480px; }
.no-nav .main { max-width: none; min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(60% 50% at 50% 0%, rgba(0, 163, 108, .12), transparent 70%), var(--bg); }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.page-head p { margin: 0; }
.eyebrow { font-size: .72rem !important; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--green-600); margin-bottom: .35rem !important; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.crumbs { margin: 0 0 .3rem !important; font-size: .8rem; color: var(--muted); }
.shop-head { align-items: center; justify-content: flex-start; }
.shop-head-text { flex: 1; min-width: 260px; }
.shop-head h1 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* ── Cards & grids ─────────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.card.flush { padding: 0; overflow: hidden; }
.card > h2 { margin-bottom: 1rem; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.card-head p { margin: .15rem 0 0; }
.card-head.padded { padding: 1.35rem 1.4rem 0; margin-bottom: .6rem; }
.card-head > .icon { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-3-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.25rem; }
.stack-cards { display: flex; flex-direction: column; }
.more { margin-left: auto; font-size: .8rem; font-weight: 600; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.more .icon { width: 14px; height: 14px; }
.legend { text-align: right; line-height: 1.1; }
.legend .big { display: block; font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; }

/* ── Stats ─────────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-5 .hero { grid-column: 1 / -1; }
@media (min-width: 1320px) {
  .stats-5 { grid-template-columns: 1.25fr repeat(4, minmax(0, 1fr)); }
  .stats-5 .hero { grid-column: auto; }
}
.stat { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); overflow: hidden; }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 500; }
.stat-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--line-2); color: var(--ink-2); }
.stat-value { font-family: var(--font-head); font-size: 1.75rem; font-weight: 800; margin: .45rem 0 .15rem; letter-spacing: -.03em; line-height: 1.15; }
.stat-value small { font-size: .95rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.stat-sub { color: var(--muted); font-size: .78rem; display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.tone-green .stat-icon { background: var(--green-50); color: var(--green-600); }
.tone-blue .stat-icon { background: var(--blue-50); color: var(--blue); }
.tone-violet .stat-icon { background: var(--violet-50); color: var(--violet); }
.tone-amber .stat-icon { background: var(--amber-50); color: #d97706; }
.stat.tone-warn { border-color: #fde7c2; }
.stat.tone-warn .stat-icon { background: var(--amber-50); color: #d97706; }
.stat.tone-bad { border-color: #fecaca; background: linear-gradient(180deg, #fff, #fff8f8); }
.stat.tone-ok { border-color: #bbf7d0; }
.stat.hero { border: 0; color: #fff; background: radial-gradient(120% 120% at 100% 0%, #34d399 0%, transparent 50%), linear-gradient(135deg, #047857, #065f46 60%, #064e3b); box-shadow: 0 16px 32px -16px rgba(4, 120, 87, .6); }
.stat.hero .stat-label, .stat.hero .stat-sub { color: rgba(255, 255, 255, .78); }
.stat.hero .stat-icon { background: rgba(255, 255, 255, .15); color: #fff; }
.stat.hero .stat-value { font-size: 2.1rem; }
.trend { display: inline-flex; align-items: center; gap: .2rem; padding: .05rem .5rem; border-radius: 99px; font-weight: 600; font-size: .74rem; }
.trend.up { background: rgba(255, 255, 255, .18); color: #fff; }
.trend.down { background: rgba(0, 0, 0, .15); color: #fff; }

/* ── Charts ────────────────────────────────────────────────────────────── */
.chart-wrap { position: relative; }
.chart-max { position: absolute; top: -2px; left: 0; font-size: .7rem; color: var(--muted); }
.chart { width: 100%; height: 190px; display: block; overflow: visible; }
.chart .gridlines line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.chart .line { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: rgba(16, 24, 40, .04); }
.chart-green .line { stroke: var(--green); }
.chart-green .stop-a { stop-color: var(--green); stop-opacity: .28; }
.chart-green .stop-b { stop-color: var(--green); stop-opacity: 0; }
.chart-blue .line { stroke: var(--blue); }
.chart-blue .stop-a { stop-color: var(--blue); stop-opacity: .25; }
.chart-blue .stop-b { stop-color: var(--blue); stop-opacity: 0; }
.chart-violet .line { stroke: var(--violet); }
.chart-violet .stop-a { stop-color: var(--violet); stop-opacity: .25; }
.chart-violet .stop-b { stop-color: var(--violet); stop-opacity: 0; }
.chart-amber .line { stroke: var(--amber); }
.chart-amber .stop-a { stop-color: var(--amber); stop-opacity: .25; }
.chart-amber .stop-b { stop-color: var(--amber); stop-opacity: 0; }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; margin-top: .5rem; }

/* ── Funnel & bars ─────────────────────────────────────────────────────── */
.funnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .85rem; }
.funnel-row { display: flex; justify-content: space-between; align-items: baseline; font-size: .84rem; margin-bottom: .35rem; color: var(--ink-2); }
.funnel-row strong { font-family: var(--font-head); color: var(--ink); }
.bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; flex: 1; }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #34d399, var(--green-600)); }
.funnel li:nth-child(4) .bar span { background: linear-gradient(90deg, #60a5fa, var(--blue)); }
.funnel li:nth-child(n+5) .bar span { background: linear-gradient(90deg, #a78bfa, var(--violet)); }
.country-list { display: flex; flex-direction: column; gap: .7rem; }
.country { display: flex; align-items: center; gap: .8rem; }
.cc { width: 34px; font-weight: 700; font-size: .78rem; color: var(--ink-2); font-family: ui-monospace, Menlo, monospace; }
.country strong { min-width: 2ch; text-align: right; font-size: .85rem; }

/* ── Avatars & shop rows ───────────────────────────────────────────────── */
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px;
  font-family: var(--font-head); font-weight: 800; font-size: .8rem; letter-spacing: .02em;
  color: hsl(var(--h) 55% 28%); background: linear-gradient(135deg, hsl(var(--h) 80% 92%), hsl(var(--h) 70% 84%));
  box-shadow: inset 0 0 0 1px hsl(var(--h) 60% 80% / .6);
}
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: .7rem; }
.avatar.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 1.3rem; }
.side-user .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: .72rem; }
.shop-list { display: flex; flex-direction: column; padding: .3rem .6rem .7rem; }
.shop-row {
  display: grid; grid-template-columns: auto minmax(0, 1.3fr) minmax(0, 1fr) auto auto; align-items: center; gap: .9rem;
  padding: .75rem .8rem; border-radius: 13px; color: var(--ink); transition: background .15s;
}
.shop-row:hover { background: var(--bg); color: var(--ink); }
.shop-row.compact { grid-template-columns: auto minmax(0, 1fr) 90px 36px; padding: .6rem .8rem; }
.shop-main, .shop-owner { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.shop-main strong, .shop-owner span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-owner { font-size: .84rem; color: var(--ink-2); }
.shop-when { white-space: nowrap; }
.mini-bar { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.mini-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #60a5fa, var(--blue)); }
.cell-shop { display: flex; align-items: center; gap: .75rem; color: var(--ink); }
.cell-shop:hover { color: var(--green-700); }
.cell-shop > span { display: flex; flex-direction: column; line-height: 1.3; }

/* ── Pills & badges ────────────────────────────────────────────────────── */
.pills { display: inline-flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .18rem .6rem .18rem .5rem; border-radius: 99px; font-size: .74rem; font-weight: 600; white-space: nowrap; border: 1px solid; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-active { color: #067647; background: #ecfdf3; border-color: #abefc6; }
.pill-active i { box-shadow: 0 0 0 3px rgba(23, 178, 106, .18); }
.pill-quiet { color: #b54708; background: #fffaeb; border-color: #fedf89; }
.pill-inactive { color: #b42318; background: #fef3f2; border-color: #fecdca; }
.pill-neutral { color: var(--ink-2); background: var(--line-2); border-color: var(--line); }
.badge { display: inline-block; padding: .16rem .55rem; border-radius: 7px; font-size: .72rem; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.badge-neutral { background: var(--line-2); color: var(--ink-2); }
.badge-ok, .badge-active { background: #ecfdf3; color: #067647; }
.badge-warn, .badge-quiet { background: #fffaeb; color: #b54708; }
.badge-bad, .badge-inactive { background: #fef3f2; color: #b42318; }
.badge-info { background: var(--blue-50); color: #1d4ed8; }

/* ── Issues (dashboard) & alerts (shop) ────────────────────────────────── */
.issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.issue { display: flex; align-items: center; gap: .85rem; padding: .75rem .8rem; border-radius: 13px; border: 1px solid var(--line); color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.issue:hover { border-color: #d0d5dd; box-shadow: var(--shadow-lg); color: var(--ink); transform: translateY(-1px); }
.issue-icon, .feed-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; flex: none; background: var(--line-2); color: var(--ink-2); }
.tone-warn.issue-icon, .feed-icon.tone-warn { background: var(--amber-50); color: #d97706; }
.tone-info.issue-icon, .feed-icon.tone-info { background: var(--blue-50); color: var(--blue); }
.tone-bad.issue-icon, .feed-icon.tone-bad { background: var(--red-50); color: var(--red); }
.feed-icon.tone-ok { background: var(--green-50); color: var(--green-600); }
.issue-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.issue-text span { color: var(--muted); font-size: .82rem; }
.issue-go { color: #98a2b3; }
.all-good { display: flex; align-items: center; gap: .9rem; padding: 1rem; border-radius: 13px; background: var(--green-50); color: var(--green-700); }
.all-good p { margin: 0; }
.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.alert { display: flex; flex-direction: column; gap: .15rem; padding: .75rem .9rem; border-radius: 12px; border: 1px solid; font-size: .88rem; }
.alert-warn { background: #fffcf5; border-color: #fedf89; color: #93370d; }
.alert-bad { background: #fffbfa; border-color: #fecdca; color: #912018; }
.alert-info { background: #f5f8ff; border-color: #c7d7fe; color: #1d3a8a; }
.ok-line { color: #067647; font-weight: 600; background: #ecfdf3; padding: .75rem .9rem; border-radius: 12px; margin: 0; }
.plain { margin: 0; padding-left: 1.1rem; }
.plain li { margin: .3rem 0; }

/* ── Feed ──────────────────────────────────────────────────────────────── */
.feed { list-style: none; margin: 0; padding: 0; }
.feed-item { display: flex; gap: .85rem; padding: .7rem 0; border-bottom: 1px solid var(--line-2); }
.feed-item:last-child { border-bottom: 0; }
.feed-icon { width: 34px; height: 34px; border-radius: 10px; }
.feed-icon .icon { width: 16px; height: 16px; }
.feed-body { flex: 1; min-width: 0; }
.feed-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.feed-shop { font-weight: 600; color: var(--ink); }
.web-access { display: flex; gap: .85rem; align-items: flex-start; padding: .8rem .9rem; margin-bottom: .6rem; border-radius: 13px; border: 1px solid var(--line); background: var(--line-2); font-size: .88rem; }
.web-access p { margin: .25rem 0 0; color: var(--ink-2); line-height: 1.5; }
.web-access.on { background: var(--blue-50); border-color: #c7d7fe; }
.web-access-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none; background: #fff; color: var(--muted); }
.web-access.on .web-access-icon { color: var(--blue); }
.web-access-icon .icon { width: 16px; height: 16px; }
.feed-time { margin-left: auto; color: #98a2b3; font-size: .76rem; white-space: nowrap; }
.feed-title { margin-top: .15rem; font-size: .88rem; }
.feed-amount { margin-left: .3rem; }
.feed-meta { color: var(--muted); font-size: .78rem; margin-top: .1rem; }

/* ── Tables ────────────────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.card:not(.flush) .table th:first-child, .card:not(.flush) .table td:first-child { padding-left: 0; }
.card:not(.flush) .table th:last-child, .card:not(.flush) .table td:last-child { padding-right: 0; }
.table th { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; white-space: nowrap; background: #fcfcfd; border-bottom-color: var(--line); }
.card:not(.flush) .table th { background: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fafbfc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.selected { background: var(--green-50) !important; }
.table tfoot td { border-bottom: 0; color: var(--ink-2); }
.table tfoot tr.total td { font-weight: 800; font-size: 1.05rem; color: var(--ink); border-top: 1px solid var(--line); font-family: var(--font-head); }
.table-nowrap td { white-space: nowrap; }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.neg { color: var(--red); }
.pos { color: var(--green-600); }

/* ── Details, tabs ─────────────────────────────────────────────────────── */
.details { display: grid; grid-template-columns: max-content 1fr; gap: .6rem 1.2rem; margin: 0; font-size: .88rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; word-break: break-word; font-weight: 500; }
.details.cols-3 { grid-template-columns: repeat(3, max-content 1fr); margin-bottom: 1.2rem; }
.tabs { display: flex; gap: .25rem; padding: .3rem; margin-bottom: 1.4rem; overflow-x: auto; background: #eef0f3; border-radius: 14px; width: fit-content; max-width: 100%; }
.tabs a { padding: .5rem .9rem; color: var(--ink-2); font-weight: 500; border-radius: 10px; white-space: nowrap; font-size: .86rem; transition: background .15s, color .15s; }
.tabs a:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
.tabs a.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }

/* ── Forms & buttons ───────────────────────────────────────────────────── */
input, select, button, textarea { font: inherit; }
input[type=search], input[type=text], input[type=password], input[type=date], input:not([type]), select {
  padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(0, 163, 108, .14); }
.filters { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.1rem; padding: .7rem; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.filters input[type=search] { flex: 1; min-width: 220px; }
.filters .inline { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .84rem; }
.filters .check { display: inline-flex; align-items: center; gap: .35rem; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: .35rem .75rem; font-size: .8rem; cursor: pointer; font-weight: 500; }
.filters .check:has(input:checked) { background: var(--green-50); border-color: #a7f3d0; color: var(--green-700); }
.check input { accent-color: var(--green-600); }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack label { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; font-size: .86rem; }
.stack input { width: 100%; padding: .7rem .85rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .58rem 1rem; border-radius: 11px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow);
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.btn:hover { border-color: #d0d5dd; background: #fcfcfd; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: linear-gradient(180deg, #10b981, var(--green-600)); border-color: var(--green-600); color: #fff; box-shadow: 0 6px 14px -6px rgba(0, 132, 88, .6), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn-primary:hover { background: linear-gradient(180deg, #059669, var(--green-700)); border-color: var(--green-700); color: #fff; }
.btn-wa { color: #128c4b; }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; border-radius: 9px; }

.pager { display: flex; align-items: center; gap: .5rem; justify-content: flex-end; margin: -.3rem 0 1.25rem; }
.pager-info { color: var(--muted); font-size: .8rem; margin-right: auto; }
p.pager-info { margin: -.3rem 0 1.25rem; }
.flash { padding: .8rem 1rem; border-radius: 12px; margin-bottom: 1.1rem; font-weight: 500; border: 1px solid; }
.flash-ok { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.flash-err { background: #fef3f2; color: #b42318; border-color: #fecdca; }

/* ── Login ─────────────────────────────────────────────────────────────── */
.auth-card { width: min(420px, 94vw); background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 24px; padding: 2.2rem; box-shadow: 0 30px 60px -30px rgba(16, 24, 40, .3); }
.auth-brand { display: flex; align-items: center; gap: .7rem; font-family: var(--font-head); font-weight: 800; margin-bottom: 1.6rem; }
.auth-card h1 { margin-bottom: .8rem; }
.auth-card .btn { width: 100%; padding: .8rem; margin-top: .3rem; }

/* ── Roles, messages ───────────────────────────────────────────────────── */
.role { padding: .85rem 0; border-bottom: 1px solid var(--line-2); }
.role:last-child { border-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: .12rem .6rem; font-size: .74rem; color: var(--ink-2); }
.message.is-new { box-shadow: inset 3px 0 0 var(--blue), var(--shadow); }
.message-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.message-actions { display: flex; gap: .4rem; align-items: flex-start; }
.message-body { margin: .9rem 0 0; }

@media (max-width: 1180px) {
  .grid-3-1 { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: 1fr; }
  .details.cols-3 { grid-template-columns: max-content 1fr; }
  .shop-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .shop-row .shop-owner, .shop-row .shop-when { display: none; }
}
@media (max-width: 760px) {
  :root { --side-w: 0px; }
  .sidebar { position: sticky; top: 0; inset: auto; width: 100%; height: auto; flex-direction: row; align-items: center; padding: .6rem .8rem; gap: .5rem; }
  .brand { padding: 0; }
  .brand-text, .nav-label, .side-user-text, .side-user .avatar { display: none; }
  .sidenav { flex-direction: row; overflow-x: auto; flex: 1; }
  .sidenav a { padding: .5rem .6rem; }
  .sidenav a span:first-of-type { display: none; }
  .side-user { margin: 0; padding: 0; background: none; border: 0; }
  .side-user .side-user-link { flex: none; margin: 0; }
  .side-user .side-user-link .avatar { display: inline-grid; width: 30px; height: 30px; }
  .topbar { position: static; padding: 0 1rem; }
  .topmeta { display: none; }
  .main { padding: 1.1rem; }
}

/* ── Support mail ──────────────────────────────────────────────────────── */
.mail {
  display: grid; grid-template-columns: 220px minmax(300px, 380px) minmax(0, 1fr);
  height: calc(100vh - var(--top-h) - 4rem); min-height: 560px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.mail > * { min-height: 0; }
.mail-folders { display: flex; flex-direction: column; padding: 1.2rem .8rem; background: #fbfcfd; border-right: 1px solid var(--line); }
.mail-folders-head { padding: 0 .6rem 1rem; }
.mail-folders-head h1 { font-size: 1.35rem; margin: 0; }
.mail-nav { display: flex; flex-direction: column; gap: .15rem; }
.mail-nav a { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
.mail-nav a:hover { background: var(--line-2); color: var(--ink); }
.mail-nav a.on { background: var(--green-50); color: var(--green-700); font-weight: 600; }
.mail-nav a span:first-of-type { flex: 1; }
.mail-nav .count { background: var(--green-600); color: #fff; }
.mail-n { font-size: .75rem; color: var(--muted); }
.mail-summary { margin-top: auto; display: flex; flex-direction: column; gap: .6rem; padding: .9rem; border-radius: 13px; background: #fff; border: 1px solid var(--line); }
.mail-summary > div { display: flex; justify-content: space-between; align-items: baseline; }
.mail-summary strong { font-family: var(--font-head); }
.mail-faces { justify-content: flex-start !important; gap: 1rem; font-size: .85rem; }

.mail-list { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.mail-search { position: relative; padding: .9rem .9rem .5rem; }
.mail-search .icon { position: absolute; left: 1.7rem; top: 50%; transform: translateY(-25%); color: var(--muted); width: 16px; height: 16px; }
.mail-search input[type=search] { width: 100%; padding-left: 2.3rem; background: var(--bg); border-color: transparent; }
.mail-search input[type=search]:focus { background: #fff; }
.mail-chips { display: flex; align-items: center; gap: .35rem; padding: 0 .9rem .7rem; border-bottom: 1px solid var(--line); }
.chip-link { padding: .25rem .7rem; border-radius: 99px; font-size: .78rem; font-weight: 600; color: var(--ink-2); background: var(--line-2); }
.chip-link:hover { color: var(--ink); background: var(--line); }
.chip-link.on { background: var(--ink); color: #fff; }
.mail-total { margin-left: auto; }
.mail-items { flex: 1; overflow-y: auto; }
.mail-item { position: relative; display: flex; gap: .75rem; padding: .9rem 1rem .9rem 1.1rem; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.mail-item:hover { background: #fafbfc; color: var(--ink); }
.mail-item.on { background: var(--green-50); }
.mail-item.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--green); }
.mail-item.unread::after { content: ""; position: absolute; left: .4rem; top: 1.35rem; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.mail-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.mail-item-top { display: flex; justify-content: space-between; gap: .5rem; }
.mail-from { font-size: .86rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-date { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.mail-subject { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-snippet { font-size: .8rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mail-item.unread .mail-from, .mail-item.unread .mail-subject { font-weight: 700; color: var(--ink); }
.mail-item.unread .mail-date { color: var(--blue); font-weight: 600; }
.mail-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.tag { display: inline-flex; align-items: center; gap: .25rem; padding: .08rem .45rem; border-radius: 6px; font-size: .7rem; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.tag .icon { width: 11px; height: 11px; }
.tag-bad { background: #fef3f2; color: #b42318; }
.tag-warn { background: #fffaeb; color: #b54708; }
.tag-ok { background: #ecfdf3; color: #067647; }
.tag-info { background: var(--blue-50); color: #1d4ed8; }
.mail-empty-list { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 3rem 1.5rem; color: var(--muted); text-align: center; }
.mail-empty-list .icon { width: 32px; height: 32px; color: #cbd2d9; }
.mail-pager { display: flex; align-items: center; gap: .4rem; justify-content: flex-end; padding: .6rem .9rem; border-top: 1px solid var(--line); }
.mail-pager span { margin-right: auto; }

.mail-read { display: flex; flex-direction: column; background: #fff; }
.mail-placeholder { margin: auto; text-align: center; max-width: 320px; padding: 2rem; }
.mail-placeholder-art { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 26px; margin-bottom: 1rem; color: var(--green-600);
  background: radial-gradient(circle at 30% 20%, #d1fae5, var(--green-50)); box-shadow: inset 0 0 0 1px #a7f3d0; }
.mail-placeholder-art .icon { width: 36px; height: 36px; }
.mail-placeholder h2 { justify-content: center; margin-bottom: .4rem; }
.read-head { display: flex; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); }
.read-back { display: none; }
.read-title { flex: 1; min-width: 0; }
.read-title h2 { font-size: 1.2rem; margin-bottom: .35rem; }
.read-tags { display: flex; gap: .3rem; flex-wrap: wrap; }
.read-actions { display: flex; gap: .4rem; }
.read-actions form { margin: 0; }
.read-body { flex: 1; overflow-y: auto; padding: 1.3rem 1.4rem; display: flex; flex-direction: column; gap: 1rem; }
.read-sender { display: flex; align-items: center; gap: .9rem; }
.read-sender .avatar.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 1rem; }
.read-sender-text { flex: 1; min-width: 0; }
.read-sender-text strong { margin-right: .35rem; }
.read-sender-text .code { margin-left: .3rem; }
.read-when { text-align: right; display: flex; flex-direction: column; font-size: .85rem; }
.read-contact { display: flex; gap: .4rem; flex-wrap: wrap; }
.bubble { max-width: 760px; padding: 1rem 1.15rem; border-radius: 16px; font-size: .92rem; line-height: 1.6; }
.bubble-in { background: var(--bg); border: 1px solid var(--line); border-top-left-radius: 4px; }
.bubble-out { align-self: flex-end; background: linear-gradient(180deg, #ecfdf5, #e3f8ee); border: 1px solid #bbf0d6; border-top-right-radius: 4px; }
.bubble-who { display: flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 600; color: var(--green-700); margin-bottom: .4rem; }
.brand-mark.sm { width: 22px; height: 22px; border-radius: 7px; font-size: .55rem; box-shadow: none; }
.attachment { display: inline-flex; flex-direction: column; margin-top: .9rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; color: var(--ink); max-width: 320px; }
.attachment:hover { border-color: #d0d5dd; color: var(--ink); }
.attachment img { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.attachment-meta { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; font-size: .84rem; font-weight: 600; }
.attachment-meta small { display: block; font-weight: 500; }
.review-card { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid; max-width: 760px; }
.review-card.happy { background: #f6fef9; border-color: #abefc6; }
.review-card.sad { background: #fffbfa; border-color: #fecdca; }
.review-card p { margin: .3rem 0; font-style: italic; }
.review-face { font-size: 1.9rem; line-height: 1; }
.timeline { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; font-size: .8rem; color: var(--ink-2); }
.timeline li { display: flex; align-items: center; gap: .6rem; }
.timeline li span { width: 8px; height: 8px; border-radius: 50%; background: #d0d5dd; }
.timeline li:first-child span { background: var(--blue); }
.composer { border-top: 1px solid var(--line); padding: 1rem 1.4rem 1.2rem; background: #fcfcfd; }
.composer-to { font-size: .8rem; color: var(--ink-2); margin-bottom: .5rem; }
.composer textarea { width: 100%; resize: vertical; min-height: 90px; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: .9rem; line-height: 1.5; }
.composer textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(0, 163, 108, .14); }
.composer-actions { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; margin-top: .6rem; }
.composer-actions .muted { margin-right: auto; }

@media (max-width: 1280px) {
  .mail { grid-template-columns: 190px minmax(260px, 320px) minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .mail { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .mail-folders { border-right: 0; border-bottom: 1px solid var(--line); }
  .mail-nav { flex-direction: row; overflow-x: auto; }
  .mail-summary { display: none; }
  .mail-items { max-height: none; }
  .mail.has-open .mail-list, .mail.has-open .mail-folders { display: none; }
  .mail:not(.has-open) .mail-read { display: none; }
  .read-back { display: inline-flex; }
}

.support-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.support-stats .stat-value { font-size: 1.55rem; }
.stat.tone-ok .stat-icon { background: var(--green-50); color: var(--green-600); }
.stat.tone-bad .stat-icon { background: #fef3f2; color: #d92d20; }
@media (max-width: 1280px) { .support-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .support-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.support-stats + .mail { height: calc(100vh - var(--top-h) - 4rem - 8rem); }
@media (max-width: 1000px) { .support-stats + .mail { height: auto; } }
.mail-nav-label { display: block; padding: .9rem .7rem .35rem; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mail-nav-label:first-child { padding-top: 0; }
.composer-actions form { margin: 0; }
.composer-web .composer-actions { flex-wrap: wrap; }
@media (max-width: 1000px) { .mail-nav-label { display: none; } }

/* ── Admins & account ─────────────────────────────────────────────────── */
.admins-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
.admin-cell { display: flex; align-items: center; gap: .7rem; }
.admin-cell .avatar { flex: none; }
.row-off td { color: var(--muted); }
.row-off .avatar { filter: grayscale(1); opacity: .6; }
.admin-actions { text-align: right; white-space: nowrap; }
.admin-manage { grid-column: 1; }
.admin-add { grid-column: 2; grid-row: 1 / span 2; }
.admin-manage h2 { margin: 0; }
.manage-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.manage-cols form + form { border-left: 1px solid var(--line-2); padding-left: 1.5rem; }
.manage-cols p { margin: .2rem 0 0; }
.btn-danger { color: var(--red); border-color: #fecdca; }
.btn-danger:hover { background: var(--red-50); border-color: #fda29b; color: var(--red); }
@media (max-width: 1100px) { .admins-grid { grid-template-columns: 1fr; } .admin-add, .admin-manage { grid-column: auto; grid-row: auto; } }
@media (max-width: 760px) { .manage-cols { grid-template-columns: 1fr; } .manage-cols form + form { border-left: 0; padding-left: 0; border-top: 1px solid var(--line-2); padding-top: 1.2rem; } }
