/* =====================================================
   HEARTBRIDGE GLOBAL THEME SYSTEM
   Dark = default
   Light = auto via data-theme
===================================================== */

/* ---------- DARK MODE (DEFAULT) ---------- */
:root{
  --bg:#070b14;
  --panel:#0b1220;
  --card:#0e1830;
  --card2:#0a1429;

  --border:#1a2a4a;
  --border2:#263a61;

  --text:#e5e7eb;
  --muted:rgba(229,231,235,.75);

  --green:#22c55e;
  --green2:#16a34a;
  --orange:#f59e0b;
  --red:#ef4444;

  --radius:14px;
  --radius-sm:10px;
  --shadow:0 10px 30px rgba(0,0,0,.45);
}

/* ---------- LIGHT MODE ---------- */
html[data-theme="light"]{
  --bg:#f4f6fb;
  --panel:#ffffff;
  --card:#ffffff;
  --card2:#f0f3f9;

  --border:#d7ddea;
  --border2:#c7d0e3;

  --text:#0b1220;
  --muted:rgba(11,18,32,.7);

  --green:#16a34a;  --green2:#15803d;
  --orange:#d97706;
  --red:#dc2626;

  --shadow:0 10px 25px rgba(0,0,0,.12);
}


:root{
  --bg:#0b1220;
  --card:#0f1a2e;
  --card2:#0c1526;
  --text:#e9eefc;
  --muted:#aab7d7;
  --line:rgba(255,255,255,.10);
  --blue:#2b6cff;
  --green:#1fd17f;
  --warn:#f5c542;
  --bad:#ff5a6a;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background: radial-gradient(1200px 800px at 20% 0%, #122a55 0%, var(--bg) 60%);
  color:var(--text);
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

.topbar{
  display:flex;
  justify-content:space-between;
  gap:16px;
  padding:22px 22px 14px;
  border-bottom:1px solid var(--line);
}

h1{margin:0;font-size:22px}
.sub{margin:6px 0 0;color:var(--muted)}
.topbar-right{display:flex;gap:10px;align-items:flex-start}

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
  padding:16px 22px 28px;
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

h2{margin:0 0 10px}
h3{margin:10px 0 6px}
label{display:block;margin:10px 0 6px;color:var(--muted);font-size:13px}
input,textarea,select{
  width:100%;
  background:rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.12);
  color:var(--text);
  padding:12px 12px;
  border-radius:12px;
  outline:none;
}
textarea{resize:vertical}
.row{display:flex;gap:10px;margin-top:12px;flex-wrap:wrap}
.btn{
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.20);
  color:var(--text);
  padding:10px 14px;
  border-radius:12px;
  cursor:pointer;
}
.btn.primary{
  background: linear-gradient(180deg, rgba(31,209,127,.95), rgba(10,140,82,.95));
  border:0;
  color:#052014;
  font-weight:700;
}
.btn:disabled{opacity:.55;cursor:not-allowed}

.sep{border:0;border-top:1px solid var(--line);margin:16px 0}

.statusBox{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  border:1px dashed rgba(255,255,255,.16);
  background:rgba(0,0,0,.14);
}
.statusLine{
  margin-top:10px;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.14);
}

.pill{
  padding:5px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  font-size:12px;
  display:inline-block;
}
.pill.warn{background:rgba(245,197,66,.15); color:#ffe6a5; border-color:rgba(245,197,66,.35)}
.pill.ok{background:rgba(31,209,127,.14); color:#b8ffd9; border-color:rgba(31,209,127,.35)}
.pill.bad{background:rgba(255,90,106,.14); color:#ffd1d6; border-color:rgba(255,90,106,.35)}
.chip{
  border:1px solid rgba(255,255,255,.16);
  background:rgba(0,0,0,.20);
  color:var(--text);
  padding:8px 12px;
  border-radius:999px;
  cursor:pointer;
}
.pill.pill{cursor:default}

.twoCol{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin-top:8px;
}
.gateRow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.14);
  margin:10px 0;
}

.checkbox{display:flex;gap:10px;align-items:flex-start;margin-top:14px}
.checkbox input{width:auto;margin-top:3px}

.details{margin-top:10px}
.debug{
  margin:10px 0 0;
  max-height:220px;
  overflow:auto;
  padding:10px;
  background:rgba(0,0,0,.30);
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  white-space:pre-wrap;
}

.link{display:inline-block;margin-top:12px;color:#a9c7ff;text-decoration:none}
.link:hover{text-decoration:underline}

@media (max-width: 980px){
  .grid{grid-template-columns:1fr}
  .twoCol{grid-template-columns:1fr}
}
/* =====================================================
   THEME OVERRIDES (WIN AGAINST ANY EARLIER HARD-CODED CSS)
   Put this at the VERY BOTTOM of styles.css
===================================================== */

body{
  background: var(--bg) !important;
  color: var(--text) !important;
}

header, .topbar, .topbar-right{
  background: transparent !important;
  color: var(--text) !important;
}

.card, .panel, .box, .section{
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: var(--radius, 14px) !important;
}

input, select, textarea{
  background: var(--card2) !important;
  border: 1px solid var(--border2) !important;
  color: var(--text) !important;
}

input::placeholder, textarea::placeholder{
  color: rgba(229,231,235,.55) !important;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder{
  color: rgba(11,18,32,.45) !important;
}

button{
  border: 1px solid var(--border2) !important;
}

.btn, .primary, .cta{
  background: var(--green) !important;
  color: #04110a !important;
  border: 0 !important;
}

.chip{
  background: rgba(255,255,255,.06) !important;
  border: 1px solid var(--border2) !important;
  color: var(--text) !important;
}

html[data-theme="light"] .chip{
  background: rgba(11,18,32,.06) !important;
}
