/* Data Pulse internal console — shared styles */

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol, li, figure, table, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

:root {
  --ground:      #EEF2F6;
  --surface:     #FFFFFF;
  --surface-2:   #F5F9FC;
  --surface-3:   #E9F0F6;
  --ink:         #101E2B;
  --ink-muted:   #55697C;
  --ink-faint:   #7C8FA1;
  --rule:        #CFDBE5;
  --rule-strong: #A9BCCD;

  --accent:      #24618F;
  --accent-ink:  #FFFFFF;
  --accent-soft: #E2ECF5;
  --amber:       #8A5A05;
  --amber-soft:  #F7EDDA;
  --teal:        #1F6F63;
  --teal-soft:   #DEEFEB;
  --red:         #A03028;
  --red-soft:    #F8E6E4;

  --shadow: 0 1px 2px rgba(16,30,43,.05), 0 6px 16px -8px rgba(16,30,43,.12);

  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0C141D; --surface: #141F2B; --surface-2: #1A2734; --surface-3: #1F2E3D;
    --ink: #DEE8F2; --ink-muted: #8FA5BA; --ink-faint: #6F8598;
    --rule: #27384A; --rule-strong: #3C5165;
    --accent: #79B2E2; --accent-ink: #0C141D; --accent-soft: #17293A;
    --amber: #E0AC55; --amber-soft: #2E2617;
    --teal: #5FBEAC; --teal-soft: #122C29;
    --red: #E48B82; --red-soft: #2E1917;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 16px -8px rgba(0,0,0,.55);
  }
}

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.mono { font-family: var(--font-mono); }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .13em;
           text-transform: uppercase; color: var(--ink-faint); }

/* ---------------------------------------------------------- controls */

.btn {
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  border-radius: 7px; padding: 8px 16px; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: filter .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: none; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.small { padding: 5px 11px; font-size: 12.5px; border-radius: 6px; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }

label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-muted); }
label.field > span { font-family: var(--font-mono); font-size: 10.5px;
                     letter-spacing: .09em; text-transform: uppercase; color: var(--ink-faint); }

input[type=text], input[type=password], select, textarea {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 7px;
  padding: 9px 11px; font-size: 14px; width: 100%;
}
textarea { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none;
                                            box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------------------------------------------------------- surfaces */

.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
         box-shadow: var(--shadow); overflow: hidden; }
.panel > hgroup { padding: 14px 18px 13px; border-bottom: 1px solid var(--rule);
                  background: var(--surface-2); display: flex; flex-wrap: wrap;
                  align-items: baseline; justify-content: space-between; gap: 8px 14px; }
.panel h2 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.panel h3 { font-size: 13.5px; font-weight: 600; }
.panel .body { padding: 18px; display: flex; flex-direction: column; gap: 16px; }

.count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint);
         font-variant-numeric: tabular-nums; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono);
        font-size: 10.5px; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.chip.raw   { background: var(--amber-soft); color: var(--amber); }
.chip.clean { background: var(--accent-soft); color: var(--accent); }
.chip.pub   { background: var(--teal-soft); color: var(--teal); }
.chip.perm  { background: var(--surface-3); color: var(--ink-muted); }

pre.json { margin: 0; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6;
           background: var(--surface-3); border: 1px solid var(--rule); border-radius: 7px;
           padding: 9px 11px; overflow-x: auto; color: var(--ink-muted); max-height: 220px; }

table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-family: var(--font-mono); font-size: 10px;
                letter-spacing: .09em; text-transform: uppercase; font-weight: 500;
                color: var(--ink-faint); padding: 0 12px 7px 0; border-bottom: 1px solid var(--rule); }
table.grid td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--rule); font-size: 13px;
                vertical-align: top; }
table.grid tr:last-child td { border-bottom: none; }

.note { font-size: 12.5px; color: var(--ink-faint); }
.empty { padding: 26px 18px; text-align: center; color: var(--ink-faint); font-size: 13.5px; }

.msg { padding: 11px 14px; border-radius: 8px; font-size: 13px; border: 1px solid; }
.msg.err { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.msg.ok  { background: var(--teal-soft); color: var(--teal); border-color: var(--teal); }

[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
