/* Jersey Empire — ops shell v2 (RECOVERY-P4)
   Translated from prototype/components.jsx + pages-ops.jsx + pages-app.jsx (LivePage).
   Owned by CR0237. Applied via body class ops-page-v2 on live/banker/admin/finance.
   Gated under .os2-* prefix to avoid collision with legacy harbour-atlas.css rules. */

/* ── Reset inside ops shell ── */
.ops-page-v2 *, .ops-page-v2 *::before, .ops-page-v2 *::after { box-sizing: border-box; }
.ops-page-v2 { font-family: var(--font-body, 'Inter', system-ui, sans-serif); color: var(--ink); }

/* ── Top nav bar (mirrors ps2-header, ops-scoped) ── */
.os2-top-bar {
  position: sticky;
  top: 0;
  z-index: 3000;
  background: rgba(255, 251, 241, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line, #E2D5B4);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.os2-top-bar__brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-weight: 700; font-size: 16px; letter-spacing: -0.012em;
  color: var(--ink); text-decoration: none;
  font-variation-settings: "opsz" 144, "SOFT" 30, "wght" 700;
  white-space: nowrap;
}
.os2-top-bar__brand img { width: 28px; height: 28px; display: block; object-fit: contain; }
.os2-top-bar__tag {
  font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent-deep, #6B3A2A); font-weight: 700;
  background: var(--surface-3, #EDE1C2); border-radius: 999px;
  padding: 3px 8px; margin-left: 4px; white-space: nowrap;
}
.os2-top-bar__spacer { flex: 1; }

/* ── Stage banner (injected by ops-shell-v2.js) ── */
.os2-stage-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: var(--warn, #D9A441); color: var(--ink, #0B1828);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  text-align: center; padding: 4px 12px; pointer-events: none;
}

/* ── Page inner wrapper ── */
.os2-page-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ── PageHeader ── */
.os2-page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 28px; flex-wrap: wrap;
}
.os2-page-header__left { min-width: 0; }
.os2-page-header__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Eyebrow ── */
.os2-eyebrow {
  display: inline-block; font-size: 11px; font-weight: 600;
  color: var(--accent-deep, #6B3A2A); letter-spacing: 0.22em;
  text-transform: uppercase; margin-bottom: 8px;
}
.os2-eyebrow--live { display: inline-flex; align-items: center; gap: 6px; }
.os2-live-dot {
  width: 8px; height: 8px; background: var(--bad, #A8412F);
  border-radius: 50%; animation: os2pulse 1.4s infinite;
}
@keyframes os2pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── Display typography ── */
.os2-display-h2 {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: clamp(24px, 3.6vw, 36px);
  font-weight: 600; letter-spacing: -0.018em; line-height: 1.05;
  color: var(--ink); margin: 0;
  font-variation-settings: "opsz" 144, "SOFT" 30;
}
.os2-display-h4 {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: 20px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink); margin: 0; line-height: 1.1;
}
.os2-subtitle {
  font-size: 15px; color: var(--ink-mute, #44516A); max-width: 560px;
  margin-top: 6px; line-height: 1.55;
}

/* ── Stat grid ── */
.os2-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.os2-stat-card {
  background: var(--surface, #FFFBF1); border: 1px solid var(--line, #E2D5B4);
  border-radius: 18px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.os2-stat-card__label {
  font-size: 11px; font-weight: 600; color: var(--ink-soft, #8A7B5C);
  letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 14px;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.os2-stat-card__icon {
  width: 32px; height: 32px; border-radius: 10px; background: var(--surface-3, #EDE1C2);
  display: flex; align-items: center; justify-content: center; color: var(--ink-mute, #44516A);
  flex-shrink: 0;
}
.os2-stat-card__value {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: 32px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
}
.os2-stat-card__delta {
  font-size: 12px; color: var(--ink-mute, #44516A); margin-top: 6px; font-weight: 500;
}
.os2-stat-card__delta--good { color: var(--good, #4A6F4E); }
.os2-stat-card__delta--bad  { color: var(--bad, #A8412F); }
.os2-stat-card__delta--warn { color: var(--warn, #D9A441); }

/* ── Card ── */
.os2-card {
  background: var(--surface, #FFFBF1);
  border: 1px solid var(--line, #E2D5B4);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.os2-card--flush { padding: 0; }
.os2-card--r18 { border-radius: 18px; }

/* ── Badge ── */
.os2-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; font-size: 12px; font-weight: 600;
  border-radius: 999px; letter-spacing: 0.02em;
  white-space: nowrap; line-height: 1.2;
  background: var(--surface-3, #EDE1C2); color: var(--ink-mute, #44516A);
}
.os2-badge--sm   { padding: 3px 8px; font-size: 11px; }
.os2-badge--good { background: var(--good-tint, #D4E8D4); color: var(--good, #4A6F4E); }
.os2-badge--warn { background: var(--warn-tint, #FAF0D7); color: var(--accent-deep, #6B3A2A); }
.os2-badge--bad  { background: var(--bad-tint, #FAD9D4); color: var(--bad, #A8412F); }
.os2-badge--info { background: var(--info-tint, #D4E0FA); color: var(--info, #3060A0); }
.os2-badge--primary { background: var(--primary-tint, #D4DFEA); color: var(--primary, #1E3A5F); }

/* ── Button ── */
.os2-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; font-size: 14px; height: 44px; border-radius: 12px;
  font-weight: 600; letter-spacing: 0.005em; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.18s ease;
}
.os2-btn:hover { transform: translateY(-1px); }
.os2-btn--primary { background: var(--primary, #1E3A5F); color: var(--primary-fg, #F8F1DF); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.os2-btn--ghost   { background: transparent; color: var(--ink, #0B1828); border-color: var(--line, #E2D5B4); }
.os2-btn--danger  { background: var(--bad, #A8412F); color: #fff; }
.os2-btn--success { background: var(--good, #4A6F4E); color: #fff; }
.os2-btn--sm { padding: 8px 14px; font-size: 13px; height: 36px; border-radius: 10px; }

/* ── Live-map-specific: push map content below top bar ── */
.ops-page-v2.live-map-shell .os2-map-band {
  position: fixed; top: 49px; left: 0; right: 0;
  background: var(--surface-2, #F5EDD8);
  border-bottom: 1px solid var(--line, #E2D5B4);
  padding: 8px 20px; z-index: 2500;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.ops-page-v2.live-map-shell #map     { top: 105px !important; height: calc(100vh - 105px) !important; }
.ops-page-v2.live-map-shell .sidebar { top: 105px !important; height: calc(100vh - 105px) !important; }
.ops-page-v2.live-map-shell .rank-toggle { top: 120px !important; }
.ops-page-v2.live-map-shell .leaderboard-panel { top: 165px !important; }

/* ── Divider line ── */
.os2-divider { border: none; border-top: 1px solid var(--line, #E2D5B4); margin: 0; }

/* ── Section header row (card header variant) ── */
.os2-section-header {
  padding: 18px 22px; border-bottom: 1px solid var(--line, #E2D5B4);
  display: flex; justify-content: space-between; align-items: center;
}

/* ============================================================
   CR0287 — Harbour Night for ops consoles (admin / finance / banker)
   Scoped to the three console body classes. ops-shell-v2.css is loaded
   ONLY by ops consoles, so the public front-end + workspace are untouched.
   ============================================================ */
html body.admin-console-shell:not(:has(#map)),
html body.finance-console-shell:not(:has(#map)),
html body.banker-console-page:not(:has(#map)) {
  --bg:#02101f !important; --bg-light:#02101f !important; --bg-dark:#02101f !important;
  --surface:#0a2540 !important; --surface-2:#0e2a49 !important; --surface-3:#12314f !important;
  --ha-white:#0a2540 !important; --ha-shell:#05172c !important; --ha-blue-soft:#0e2a49 !important;
  --ha-line:rgba(150,190,235,.14) !important; --ha-ink:#EDF3FB !important; --ha-muted:#9DB2C9 !important;
  --ink:#EDF3FB !important; --ink-mute:#9DB2C9 !important; --ink-soft:#9DB2C9 !important;
  --line-soft:rgba(150,190,235,.16) !important;
}
body.admin-console-shell input:not([type=checkbox]):not([type=radio]):not([type=range]),
body.admin-console-shell select, body.admin-console-shell textarea,
body.finance-console-shell input:not([type=checkbox]):not([type=radio]):not([type=range]),
body.finance-console-shell select, body.finance-console-shell textarea,
body.banker-console-page input:not([type=checkbox]):not([type=radio]):not([type=range]),
body.banker-console-page select, body.banker-console-page textarea {
  background:#0a2540 !important; color:#EDF3FB !important; border-color:#2c4a6a !important;
}
