:root { --bg:#0f1221; --card:#191d33; --line:#2a2f4a; --text:#e7e9f3; --muted:#9aa0c0;
  --accent:#6c7bff; --ok:#2fbf71; }
* { box-sizing:border-box; }
body { margin:0; font-family:-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg); color:var(--text); }
.muted { color:var(--muted); }
.card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:22px;
  box-shadow:0 1px 2px rgba(0,0,0,.25); }
h1,h2 { margin:0 0 12px; }
h2 { font-size:16px; }

/* Auth */
body.auth { display:grid; place-items:center; min-height:100vh; }
.auth-card { width:340px; }
.auth-card label { display:block; margin:12px 0; font-size:13px; color:var(--muted); }
.auth-card input { width:100%; margin-top:6px; padding:10px; border-radius:8px;
  border:1px solid var(--line); background:#0f1326; color:var(--text); }
.hint { font-size:12px; color:var(--muted); margin-top:14px; }
.error { color:#ff6b6b; font-size:13px; }

/* App shell — left sidebar + content */
.app { display:flex; min-height:100vh; }

.sidebar { width:234px; flex-shrink:0; background:var(--card); border-right:1px solid var(--line);
  display:flex; flex-direction:column; gap:4px; padding:18px 14px; position:sticky; top:0; height:100vh; }
.brand { display:flex; align-items:center; gap:10px; padding:6px 10px 18px; }
.brand-mark { font-size:20px; }
.brand-text { font-weight:700; font-size:15px; line-height:1.1; display:flex; flex-direction:column; }
.brand-text small { font-size:11px; font-weight:400; color:var(--muted); margin-top:3px; }
.nav { display:flex; flex-direction:column; gap:3px; }
.nav-item { display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:9px;
  color:var(--muted); text-decoration:none; font-size:14px; transition:background .12s, color .12s; }
.nav-item span { font-size:15px; width:18px; text-align:center; }
.nav-item:hover { background:#0f1326; color:var(--text); }
.nav-item.active { background:var(--accent); color:#fff; font-weight:600; }
.logout { margin-top:auto; }

.content { flex:1; min-width:0; max-width:1040px; padding:26px 34px 60px;
  display:grid; gap:18px; align-content:start; }
.page-title { font-size:22px; font-weight:700; margin:0 0 2px; }

button { background:var(--accent); color:#fff; border:0; padding:9px 14px; border-radius:8px;
  cursor:pointer; font-size:14px; transition:filter .12s; }
button.ghost { background:transparent; border:1px solid var(--line); color:var(--muted); }
button:hover { filter:brightness(1.1); }
a.btn { display:inline-block; background:var(--accent); color:#fff; padding:9px 14px; border-radius:8px;
  text-decoration:none; font-size:14px; }
.meta-list { list-style:none; padding:0; display:grid; gap:8px; }
.meta-list button { margin-left:8px; padding:4px 10px; }

.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; }
.stat { display:flex; align-items:center; gap:12px; background:linear-gradient(180deg,#141833,#0f1326);
  border:1px solid var(--line); border-radius:12px; padding:14px;
  transition:border-color .12s, transform .12s; }
.stat:hover { border-color:color-mix(in srgb, var(--c,var(--accent)) 60%, var(--line));
  transform:translateY(-1px); }
.stat-icon { width:40px; height:40px; flex-shrink:0; display:grid; place-items:center; font-size:19px;
  border-radius:10px; background:color-mix(in srgb, var(--c,var(--accent)) 16%, transparent);
  border:1px solid color-mix(in srgb, var(--c,var(--accent)) 34%, transparent); }
.stat-body { display:flex; flex-direction:column; min-width:0; }
.stat .big { font-size:24px; color:var(--text); font-weight:800; line-height:1.15; }
.stat-label { font-size:12px; color:var(--muted); margin-top:1px; }
/* clickable metric cards (drill into a page) */
a.stat { text-decoration:none; color:inherit; cursor:pointer; }
a.stat:hover .stat-label { color:var(--text); }

/* collapse the sidebar into a top bar on small screens */
@media (max-width:720px) {
  .app { flex-direction:column; }
  .sidebar { width:auto; height:auto; position:static; flex-direction:row; flex-wrap:wrap;
    align-items:center; border-right:0; border-bottom:1px solid var(--line); gap:4px 8px; }
  .brand { padding:6px 10px; }
  .nav { flex-direction:row; flex-wrap:wrap; }
  .logout { margin:0 0 0 auto; }
  .content { padding:20px; }
}

.uploader { display:flex; gap:10px; margin:10px 0 16px; align-items:center; }
.tbl { width:100%; border-collapse:collapse; font-size:14px; }
.tbl th, .tbl td { text-align:left; padding:9px 8px; border-bottom:1px solid var(--line); }
.tbl th { color:var(--muted); font-weight:600; font-size:12px; }

.badge { background:#0f1326; border:1px solid var(--line); border-radius:999px;
  padding:3px 10px; font-size:12px; color:var(--muted); }
.badge.ok { color:var(--ok); border-color:rgba(47,191,113,.4); }

.snippet { background:#0f1326; border:1px solid var(--line); border-radius:8px; padding:12px;
  overflow:auto; font-size:13px; color:#c7cdf0; }

.links-form { display:grid; gap:10px; max-width:460px; }
.links-form label { font-size:12px; color:var(--muted); display:grid; gap:5px; }
.links-form input { padding:9px; border-radius:8px; border:1px solid var(--line);
  background:#0f1326; color:var(--text); }

/* Sales-impact revenue estimate box */
.revenue { margin-top:16px; padding-top:16px; border-top:1px solid var(--line); }
.revenue .big { font-size:30px; color:#8b9cff; font-weight:800; }
.revenue .links-form { max-width:none; margin-top:12px;
  grid-template-columns:repeat(2,minmax(0,220px)) auto auto; align-items:end; }
