/* ─── Theme CSS — dark (default) + light override ─────── */

/* ── Dark theme (default) ────────────────────────────── */
:root {
  --bg:               #0b0e14;
  --surface:          #13171f;
  --surface2:         #1a1f2a;
  --border:           #252b38;
  --border-bright:    #2e3748;
  --text:             #e2e8f2;
  --text-muted:       #6b7a96;
  --text-dim:         #3a4558;

  --accent-blue:      #4d9ef6;
  --accent-blue-dim:  #1a3a5c;
  --accent-green:     #3dd68c;
  --accent-green-dim: #0d3d26;
  --accent-purple:    #9b7ff4;
  --accent-amber:     #f5a623;
  --accent-red:       #f06a6a;

  --sidebar-bg:       #0d1117;
  --sidebar-border:   #21262d;
  --sidebar-text:     #8b949e;
  --sidebar-dim:      #3a4558;
  --sidebar-hover:    rgba(77,158,246,.12);
  --sidebar-active:   rgba(77,158,246,.18);
}

/* ── Light theme ─────────────────────────────────────── */
body.light {
  --bg:               #f0f3f8;
  --surface:          #ffffff;
  --surface2:         #f7f9fc;
  --border:           #dde3ed;
  --border-bright:    #c8d0df;
  --text:             #1a2035;
  --text-muted:       #6b7a96;
  --text-dim:         #b0bbc8;

  --accent-blue-dim:  #c0cfde;
  --accent-green-dim: #d0f5e8;

  --sidebar-bg:       #0d1117;
  --sidebar-border:   #21262d;
  --sidebar-text:     #8b949e;
  --sidebar-dim:      #3a4558;
  --sidebar-hover:    rgba(77,158,246,.12);
  --sidebar-active:   rgba(77,158,246,.18);
}

/* ─── Shared component tokens ────────────────────────── */

/* Cards */
.sh-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
}

/* Section eyebrow */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

/* Page title */
.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 28px;
}

.page-title span { color: var(--accent-blue); }

/* Section divider label */
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Status badges */
.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-green-dim);
  border: 1px solid rgba(61,214,140,.4);
  border-radius: 20px;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-green);
  font-weight: 500;
}

.badge-live .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: blink 2s infinite;
}

/* Mono value display */
.mono-val {
  font-family: var(--font-mono);
  font-weight: 500;
}

/* Toast */
#sh-toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  z-index: 2000;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}

#sh-toast.show { opacity: 1; transform: none; }

/* Modal */
.sh-modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.sh-modal-backdrop.open { display: flex; }

.sh-modal {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 16px;
  width: 100%; max-width: 600px;
  max-height: 88vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}

@keyframes modalIn { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:none} }

.sh-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--surface); z-index: 10;
}

.sh-modal-title  { font-size: 16px; font-weight: 700; }
.sh-modal-sub    { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.sh-modal-close {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text-muted);
  width: 30px; height: 30px; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: background var(--tr), color var(--tr);
}

.sh-modal-close:hover { background: var(--border); color: var(--text); }

.sh-modal-body { padding: 20px 24px 28px; }

/* History table */
.history-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-mono); font-size: 12px;
}

.history-table th {
  text-align: left; padding: 8px 10px;
  color: var(--text-dim); font-size: 10px;
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}

.history-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.history-table tbody tr:last-child td { border-bottom: none; }
.history-table tbody tr:hover td { background: var(--surface2); }

.val-blue   { color: var(--accent-blue)   !important; font-weight: 500; }
.val-green  { color: var(--accent-green)  !important; font-weight: 500; }
.val-purple { color: var(--accent-purple) !important; font-weight: 500; }
.val-dim    { color: var(--text-dim)      !important; }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.sh-spin { display: inline-block; animation: spin .7s linear infinite; }
