/* NCC console — dark mission-control. Locked palette (see IMPLEMENT spec):
   bg #181C24 · surface #272D38 · inset #3B4250 · hairline rgba(255,255,255,0.06)
   text #ECEFF4 / #9AA3B5 / #6E7888 · brand #5390F2 (hover #84B0FB)
   accent #56D3C5 / #21B7A9 · ok #15A45A · warn #D98309 · error #DC3B3B · share #7C5CE0 */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #181C24;
  --surface: #272D38;
  --inset: #3B4250;
  --hairline: rgba(255, 255, 255, 0.06);
  --grid: rgba(255, 255, 255, 0.05);
  --text: #ECEFF4;
  --text-2: #9AA3B5;
  --text-3: #6E7888;
  --brand: #5390F2;
  --brand-hover: #84B0FB;
  --accent: #56D3C5;
  --accent-2: #21B7A9;
  --ok: #15A45A;
  --warn: #D98309;
  --error: #DC3B3B;
  --share: #7C5CE0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.hidden { display: none !important; }

.screen { min-height: 100vh; }

/* ── Login ── */

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 40px;
  width: 420px;
  max-width: calc(100vw - 48px);
}

.login-card h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.login-subtitle {
  color: var(--text-2);
  margin-bottom: 28px;
}

.login-card label {
  display: block;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 16px 0 6px;
}

.login-card input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--inset);
  border-radius: 8px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 10px 12px;
}

.login-card input:focus {
  outline: none;
  border-color: var(--brand);
}

.login-card button {
  width: 100%;
  margin-top: 24px;
  background: var(--brand);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px;
  cursor: pointer;
}

.login-card button:hover { background: var(--brand-hover); }
.login-card button:disabled { background: var(--inset); color: var(--text-3); cursor: default; }

.error-text {
  color: var(--error);
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
}

/* ── Shell ── */

.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 20px;
}

.card.errored { border-color: rgba(220, 59, 59, 0.55); }

.card-error {
  color: var(--error);
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid rgba(220, 59, 59, 0.35);
  border-radius: 8px;
  background: rgba(220, 59, 59, 0.07);
  margin-bottom: 12px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.card-head h3 { font-size: 15px; font-weight: 600; }

.card-sub {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 400;
}

.section { display: flex; flex-direction: column; gap: 16px; }

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-2);
}

/* ── Status strip ── */

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 14px 20px;
}

.strip-left, .strip-center, .strip-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wordmark {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.env-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}

.env-badge.staging {
  color: var(--warn);
  background: rgba(217, 131, 9, 0.14);
  border: 1px solid rgba(217, 131, 9, 0.4);
}

.env-badge.production {
  color: var(--error);
  background: rgba(220, 59, 59, 0.14);
  border: 1px solid rgba(220, 59, 59, 0.4);
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pulse-dot.ok    { background: var(--ok);    animation: pulse-ok 2.4s ease-out infinite; }
.pulse-dot.warn  { background: var(--warn);  animation: pulse-warn 1.6s ease-out infinite; }
.pulse-dot.error { background: var(--error); animation: pulse-error 1s ease-out infinite; }

@keyframes pulse-ok {
  0%   { box-shadow: 0 0 0 0 rgba(21, 164, 90, 0.45); }
  100% { box-shadow: 0 0 0 10px rgba(21, 164, 90, 0); }
}
@keyframes pulse-warn {
  0%   { box-shadow: 0 0 0 0 rgba(217, 131, 9, 0.5); }
  100% { box-shadow: 0 0 0 10px rgba(217, 131, 9, 0); }
}
@keyframes pulse-error {
  0%   { box-shadow: 0 0 0 0 rgba(220, 59, 59, 0.55); }
  100% { box-shadow: 0 0 0 12px rgba(220, 59, 59, 0); }
}

.strip-stat { font-size: 15px; font-weight: 500; }
.strip-stat-label { color: var(--text-2); font-size: 12px; }

.ingest-today {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  flex-wrap: wrap;
}

.ingest-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ingest-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.strip-divider {
  width: 1px;
  height: 20px;
  background: var(--hairline);
}

/* ── Segmented control ── */

.range-row { display: flex; }

.segmented {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--inset);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.seg-btn {
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 18px;
  cursor: pointer;
}

.seg-btn:hover { color: var(--text); }

.seg-btn.active {
  background: var(--brand);
  color: #fff;
}

.segmented.mini .seg-btn {
  font-size: 11px;
  padding: 4px 12px;
}

/* ── Charts ── */

.chart-wrap {
  position: relative;
  height: 220px;
}

.chart-wrap.tall { height: 280px; }

/* ── Feed ── */

.feed-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-label {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.feed-filters select,
.feed-filters input {
  background: var(--bg);
  border: 1px solid var(--inset);
  border-radius: 7px;
  color: var(--text);
  font-size: 12px;
  padding: 6px 9px;
}

.feed-filters input { width: 200px; }
.feed-filters select { font-family: 'JetBrains Mono', monospace; }

.feed-filters select:focus,
.feed-filters input:focus {
  outline: none;
  border-color: var(--brand);
}

.feed-scroll {
  max-height: 460px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: 8px;
}

.feed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.feed-table th {
  position: sticky;
  top: 0;
  background: var(--surface);
  color: var(--text-3);
  font-weight: 500;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline);
  z-index: 1;
}

.feed-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--hairline);
  color: var(--text-2);
  white-space: nowrap;
}

.feed-table tbody tr:last-child td { border-bottom: none; }
.feed-table tbody tr:hover td { background: rgba(255, 255, 255, 0.025); }

.feed-table td.t-time { color: var(--text); }
.feed-table td.t-route { max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.feed-table td.t-code { color: var(--text); }

.status-4xx { color: var(--warn); font-weight: 500; }
.status-5xx { color: var(--error); font-weight: 500; }

.env-cell-staging { color: var(--warn); }
.env-cell-production { color: var(--error); }

/* New-row flash: teal at low alpha fading over ~1.5s */
@keyframes row-flash {
  0%   { background: rgba(86, 211, 197, 0.16); }
  100% { background: transparent; }
}

.feed-table tr.row-new td { animation: row-flash 1.5s ease-out 1; }

.feed-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--inset);
  border-radius: 7px;
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
}

.btn-ghost:hover { color: var(--text); border-color: var(--brand); }

.empty-note {
  color: var(--text-3);
  font-size: 13px;
  padding: 24px;
  text-align: center;
}

/* ── Usage grid ── */

.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1200px) {
  .usage-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .status-strip { flex-direction: column; align-items: flex-start; }
  .shell { padding: 14px; }
}
