/* SEO Flow — phosphor command centre */
:root {
  --ink:      #0c0d0b;
  --ink-2:    #131511;
  --ink-3:    #1a1d17;
  --raised:   #202318;
  --line:     rgba(232, 230, 221, 0.09);
  --line-2:   rgba(232, 230, 221, 0.16);
  --paper:    #e8e6dd;
  --paper-dim:#9a9c8f;
  --paper-faint:#6b6d61;
  --signal:   #c2ff45;   /* phosphor lime — used sparingly */
  --up:       #57d98c;
  --down:     #ff6f5f;
  --amber:    #f5bb42;
  --r: 4px;
  --pad: clamp(16px, 3vw, 34px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--ink);
  color: var(--paper);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 44px,
    radial-gradient(120% 80% at 80% -10%, rgba(194,255,69,0.05), transparent 60%);
  mask: linear-gradient(#000, transparent 70%);
}
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
#app { position: relative; z-index: 2; min-height: 100vh; }

a { color: inherit; text-decoration: none; }
.mono { font-family: "IBM Plex Mono", monospace; }
.boot { font-family: "IBM Plex Mono", monospace; color: var(--paper-faint); padding: 40px; }

/* ── staggered entrance ── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 0.5s cubic-bezier(.2,.7,.2,1) both; }

/* ═══ LOGIN ═══ */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); }
.brandmark { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.brandmark .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--signal);
  box-shadow: 0 0 16px var(--signal); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.wordmark {
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 800;
  font-size: clamp(40px, 8vw, 58px); line-height: .92; letter-spacing: -.03em;
}
.wordmark em { font-style: normal; color: var(--signal); }
.login-sub { font-family: "IBM Plex Mono", monospace; font-size: 12.5px;
  color: var(--paper-dim); letter-spacing: .04em; text-transform: uppercase; margin: 14px 0 30px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-family: "IBM Plex Mono", monospace; font-size: 11px;
  text-transform: uppercase; letter-spacing: .12em; color: var(--paper-faint); margin-bottom: 7px; }
.field input {
  width: 100%; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r);
  color: var(--paper); font-family: "IBM Plex Mono", monospace; font-size: 15px; padding: 13px 14px;
  transition: border-color .18s, box-shadow .18s;
}
.field input:focus { outline: none; border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(194,255,69,0.14); }
.btn {
  width: 100%; cursor: pointer; border: none; border-radius: var(--r);
  background: var(--signal); color: #0c0d0b; font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700; font-size: 15px; letter-spacing: .01em; padding: 14px; margin-top: 8px;
  transition: transform .12s, filter .18s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.err { color: var(--down); font-family: "IBM Plex Mono", monospace; font-size: 12.5px;
  min-height: 18px; margin-top: 10px; }

/* ═══ SHELL ═══ */
.shell { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: var(--pad) 0; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; background: linear-gradient(180deg, var(--ink-2), var(--ink)); }
.side-head { padding: 0 var(--pad) 22px; display: flex; align-items: baseline; gap: 9px; }
.side-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 12px var(--signal); }
.side-head .n { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.side-label { font-family: "IBM Plex Mono", monospace; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .14em; color: var(--paper-faint); padding: 0 var(--pad); margin-bottom: 10px; }
.side-list { flex: 1; overflow-y: auto; }
.side-item { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px var(--pad); border-left: 2px solid transparent; cursor: pointer; transition: background .15s, border-color .15s; }
.side-item:hover { background: var(--ink-3); }
.side-item.active { background: var(--ink-3); border-left-color: var(--signal); }
.side-item .nm { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .kc { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; color: var(--paper-faint); }
.side-foot { padding: 18px var(--pad) 0; border-top: 1px solid var(--line); margin-top: 12px; }
.side-foot button { background: none; border: 1px solid var(--line-2); color: var(--paper-dim);
  font-family: "IBM Plex Mono", monospace; font-size: 12px; padding: 8px 12px; border-radius: var(--r);
  cursor: pointer; width: 100%; transition: color .15s, border-color .15s; }
.side-foot button:hover { color: var(--paper); border-color: var(--line-2); }

.main { padding: var(--pad); max-width: 1200px; }
.page-head { margin-bottom: 30px; }
.eyebrow { font-family: "IBM Plex Mono", monospace; font-size: 11px; text-transform: uppercase;
  letter-spacing: .16em; color: var(--signal); margin-bottom: 10px; }
.title { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: clamp(30px, 5vw, 46px);
  line-height: 1; letter-spacing: -.03em; }
.subtitle { color: var(--paper-dim); font-family: "IBM Plex Mono", monospace; font-size: 13px; margin-top: 10px; }

/* KPI row */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 34px; }
.kpi { background: var(--ink-2); padding: 20px 22px; }
.kpi .v { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 38px; line-height: 1; letter-spacing: -.03em; }
.kpi .l { font-family: "IBM Plex Mono", monospace; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--paper-faint); margin-top: 8px; }

/* tables / panels */
.panel { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--ink-2); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font-family: "IBM Plex Mono", monospace; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--paper-faint); text-align: left; padding: 11px 20px; font-weight: 500; }
.tbl td { padding: 14px 20px; border-top: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.tbl tr.row { cursor: pointer; transition: background .13s; }
.tbl tr.row:hover { background: var(--ink-3); }
.tbl .num { font-family: "IBM Plex Mono", monospace; text-align: right; }
.dom { font-family: "IBM Plex Mono", monospace; font-size: 12.5px; color: var(--paper-dim); }

.badge { font-family: "IBM Plex Mono", monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  padding: 3px 9px; border-radius: 100px; border: 1px solid var(--line-2); color: var(--paper-dim); }
.badge.active { color: var(--signal); border-color: rgba(194,255,69,.4); }
.badge.paused { color: var(--amber); border-color: rgba(245,187,66,.35); }

.rank { font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: 15px; }
.rank.none { color: var(--paper-faint); font-weight: 400; }
.delta { font-family: "IBM Plex Mono", monospace; font-size: 12.5px; }
.delta.up { color: var(--up); } .delta.down { color: var(--down); } .delta.flat { color: var(--paper-faint); }

.exp-row td { padding: 0; background: var(--ink); }
.exp-inner { padding: 20px 24px; border-top: 1px solid var(--line); }
.exp-inner .cap { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--paper-faint);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: 12px; }
.chart { width: 100%; height: 120px; display: block; }
.chart .ln { fill: none; stroke: var(--signal); stroke-width: 2; }
.chart .dt { fill: var(--signal); }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .tx { fill: var(--paper-faint); font-family: "IBM Plex Mono", monospace; font-size: 10px; }

.freshness { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--paper-dim); }
.freshness b { color: var(--signal); font-weight: 500; }
.empty { padding: 40px 20px; text-align: center; color: var(--paper-faint); font-family: "IBM Plex Mono", monospace; font-size: 13px; }
.back { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--paper-dim); cursor: pointer; display: inline-block; margin-bottom: 16px; }
.back:hover { color: var(--signal); }
.demo-tag { position: fixed; bottom: 14px; right: 16px; z-index: 5; font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--amber);
  border: 1px solid rgba(245,187,66,.35); padding: 5px 10px; border-radius: 100px; background: rgba(12,13,11,.7); }

/* actions + buttons */
.head-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.btn-sm { cursor: pointer; border: none; border-radius: var(--r); background: var(--signal); color: #0c0d0b;
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 13px; padding: 9px 16px;
  transition: filter .15s, transform .1s; }
.btn-sm:hover { filter: brightness(1.08); } .btn-sm:active { transform: translateY(1px); }
.btn-ghost { cursor: pointer; background: none; border: 1px solid var(--line-2); color: var(--paper-dim);
  font-family: "IBM Plex Mono", monospace; font-size: 12.5px; padding: 9px 14px; border-radius: var(--r);
  transition: color .15s, border-color .15s; }
.btn-ghost:hover { color: var(--paper); }
.btn-ghost.danger:hover { color: var(--down); border-color: rgba(255,111,95,.45); }
.icon-btn { cursor: pointer; background: none; border: 1px solid transparent; color: var(--paper-faint);
  font-size: 13px; padding: 4px 8px; border-radius: 4px; transition: color .12s, background .12s; }
.icon-btn:hover { color: var(--paper); background: var(--raised); }
td.actions { white-space: nowrap; text-align: right; }

/* modal */
.modal-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(4,5,3,.72); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; }
.modal { width: min(460px, 100%); background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 8px;
  overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.modal-x { cursor: pointer; background: none; border: none; color: var(--paper-faint); font-size: 15px; }
.modal-x:hover { color: var(--paper); }
.modal-body { padding: 20px; }
.mfield { margin-bottom: 14px; }
.mfield label { display: block; font-family: "IBM Plex Mono", monospace; font-size: 11px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--paper-faint); margin-bottom: 6px; }
.mfield input, .mfield select, .mfield textarea { width: 100%; background: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--r); color: var(--paper); font-family: "IBM Plex Sans", sans-serif; font-size: 14px; padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s; }
.mfield input:focus, .mfield select:focus, .mfield textarea:focus { outline: none; border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(194,255,69,.13); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-err { color: var(--down); font-family: "IBM Plex Mono", monospace; font-size: 12px; min-height: 16px; margin-top: 10px; }

@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: column; }
  .side-list { max-height: 210px; }
}
