/* Founder HQ — dark dashboard theme */
:root {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface-1: #1a1a19;
  --surface-2: #222220;
  --surface-3: #2c2c2a;
  --text-primary: #f0efec;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #0ca30c;
  --series-7: #9085e9;
  --series-8: #e66767;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --accent: #3987e5;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text-primary); font: 14px/1.45 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 15px; }
h3 { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.muted { color: var(--text-muted); }
.sec { color: var(--text-secondary); }
small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface-1); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 4px 8px 18px; }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #3987e5, #9085e9); color: #fff; font-size: 14px; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
nav .nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); padding: 14px 10px 6px; }
nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text-secondary); font-weight: 500; }
nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text-primary); }
nav a.active { background: var(--surface-3); color: var(--text-primary); }
nav a .ico { width: 18px; text-align: center; opacity: .9; }
nav a .badge { margin-left: auto; }
nav a.soon { opacity: .45; pointer-events: none; }
.side-foot { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.who { display: flex; gap: 10px; align-items: center; }
.who small { display: block; color: var(--text-muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 24px; background: rgba(13,13,13,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 20px; margin-right: auto; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.custom-range { display: inline-flex; gap: 6px; align-items: center; }
.view { padding: 20px 24px 60px; max-width: 1480px; }
.loading { color: var(--text-muted); padding: 40px 0; }
.only-mobile { display: none; }

/* ---------- controls ---------- */
input, select, textarea { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: 9px; padding: 7px 10px; font: inherit; min-height: 34px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-primary); padding: 7px 14px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; min-height: 34px; white-space: nowrap; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: #ff8a8a; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; min-height: 28px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { background: transparent; border: 0; color: var(--text-secondary); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-3); color: var(--text-primary); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 9px; padding: 2px; }
.seg button { background: transparent; border: 0; color: var(--text-secondary); padding: 5px 10px; border-radius: 7px; font: inherit; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--surface-3); color: var(--text-primary); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* ---------- cards ---------- */
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head .sub { color: var(--text-muted); font-size: 12px; }
.layout { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cols-eq { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 -4px; }
.section-title h2 { font-size: 16px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { color: var(--text-secondary); font-size: 12px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi .foot { margin-top: 4px; font-size: 12px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.delta { font-weight: 650; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); }
.delta.down { color: #ff7b7b; }
.delta.flat { color: var(--text-muted); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.hero-main .big { font-size: 40px; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hero-main .lbl { color: var(--text-secondary); font-weight: 600; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.mini .l { color: var(--text-muted); font-size: 12px; }
.mini .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.progress { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress > span { display: block; height: 100%; background: var(--series-1); border-radius: 99px; }

/* chart boxes */
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 200px; }
.chart-box.xs { height: 46px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.line { height: 2px; border-radius: 2px; vertical-align: 3px; width: 14px; }
.legend i.dash { height: 0; border-top: 2px dashed var(--text-muted); background: none !important; width: 14px; vertical-align: 3px; }

/* bars list */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row .top { display: flex; justify-content: space-between; font-size: 13px; gap: 8px; }
.bar-row .track { height: 8px; background: var(--surface-3); border-radius: 99px; margin-top: 5px; overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 99px; background: var(--series-1); }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; cursor: default; }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--text-primary); }
td.r, th.r { text-align: right; }
tbody tr:hover td { background: rgba(255,255,255,.025); }
td .sel-sm { min-height: 28px; padding: 3px 8px; font-size: 12px; max-width: 220px; }
tr.total td { font-weight: 700; border-top: 1px solid var(--border-strong); }
.trunc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }

/* pills & status */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-secondary); }
.pill.android { color: #9fdc9f; }
.pill.ios { color: #b9c6ff; }
.status { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; font-size: 12px; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; }
.status.good { color: var(--good); } .status.good .dot { background: var(--good); }
.status.warning { color: var(--warning); } .status.warning .dot { background: var(--warning); }
.status.critical { color: #ff7b7b; } .status.critical .dot { background: var(--critical); }
.status.none { color: var(--text-muted); } .status.none .dot { background: var(--text-muted); }
.badge { background: var(--critical); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.badge.warn { background: var(--warning); color: #0b0b0b; }

/* alerts */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--text-muted); }
.alert .ic { font-size: 14px; line-height: 1.3; }
.alert b { display: block; font-size: 13px; }
.alert span { color: var(--text-secondary); font-size: 12px; }
.alert.critical, .alert.crit { border-left-color: var(--critical); }
.alert.warning { border-left-color: var(--warning); }
.alert.info { border-left-color: var(--series-1); }
.alert.good { border-left-color: var(--good); }
a.alert:hover { text-decoration: none; background: var(--surface-3); }
.alert.crit { color: #ffb3b3; margin-bottom: 8px; }

/* tasks */
.task { display: flex; align-items: flex-start; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: 0; }
.task .chk { width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--text-muted); background: transparent; cursor: pointer; flex: none; margin-top: 1px; display: grid; place-items: center; color: #fff; font-size: 11px; padding: 0; }
.task.done .chk { background: var(--good); border-color: var(--good); }
.task.done .t-title { text-decoration: line-through; color: var(--text-muted); }
.task .t-body { flex: 1; min-width: 0; }
.task .t-title { font-weight: 550; }
.task .t-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.prio { font-weight: 700; }
.prio.high { color: #ff7b7b; } .prio.medium { color: var(--warning); } .prio.low { color: var(--text-muted); }
.overdue { color: #ff7b7b; font-weight: 600; }
.quick-add { display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 8px; }

/* app cards */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.app-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: border-color .15s; color: inherit; display: block; }
.app-card:hover { border-color: var(--border-strong); text-decoration: none; }
.app-card .name { font-weight: 700; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.app-card .meta { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.app-card .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.app-card .nums .l { font-size: 11px; color: var(--text-muted); }
.app-card .nums .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty h3 { color: var(--text-primary); font-size: 16px; margin-bottom: 6px; }

/* import */
.steps { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.steps span { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--text-muted); }
.steps span.on { background: var(--accent); color: #fff; }
.drop { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 30px; text-align: center; color: var(--text-secondary); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(57,135,229,.06); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.preview { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.preview table th, .preview table td { font-size: 12px; padding: 6px 8px; }
.type-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.type-pick button { text-align: left; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-primary); padding: 14px; border-radius: 12px; cursor: pointer; font: inherit; }
.type-pick button.on { border-color: var(--accent); background: rgba(57,135,229,.1); }
.type-pick b { display: block; margin-bottom: 4px; }
.type-pick small { color: var(--text-muted); }

/* modal / toast */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-card { background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: 16px; width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 20px; }
.modal-card h2 { margin-bottom: 14px; font-size: 17px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--surface-3); border: 1px solid var(--border-strong); padding: 10px 16px; border-radius: 10px; z-index: 200; font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.toast.err { border-color: var(--critical); color: #ffb3b3; }

/* auth */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1000px 600px at 20% -10%, rgba(57,135,229,.18), transparent), var(--page); }
.auth-card { width: min(400px, 100%); background: var(--surface-1); border: 1px solid var(--border); border-radius: 18px; padding: 28px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card .btn { width: 100%; margin-top: 6px; }
.brand-lg { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 750; }
pre.err { white-space: pre-wrap; background: var(--surface-2); padding: 10px; border-radius: 8px; color: #ffb3b3; }

/* responsive */
@media (max-width: 1100px) {
  .cols-2, .cols-eq, .hero { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.6); }
  .only-mobile { display: inline-block; }
  .topbar { padding: 10px 14px; }
  .view { padding: 14px 14px 60px; }
  .hero-main .big { font-size: 32px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .quick-add { grid-template-columns: 1fr 1fr; }
  .quick-add input[type=text] { grid-column: 1 / -1; }
}
