/* AppSpy — pro analytics theme. Dark by default, light via [data-theme="light"]. */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #080c12;
  --panel: #0f151e;
  --panel-2: #141c27;
  --hover: #18222f;
  --line: #1c2633;
  --line-2: #273345;
  --text: #e7edf5;
  --text-2: #b3bfcd;
  --muted: #718096;
  --accent: #4d8dff;
  --accent-soft: rgba(77, 141, 255, .14);
  --up: #34d399;
  --down: #fb6f84;
  --new: #b197fc;
  --new-soft: rgba(177, 151, 252, .14);
  --warn: #fbbf24;
  --hi: #34d399;
  --mid: #4d8dff;
  --lo: #5b6778;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.25);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f9;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --hover: #f1f5fb;
  --line: #e4e9f0;
  --line-2: #d5dde8;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, .10);
  --up: #059669;
  --down: #dc2626;
  --new: #7c3aed;
  --new-soft: rgba(124, 58, 237, .10);
  --warn: #b45309;
  --hi: #059669;
  --mid: #2563eb;
  --lo: #94a3b8;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 18px rgba(15, 23, 42, .05);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
       -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.ic { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 18px 14px;
        background: var(--panel); border-right: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: -.01em; padding: 2px 8px; }
.logo:hover { text-decoration: none; }
.logo svg { width: 30px; height: 30px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; }
.side nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.side nav a.on { background: var(--accent-soft); color: var(--text); }
.side nav a.on .ic { color: var(--accent); }
.side nav .count { margin-left: auto; font-style: normal; font-size: 11px; background: var(--line-2); color: var(--text); padding: 1px 7px; border-radius: 999px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: 12px; }
.sf-label { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-weight: 500; }
.sf-meta { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lo); }
.dot.live { background: var(--up); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.theme-btn { justify-content: flex-start; gap: 8px; margin-top: 4px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 18px; padding: 14px 28px;
       background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top h1 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
main { padding: 22px 28px 40px; display: flex; flex-direction: column; gap: 18px; max-width: 1400px; width: 100%; }
.foot { font-size: 12px; padding-top: 6px; }

/* ---------- search ---------- */
.search { position: relative; flex: 1; max-width: 560px; margin-left: auto; }
.search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; font: inherit; padding: 9px 40px 9px 36px; border-radius: 10px; border: 1px solid var(--line-2);
                background: var(--panel); color: var(--text); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 600 11px "JetBrains Mono", monospace;
              color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line-2);
           border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.35); max-height: 70vh; overflow-y: auto; display: none; }
.results.open { display: block; }
.results a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; color: var(--text); border-bottom: 1px solid var(--line); }
.results a:last-child { border-bottom: 0; }
.results a.sel, .results a:hover { background: var(--hover); text-decoration: none; }
.results img { width: 34px; height: 34px; border-radius: 8px; flex: none; background: var(--line); }
.results .r-main { flex: 1; min-width: 0; }
.results .r-main div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .r-sub { color: var(--muted); font-size: 12px; }
.results .r-rank { font-size: 12px; white-space: nowrap; color: var(--muted); }
.results .r-rank b { color: var(--text); font-family: "JetBrains Mono", monospace; }
.results .empty { padding: 12px; color: var(--muted); }

/* ---------- cards & KPIs ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.card-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 18px 12px; }
.card-h h2 { margin: 0; font-size: 15px; font-weight: 650; }
.card-h p { margin: 3px 0 0; font-size: 12.5px; max-width: 760px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow);
       display: flex; flex-direction: column; gap: 6px; }
.k-label { color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.k-val { font-size: 28px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; }
.k-val small { font-size: 16px; color: var(--muted); margin-left: 1px; }
.k-sub { color: var(--muted); font-size: 12px; }
.bar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #22d3ee); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid2.wide-left { grid-template-columns: 1.6fr 1fr; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.card > .tbl, .card > div > .tbl, .panel > .tbl { border-top: 1px solid var(--line); }
.tbl th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
          padding: 9px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl .num { text-align: right; width: 1%; white-space: nowrap; }
.tbl.compact td { padding: 8px 14px; }
.tbl td.empty { color: var(--muted); padding: 22px 16px; text-align: center; }
.tbl td.why { min-width: 260px; }
.tbl td.wrap { max-width: 220px; }
.tbl th.promise-h { width: 1%; }
.card { overflow-x: auto; }
.rk { display: inline-block; min-width: 26px; text-align: center; font: 600 12.5px "JetBrains Mono", monospace; color: var(--text-2); }
.rk.podium { color: var(--warn); }
.app { display: flex; gap: 11px; align-items: center; min-width: 220px; }
.app img { width: 38px; height: 38px; border-radius: 9px; flex: none; background: var(--line); box-shadow: 0 0 0 1px var(--line) inset; }
.app-txt { min-width: 0; }
.app-link { color: var(--text); font-weight: 550; }
.app-link:hover { color: var(--accent); text-decoration: none; }
.app .sub { color: var(--muted); font-size: 12px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.up { color: var(--up); font-weight: 600; font-family: "JetBrains Mono", monospace; font-size: 12.5px; }
.down { color: var(--down); font-weight: 600; font-family: "JetBrains Mono", monospace; font-size: 12.5px; }
.pill-new { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; color: var(--new); background: var(--new-soft); padding: 2px 6px; border-radius: 5px; }
.rank { font: 600 13px "JetBrains Mono", monospace; color: var(--text); margin-right: 6px; }
.sub-inline { color: var(--muted); font-size: 12px; }
.flags { margin-left: 4px; letter-spacing: 1px; }
.age.fresh { color: var(--up); font-weight: 600; }
.niche { font-size: 14px; }
td.members img { width: 28px; height: 28px; border-radius: 7px; margin: 1px 3px 1px 0; vertical-align: middle; box-shadow: 0 0 0 1px var(--line) inset; }
.status { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--text-2); }
.status.ok { color: var(--up); background: rgba(52, 211, 153, .12); }
.status.running { color: var(--accent); background: var(--accent-soft); }
.status.failed { color: var(--down); background: rgba(251, 111, 132, .12); }
.status.partial { color: var(--warn); background: rgba(251, 191, 36, .12); }

/* ---------- chips, tabs, buttons ---------- */
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; margin: 2px 4px 2px 0; border-radius: 6px; background: var(--panel-2);
        border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.chip.acc { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line-2)); background: var(--accent-soft); }
.chip.hot { color: var(--new); border-color: color-mix(in srgb, var(--new) 45%, var(--line-2)); background: var(--new-soft); font-weight: 600; }
.tabs { display: flex; gap: 4px; background: var(--panel-2); border: 1px solid var(--line); padding: 3px; border-radius: 10px; }
.tab { font: inherit; font-weight: 550; font-size: 13px; padding: 6px 12px; border-radius: 7px; border: 0; background: none; color: var(--text-2); cursor: pointer; }
.tab em { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 4px; }
.tab.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.tab.active em { color: var(--accent); }
.panel { display: none; } .panel.active { display: block; }
.legend-line { margin: 0; padding: 0 18px 12px; font-size: 12px; color: var(--muted); }
.legend-line b { color: var(--text-2); font-family: "JetBrains Mono", monospace; }
.more-row { display: none; }
.show-all .more-row { display: table-row; }
.more-btn { margin: 10px 14px 14px; }
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 550; padding: 7px 13px; border-radius: 9px;
       border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); cursor: pointer; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .6; cursor: default; }

/* ---------- promise score ---------- */
.score { display: flex; align-items: center; gap: 9px; }
.score b { min-width: 24px; text-align: right; font: 600 14px "JetBrains Mono", monospace; }
.score.t-hi b { color: var(--hi); } .score.t-mid b { color: var(--text); } .score.t-lo b { color: var(--muted); }
.sbar { width: 64px; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.sbar i { display: block; height: 100%; border-radius: 3px; background: var(--lo); }
.t-hi .sbar i { background: var(--hi); } .t-mid .sbar i { background: var(--mid); }
.mini { display: flex; align-items: flex-end; gap: 3px; height: 32px; padding-left: 8px; border-left: 1px solid var(--line-2); }
.mini span { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 32px; width: 10px; cursor: help; }
.mini i { display: block; width: 8px; border-radius: 2px 2px 0 0; background: var(--accent); opacity: .85; }
.t-hi .mini i { background: var(--hi); }
.mini .na i { height: 20px; background: none; border: 1px dashed var(--line-2); border-bottom: 0; opacity: 1; }
.mini em { font: 600 9px "JetBrains Mono", monospace; color: var(--muted); line-height: 12px; }

/* ---------- charts view ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
select { font: inherit; font-size: 13px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); max-width: 100%; }
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 2px; }
.seg a { padding: 5px 11px; border-radius: 7px; color: var(--text-2); font-size: 13px; font-weight: 550; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.on { background: var(--accent); color: #fff; }
.fresh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.fg-row { display: grid; grid-template-columns: 1fr repeat(3, 84px); gap: 6px; align-items: center; padding: 7px 14px; background: var(--panel); }
.fg-c { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fg-cell { font-size: 11.5px; padding: 3px 7px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); text-align: center; }
.fg-cell em { display: block; font-style: normal; font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fg-cell:hover { text-decoration: none; border-color: var(--accent); }
.fg-cell.a0 { color: var(--up); } .fg-cell.a1 { color: var(--text-2); } .fg-cell.none { opacity: .5; }
.fg-cell.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(3, 6, 10, .66); backdrop-filter: blur(3px); display: none; align-items: flex-start;
            justify-content: center; padding: 36px 14px; overflow-y: auto; z-index: 60; }
.modal-bg.open { display: flex; }
.modal { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 16px; width: 100%; max-width: 960px;
         padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.5); position: relative; }
.modal .close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line-2);
                background: var(--panel-2); color: var(--text-2); font-size: 20px; cursor: pointer; }
.m-head { display: flex; gap: 18px; align-items: flex-start; padding-right: 40px; }
.m-head img { width: 92px; height: 92px; border-radius: 21px; flex: none; background: var(--line); box-shadow: 0 0 0 1px var(--line-2) inset; }
.m-head h3 { margin: 0; font-size: 21px; font-weight: 650; letter-spacing: -.01em; }
.m-orig { color: var(--muted); font-size: 13px; }
.m-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 16px; margin-top: 12px; }
.m-facts div { font-size: 12px; color: var(--muted); }
.m-facts b { display: block; color: var(--text); font-size: 13.5px; font-weight: 550; margin-top: 1px; }
.m-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.m-sec { margin-top: 22px; }
.m-sec h4 { margin: 0 0 8px; font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.m-sec h4 span { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.m-box { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.m-scroll { max-height: 330px; overflow-y: auto; }
.m-desc { white-space: pre-line; font-size: 13px; color: var(--text-2); max-height: 7.5em; overflow: hidden; }
.m-desc.open { max-height: none; }
.dev-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.dev-apps a { display: flex; gap: 9px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--panel-2); }
.dev-apps a:hover { border-color: var(--accent); text-decoration: none; }
.dev-apps img { width: 36px; height: 36px; border-radius: 8px; flex: none; }
.hist-wrap { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px 2px; background: var(--panel-2); }
.hist-tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 9px;
            font-size: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.3); display: none; white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 8px 0; align-items: center; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }

/* ---------- downloads estimate ---------- */
.dl-total { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.dl-total > div:first-child { display: flex; flex-direction: column; }
.dl-total b { font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.dl-total b small { font-size: 13px; color: var(--muted); font-weight: 500; }
.dl-note { flex: 1; min-width: 240px; font-size: 12px; }
.dl-list { padding: 6px 0; }
.dl-row { display: grid; grid-template-columns: 170px 1fr 110px; gap: 12px; align-items: center; padding: 5px 14px; font-size: 13px; }
.dl-row:hover { background: var(--hover); }
.dl-track { position: relative; height: 10px; border-radius: 5px; background: var(--line); }
.dl-range { position: absolute; top: 0; height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.dl-mid { position: absolute; top: -3px; width: 3px; height: 16px; margin-left: -1px; border-radius: 2px; background: var(--accent); }
.dl-v { text-align: right; font-family: "JetBrains Mono", monospace; font-size: 12.5px; }
.conf { text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
.conf-low { color: var(--warn); } .conf-medium { color: var(--accent); } .conf-high { color: var(--up); }
.calib { font-size: 9.5px; letter-spacing: .05em; color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.dl-cell { font-family: "JetBrains Mono", monospace; font-size: 12.5px; }
.dl-cell span { color: var(--muted); font-family: Inter, sans-serif; font-size: 11.5px; }

/* ---------- modal: ratings, revenue, updates, reviews ---------- */
.small-scroll { max-height: 260px; }
.btn .ic { width: 16px; height: 16px; }
.card-h > .csv { order: 2; }
.csv-inline { margin: 10px 14px 14px 0; }
.idx.share i { background: var(--up); }
.spark { display: block; }
.idx { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.idx i { display: block; height: 100%; background: var(--warn); border-radius: 3px; }
.vers { display: flex; flex-direction: column; gap: 8px; }
.ver { border-left: 2px solid var(--line-2); padding: 2px 0 2px 12px; }
.ver:first-child { border-left-color: var(--accent); }
.ver-h { display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.ver-h b { font-family: "JetBrains Mono", monospace; }
.ver-notes { white-space: pre-line; font-size: 12.5px; color: var(--text-2); margin-top: 3px; max-height: 6.2em; overflow: hidden; }
.more-ver { display: none; } .vers.all .more-ver { display: block; } .vers.all .ver-notes { max-height: none; }
.reviews { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.rv-dist { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 4px 14px; font-size: 12px; padding: 10px 12px;
           border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.rv-dist > .muted { grid-column: 1 / -1; }
.rv-bar { display: grid; grid-template-columns: 26px 1fr 24px; gap: 6px; align-items: center; }
.rv-bar i { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.rv-bar b { display: block; height: 100%; background: var(--warn); }
.rv-bar em { font-style: normal; color: var(--muted); text-align: right; }
.rv { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.rv-h { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; font-size: 13px; }
.rv-h a { margin-left: auto; font-size: 12px; }
.stars { color: var(--warn); letter-spacing: 1px; }
.rv-c { white-space: pre-line; font-size: 13px; color: var(--text-2); margin-top: 4px; }
.results .r-group { padding: 6px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--line); }

/* ---------- signed-in user (sidebar) ---------- */
.me { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft);
      color: var(--accent); font-weight: 700; border: 1px solid var(--line-2); }
.me:hover { text-decoration: none; border-color: var(--accent); }
.side-user { padding: 10px 8px 0; border-top: 1px solid var(--line); font-size: 12px; }
.su-name { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-links { display: flex; gap: 10px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.su-links a, .su-links button { color: var(--muted); font: inherit; font-size: 12px; background: none; border: 0; padding: 0; cursor: pointer; }
.su-links a:hover, .su-links button:hover { color: var(--text); text-decoration: none; }
.su-links form { margin: 0; }

/* ---------- sign-in / account / users pages ---------- */
body.plain { min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
             background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent); }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px;
             padding: 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.auth-card.wide { max-width: 520px; } .auth-card.xwide { max-width: 980px; overflow-x: auto; }
.auth-card h1 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.01em; }
.auth-card h2 { margin: 0; font-size: 15px; }
.auth-card p { margin: 0; }
.auth-card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.auth-card input, .auth-card select { font: inherit; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); }
.auth-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card .btn.primary { justify-content: center; padding: 10px; }
.auth-card hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
.auth-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.auth-logo svg { width: 30px; height: 30px; }
.auth-error { background: rgba(251, 111, 132, .12); color: var(--down); border: 1px solid rgba(251, 111, 132, .35); border-radius: 9px; padding: 9px 12px; font-size: 13px; }
.auth-ok { background: rgba(52, 211, 153, .10); color: var(--text); border: 1px solid rgba(52, 211, 153, .35); border-radius: 9px; padding: 9px 12px; font-size: 13px; }
.pw { font: 600 14px "JetBrains Mono", monospace; background: var(--panel-2); padding: 2px 6px; border-radius: 6px; user-select: all; }
.inline-form { flex-direction: row !important; flex-wrap: wrap; align-items: flex-end; }
.inline-form label { flex: 1; min-width: 160px; }
.auth-card .tbl { border: 1px solid var(--line); border-radius: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .grid2, .grid2.wide-left { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; overflow-x: auto; }
  .side nav { flex-direction: row; }
  .side nav a span { display: none; }
  .side-foot { display: none; }
  .side-user { display: none; }
  .top { padding: 10px 16px; flex-wrap: wrap; }
  .top h1 { font-size: 16px; }
  .search { max-width: none; flex-basis: 100%; }
  main { padding: 16px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .k-val { font-size: 22px; }
  .m-head { flex-direction: column; }
}
