* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Segoe UI", system-ui, sans-serif; background: #0f1420; color: #e8ecf4; min-height: 100vh; }
a { color: #7db4ff; text-decoration: none; }
h1 { font-size: 1.6rem; margin-bottom: .25rem; }
h2 { margin: 1.5rem 0 1rem; }
h3 { margin-bottom: .75rem; }
.muted { color: #8b93a7; font-size: .9rem; margin-bottom: 1rem; }

.center-card { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.card { background: #171e2e; border: 1px solid #263048; border-radius: 12px; padding: 2rem; width: 100%; max-width: 380px; }
.card.wide { max-width: 640px; margin-top: 1.5rem; }

label { display: block; margin: .9rem 0 .3rem; font-size: .85rem; color: #aeb6c8; }
input { width: 100%; padding: .6rem .75rem; border-radius: 8px; border: 1px solid #2e3a55; background: #0f1420; color: #e8ecf4; font-size: 1rem; }
input:focus { outline: none; border-color: #4a7dff; }
button { margin-top: 1.2rem; width: 100%; padding: .65rem; border: none; border-radius: 8px; background: #3861d6; color: #fff; font-size: 1rem; cursor: pointer; }
button:hover { background: #4a73e8; }
.alert { background: #3a1c24; border: 1px solid #6e2a3a; color: #ff9db0; padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; margin-bottom: .5rem; }

.topbar { display: flex; align-items: center; gap: 2rem; padding: .8rem 1.5rem; background: #171e2e; border-bottom: 1px solid #263048; }
.topbar .brand { font-weight: 700; font-size: 1.1rem; }
.topbar .tag { font-weight: 400; font-size: .75rem; color: #8b93a7; margin-left: .4rem; }
.topbar .links { display: flex; gap: 1.2rem; flex: 1; }
.topbar .soon { color: #57607a; cursor: default; }
.topbar .soon::after { content: " (soon)"; font-size: .7rem; }
.userbox { display: flex; align-items: center; gap: .8rem; font-size: .85rem; color: #aeb6c8; }
.linklike { margin: 0; width: auto; padding: .3rem .7rem; background: transparent; border: 1px solid #2e3a55; font-size: .8rem; }

main { max-width: 900px; margin: 0 auto; padding: 0 1.5rem 3rem; }
.stat-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.stat { background: #171e2e; border: 1px solid #263048; border-radius: 12px; padding: 1.1rem 1.4rem; min-width: 140px; flex: 1; }
.stat .num { font-size: 1.9rem; font-weight: 700; }
.stat .lbl { color: #8b93a7; font-size: .85rem; margin-top: .2rem; }

.ok { background: #16301f; border: 1px solid #2a5c3c; color: #86e0a4; padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; margin-bottom: .5rem; }
.crumb { margin-top: 1.2rem; font-size: .85rem; }
.pill { display: inline-block; font-size: .7rem; font-weight: 400; color: #aeb6c8; border: 1px solid #2e3a55; border-radius: 999px; padding: .15rem .6rem; vertical-align: middle; margin-left: .4rem; }
.pill.off { color: #ff9db0; border-color: #6e2a3a; }

select { width: 100%; padding: .6rem .75rem; border-radius: 8px; border: 1px solid #2e3a55; background: #0f1420; color: #e8ecf4; font-size: 1rem; }
select:focus { outline: none; border-color: #4a7dff; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; align-items: end; }
.form-grid label { margin-top: 0; }
.btn-cell { display: flex; align-items: flex-end; }
.btn { margin-top: 0; width: auto; padding: .6rem 1.3rem; }
.btn.danger { background: #5c2330; }
.btn.danger:hover { background: #74303f; }

.tbl { width: 100%; border-collapse: collapse; margin-top: 1rem; background: #171e2e; border: 1px solid #263048; border-radius: 12px; overflow: hidden; }
.tbl th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #8b93a7; padding: .7rem .9rem; border-bottom: 1px solid #263048; }
.tbl td { padding: .65rem .9rem; border-bottom: 1px solid #1e2740; font-size: .92rem; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.dim td { opacity: .45; }
.row-actions { display: flex; gap: .8rem; align-items: center; }
.row-actions form { display: inline; }
.row-actions .linklike { border: none; color: #ff9db0; padding: 0; font-size: .92rem; }

.warn { background: #33290f; border: 1px solid #6b5a1e; color: #ffd27a; padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; }
.warn a, .alert a { text-decoration: underline; }
.right-link { font-size: .85rem; font-weight: 400; margin-left: 1rem; }
textarea { width: 100%; padding: .6rem .75rem; border-radius: 8px; border: 1px solid #2e3a55; background: #0f1420; color: #e8ecf4; font-size: .9rem; font-family: Consolas, monospace; }
textarea:focus { outline: none; border-color: #4a7dff; }
input[type="file"] { border: none; padding: .3rem 0; }
.tbl-scroll { overflow-x: auto; margin-top: 1rem; }
.tbl-scroll .tbl { margin-top: 0; }
.danger-link { color: #ff9db0; }
.row-inline { display: flex; gap: .5rem; align-items: center; }
.row-inline select, .row-inline input { width: auto; padding: .35rem .5rem; font-size: .85rem; }
.row-inline input { flex: 1; min-width: 80px; }
.btn-sm { padding: .35rem .8rem; font-size: .85rem; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.plan-card { max-width: none; padding: 1.2rem; }
.plan-card.plan-default { border-color: #4a7dff; }
.plan-result { font-size: 1.6rem; font-weight: 700; margin: .8rem 0; }
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .7rem; }
.score-cell { background: #0f1420; border: 1px solid #263048; border-radius: 8px; padding: .55rem .7rem; }
.score-cell .lbl { font-size: .72rem; color: #8b93a7; margin-bottom: .25rem; }
.score-cell .val { font-size: 1.2rem; font-weight: 700; }
.score-cell .sub { font-size: .68rem; color: #57607a; }
.score-cell.auto { border-color: #2a5c3c; }
.score-cell input { padding: .3rem .5rem; font-size: .95rem; }
.score-cell.wide2 { grid-column: span 2; }
.form-grid .wide2 { grid-column: span 2; }

/* KOL Command Center */
.cmd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.month-nav { display: flex; align-items: center; gap: .6rem; }
.mbtn { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; border: 1px solid #2e3a55; background: #171e2e; color: #e8ecf4; text-decoration: none; font-size: 1rem; }
.mbtn:hover { border-color: #4a7dff; }
.mlabel { font-weight: 700; min-width: 130px; text-align: center; }

.kpi-row { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr) .9fr; gap: .8rem; margin-top: 1.2rem; }
.kpi { background: #171e2e; border: 1px solid #263048; border-radius: 12px; padding: 1rem 1.1rem; }
.kpi-lead { background: linear-gradient(160deg, #1b2540, #171e2e); border-color: #33447a; }
.kpi-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #8b93a7; }
.kpi-val { font-size: 1.7rem; font-weight: 800; margin-top: .25rem; font-variant-numeric: tabular-nums; }
.kpi-lead .kpi-val { font-size: 2.1rem; color: #cde0ff; }
.kpi-foot { font-size: .78rem; color: #8b93a7; margin-top: .3rem; }
.kpi-mini .kpi-val { font-size: 1.3rem; }
.delta { font-weight: 700; }
.delta.up { color: #4ade80; }
.delta.down { color: #ff9db0; }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1.2rem; }
.chart-card { background: #171e2e; border: 1px solid #263048; border-radius: 12px; padding: 1rem 1.1rem; }
.chart-card h3 { display: flex; justify-content: space-between; align-items: center; font-size: .92rem; margin: 0 0 .7rem; }
.legend { font-size: .72rem; color: #8b93a7; font-weight: 400; }
.legend .sw { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin: 0 .25rem 0 .6rem; vertical-align: middle; }
.sw.reg { background: #4a7dff; } .sw.ftd { background: #a78bfa; }
.bars { display: flex; align-items: flex-end; gap: .5rem; height: 96px; }
.barcol { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.pair { flex: 1; display: flex; align-items: flex-end; gap: 2px; width: 100%; justify-content: center; }
.bar { width: 42%; max-width: 20px; border-radius: 3px 3px 0 0; min-height: 2px; }
.bar.reg { background: #4a7dff; } .bar.ftd { background: #a78bfa; }
.bar.profit { background: #4ade80; width: 60%; } .bar.profit.neg { background: #ff9db0; }
.blabel { font-size: .68rem; color: #8b93a7; margin-top: .35rem; }

.super-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .7rem; margin-top: 1.2rem; }
.super { background: #171e2e; border: 1px solid #263048; border-radius: 12px; padding: .8rem 1rem; text-decoration: none; color: #e8ecf4; display: block; }
.super:hover { border-color: #4a7dff; }
.super-label { font-size: .74rem; color: #8b93a7; }
.super-name { font-weight: 700; margin: .2rem 0; }
.super-val { font-size: 1.1rem; font-weight: 800; color: #cde0ff; font-variant-numeric: tabular-nums; }

.th-sort { color: #8b93a7; text-decoration: none; }
.th-sort.on { color: #7db4ff; }
.rank { display: inline-block; min-width: 1.3rem; color: #57607a; font-variant-numeric: tabular-nums; }
.lead-col { background: rgba(74,125,255,.06); }
.two-col { display: grid; grid-template-columns: 1fr 1.3fr; gap: 1.2rem; margin-top: 1.5rem; align-items: start; }
main.cmd .tbl td, main.cmd .tbl th { font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .kpi-lead { grid-column: 1 / -1; }
  .chart-grid, .two-col { grid-template-columns: 1fr; }
}

.trend-row { display: flex; align-items: flex-end; gap: .8rem; margin-top: .6rem; }
.trend-brand { width: 70px; font-size: .85rem; color: #aeb6c8; }
.trend-bars { display: flex; gap: 3px; align-items: flex-end; height: 44px; flex: 1; }
.trend-bar { width: 100%; max-width: 26px; height: 100%; background: #1a2236; border-radius: 3px; display: flex; align-items: flex-end; }
.trend-bar .fill { width: 100%; background: #4a7dff; border-radius: 3px; }

@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: .6rem; padding: .6rem 1rem; }
  .topbar .links { order: 3; width: 100%; flex-wrap: wrap; gap: .6rem .9rem; }
  main { padding: 0 .8rem 2rem; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .score-cell.wide2, .form-grid .wide2 { grid-column: span 2; }
  .stat { min-width: 40%; }
}

.checklist { list-style: none; }
.checklist li { padding: .45rem 0 .45rem 1.7rem; position: relative; color: #aeb6c8; border-bottom: 1px solid #1e2740; }
.checklist li:last-child { border-bottom: none; }
.checklist li::before { content: "○"; position: absolute; left: .2rem; color: #57607a; }
.checklist li.done { color: #e8ecf4; }
.checklist li.done::before { content: "✓"; color: #4ade80; }

/* nav groups (final sweep 2026-07-23): click-open dropdowns via details/summary */
.topbar .navgroup { position: relative; }
.topbar .navgroup summary { cursor: pointer; list-style: none; color: #c6cbda; }
.topbar .navgroup summary::-webkit-details-marker { display: none; }
.topbar .navgroup[open] summary { color: #fff; }
.topbar .navdrop { position: absolute; top: 1.8rem; left: -0.6rem; background: #1d2537; border: 1px solid #2c3a58; border-radius: 8px; padding: .45rem 0; min-width: 175px; z-index: 60; box-shadow: 0 8px 22px rgba(0,0,0,.4); display: flex; flex-direction: column; }
.topbar .navdrop a { padding: .4rem .9rem; }
.topbar .navdrop a:hover { background: #263048; }
.tabsbar { display: flex; gap: .3rem; margin: .8rem 0 1rem; border-bottom: 1px solid #263048; flex-wrap: wrap; }
.tabsbar a { padding: .4rem .9rem; border-radius: 8px 8px 0 0; color: #aeb6c8; }
.tabsbar a.active { background: #1d2537; color: #fff; border: 1px solid #263048; border-bottom: none; }

/* ── UI polish 2026-07-27 (Joe's review) ─────────────────────────────── */
a.brand { color: inherit; text-decoration: none; }
a.brand:hover { opacity: .85; }
/* compact tables: fit the viewport instead of forcing horizontal scroll */
.tbl-fit { width: 100%; table-layout: auto; }
.tbl-fit th, .tbl-fit td { padding: .5rem .55rem; font-size: .85rem; white-space: normal; }
.tbl-fit th { font-size: .7rem; }
/* traffic-light band indicator (replaces emoji bands) */
.band-dot { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; white-space: nowrap; }
.band-dot::before { content: ''; width: .65rem; height: .65rem; border-radius: 50%; background: var(--band-color, #8b93a7); display: inline-block; }
/* content pipeline sections */
.sec-head { display: flex; align-items: center; gap: .5rem; margin: 1.1rem 0 .5rem; font-size: 1rem; font-weight: 700; }
.sec-count { background: rgba(128,128,128,.25); border-radius: 999px; padding: .05rem .55rem; font-size: .8rem; font-weight: 600; }
.done-chip { display: inline-block; border-radius: 999px; padding: .15rem .6rem; font-size: .78rem; margin: 0 .25rem .25rem 0; background: rgba(128,128,128,.18); }
.done-chip.is-done { background: rgba(34,197,94,.2); }

/* ── Type scale + tokens (UI discipline pass 2026-07-27) ─────────────────
   Scale: hero number 2.4rem · page title 1.25rem · section label .78rem
   uppercase · body .92rem · caption .78rem. Status colors ONLY for status;
   emoji reserved for KOL motivation lines + Telegram. */
h2 { font-size: 1.25rem; font-weight: 700; }
.sec { display: flex; align-items: center; gap: .5rem; margin: 1.7rem 0 .6rem;
       font-size: .78rem; font-weight: 600; text-transform: uppercase;
       letter-spacing: .08em; color: #8b93a7; }
.sec .sec-count { background: rgba(128,128,128,.25); border-radius: 999px;
                  padding: .05rem .5rem; font-size: .72rem; letter-spacing: 0; }
.sec .sec-note { text-transform: none; letter-spacing: 0; font-weight: 400; color: #57607a; }
/* hero stats: the ONE block allowed to shout */
.stat-hero .stat .num { font-size: 2.4rem; letter-spacing: -1px; }
/* compact stats: secondary strips that must not compete with the hero */
.stat-compact .stat { padding: .55rem .9rem; min-width: 110px; }
.stat-compact .stat .num { font-size: 1.15rem; font-weight: 600; }
.stat-compact .stat .lbl { font-size: .74rem; }
/* status chip: colored border + text, replaces emoji status pills */
.chip { display: inline-block; font-size: .72rem; border: 1px solid; border-radius: 999px;
        padding: .15rem .6rem; vertical-align: middle; white-space: nowrap; }
