/* PressFlo Admin — PressFlo's own look: Manrope and Sora, the navy side panel
   of the PC app, brand blue (#60a5fa) for paid, brand orange for General,
   light everywhere else. Colours are plain values (no color-mix), so every
   browser draws the same thing. */
@font-face { font-family: 'Manrope'; src: url('/fonts/Manrope-Variable.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Sora'; src: url('/fonts/Sora-Variable.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: only light;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-heading: 'Sora', 'Manrope', system-ui, sans-serif;
  --navy: #020617;
  --navy-2: #0f172a;
  --side-muted: #94a3b8;
  --side-hover: rgba(255, 255, 255, .08);
  --side-active: rgba(255, 255, 255, .11);
  --side-rule: rgba(148, 163, 184, .16);
  --bg: #f6f8fb;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --blue: #60a5fa;
  --blue-deep: #2563eb;
  --blue-soft: #eff6ff;
  --orange: #ff8a00;
  --orange-deep: #e07600;
  --orange-soft: #fff4e5;
  --green: #16a34a;
  --red: #dc2626;
  --side-w: 232px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue-deep); }
h1, h2 { font-family: var(--font-heading); letter-spacing: -.01em; margin: 0; }
button, input { font-family: inherit; font-size: inherit; }

/* ---- side panel ---- */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w);
  display: flex; flex-direction: column;
  padding: 18px 12px 14px;
  background: var(--navy); color: #e2e8f0;
}
.side__brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; color: inherit; }
.side__brand img { display: block; height: 24px; width: auto; }
.side__brand span { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--orange); padding: 2px 7px; border: 1px solid rgba(255, 138, 0, .45); border-radius: 999px; }
.side__nav { display: flex; flex-direction: column; gap: 2px; }
.side__label { margin: 16px 10px 6px; padding-top: 14px; border-top: 1px solid var(--side-rule); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #64748b; }
.side__nav a {
  position: relative; display: flex; align-items: center; gap: 11px;
  height: 40px; padding: 0 10px; border-radius: 11px;
  color: var(--side-muted); text-decoration: none; font-weight: 600;
}
.side__nav a svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.side__nav a span { flex: 1 1 auto; }
.side__nav a b { font-size: 12px; font-weight: 700; color: #64748b; }
.side__nav a:hover { background: var(--side-hover); color: #fff; }
.side__nav a.is-active { background: var(--side-active); color: var(--orange); }
.side__nav a.is-active b { color: #fdba74; }
.side__nav a.is-active::before { content: ''; position: absolute; left: -12px; top: 10px; width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--orange); }
.side__nav a:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.side__foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--side-rule); display: grid; gap: 8px; }
.side__me { font-size: 12.5px; color: var(--side-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__foot button { width: 100%; height: 34px; border: 1px solid #334155; border-radius: 9px; background: transparent; color: #e2e8f0; font-weight: 700; cursor: pointer; }
.side__foot button:hover { background: var(--side-hover); }

/* ---- main ---- */
.main { margin-left: var(--side-w); padding: 28px 32px 48px; max-width: 1240px; }
.main[aria-busy="true"] { opacity: .6; transition: opacity .2s; }
.loading { color: var(--muted); }
.eyebrow { margin: 0 0 4px; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.intro h1 { font-size: 28px; }
.intro p { margin: 4px 0 0; color: var(--muted); }
.readonly { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--blue-soft); color: #1e3a8a; border: 1px solid #bfdbfe; font-size: 12.5px; font-weight: 800; }
.crumb { display: inline-block; margin-bottom: 6px; color: var(--muted); font-weight: 700; text-decoration: none; }
.crumb:hover { color: var(--text); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  border-left: 4px solid var(--border);
}
.stat span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); }
.stat strong { display: block; font-family: var(--font-heading); font-size: 30px; line-height: 1.2; }
.stat small { display: block; font-size: 12.5px; color: var(--muted); }
.stat i { font-style: normal; font-size: 22px; color: #cbd5e1; }
a.stat:hover { border-color: #cbd5e1; box-shadow: 0 6px 18px rgba(15, 23, 42, .07); }
a.stat:hover i { color: var(--text); }
.stat--paid { border-left-color: var(--blue); }
.stat--general { border-left-color: var(--orange); }
.stat--renewals { border-left-color: #f59e0b; }
.stat--expired { border-left-color: var(--red); }
.stat--all { border-left-color: var(--navy); }
.stat--active { border-left-color: var(--green); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px 22px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); margin-bottom: 18px; }
.panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel__head h2 { font-size: 17px; }
.panel--error h2 { margin-bottom: 6px; }
.more { font-weight: 700; text-decoration: none; }
.footnote { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }

.legend { display: flex; gap: 14px; list-style: none; margin: 0; padding: 0; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend li::before { content: ''; width: 14px; height: 3px; border-radius: 2px; }
.legend--all::before { background: #64748b; }
.legend--general::before { background: var(--orange); }
.legend--paid::before { background: var(--blue); }

/* ---- growth graph ---- */
.growth__chart { position: relative; min-height: 230px; }
.growth__svg { display: block; max-width: 100%; }
.growth__grid { stroke: #eef2f7; stroke-width: 1; }
.growth__axis { fill: #94a3b8; font-size: 11px; font-family: var(--font-body); }
.growth__area { fill: rgba(100, 116, 139, .08); }
.growth__line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.growth__line--all { stroke: #64748b; stroke-dasharray: 5 4; }
.growth__line--general { stroke: var(--orange); }
.growth__line--paid { stroke: var(--blue); stroke-width: 3; }
.growth__dot { stroke: #fff; stroke-width: 2; }
.growth__dot--all { fill: #64748b; }
.growth__dot--general { fill: var(--orange); }
.growth__dot--paid { fill: var(--blue); }
.growth__guide { stroke: #cbd5e1; stroke-width: 1; stroke-dasharray: 3 3; }
.growth__hit { fill: transparent; }
.growth__tip { position: absolute; z-index: 2; min-width: 170px; padding: 10px 12px; border-radius: 12px; background: var(--navy); color: #e2e8f0; font-size: 12.5px; box-shadow: 0 10px 24px rgba(2, 6, 23, .25); pointer-events: none; }
.growth__tip[hidden] { display: none; }
.growth__tip strong { display: block; margin-bottom: 6px; color: #fff; }
.growth__tip-row { display: flex; justify-content: space-between; gap: 12px; }
.growth__tip-row b { color: #fff; }
.growth__tip-row--general b { color: #fdba74; }
.growth__tip-row--paid b { color: #93c5fd; }

/* ---- watch lists ---- */
.watch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.watch .panel { margin-bottom: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #f1f5f9; }
.list li:first-child { border-top: 0; }
.list li > div { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li > div a { font-size: 13px; text-decoration: none; }
.list__date { text-align: right; display: flex; flex-direction: column; font-size: 13px; }
.list__date small { color: var(--muted); }
.list__empty { color: var(--muted); padding: 6px 0; margin: 0; }
.avatar { flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 800; font-size: 13px; }

.badge { display: inline-block; width: max-content; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800; }
.badge--plus { background: var(--blue-soft); color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge--general { background: var(--orange-soft); color: #9a3412; border: 1px solid #fed7aa; }

/* ---- tables ---- */
.intro--table { align-items: flex-end; }
.search { display: flex; align-items: center; gap: 8px; }
.search input { width: 280px; max-width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); }
.search input:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.clear { font-weight: 700; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border: 1px solid var(--blue); border-radius: 10px; background: var(--blue); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn--ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: #f8fafc; border-color: #cbd5e1; }
.panel--table { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { position: sticky; top: 0; background: #f8fafc; text-align: left; padding: 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
th a { display: block; padding: 12px 14px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; }
th a:hover, th a[aria-sort] { color: var(--text); }
td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
td strong { display: block; }
td small { display: block; color: var(--muted); }
td a { text-decoration: none; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #fafcff; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; color: var(--muted); font-weight: 700; }

/* ---- sign-in ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--navy); }
.login__card { width: 100%; max-width: 400px; padding: 32px 28px; border-radius: 22px; background: var(--surface); text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.login__logo { display: block; margin: 0 auto 6px; height: 34px; width: auto; filter: brightness(0); }
.login__card h1 { font-size: 22px; margin-bottom: 8px; }
.login__lead { margin: 0 0 22px; color: var(--muted); }
.login__error { margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; font-weight: 700; }
.login__google { display: flex; justify-content: center; min-height: 44px; }
.login__dev { margin-top: 16px; display: grid; gap: 6px; }
.login__dev button { height: 42px; border: 1px dashed var(--orange); border-radius: 999px; background: var(--orange-soft); color: #9a3412; font-weight: 800; cursor: pointer; }
.login__dev small { color: var(--muted); }
.login__foot { margin: 22px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---- phones ---- */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .watch { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .side { position: static; width: auto; padding: 12px 16px; }
  .side__brand { padding-bottom: 10px; }
  .side__nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .side__label, .side__nav a b { display: none; }
  .side__nav a { height: 34px; padding: 0 10px; }
  .side__nav a.is-active::before { display: none; }
  .side__foot { flex-direction: row; display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; }
  .side__foot button { width: auto; padding: 0 12px; }
  .main { margin-left: 0; padding: 20px 16px 40px; }
  .intro h1 { font-size: 23px; }
  .stats { grid-template-columns: 1fr; gap: 10px; }
  .search { width: 100%; }
  .search input { flex: 1 1 auto; width: auto; }
  .panel { padding: 16px; }
}
