/* ─── Reset & Tokens ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Dark theme (default) ── */
:root {
  --bg:          #0d1117;
  --surface:     #1c2230;
  --surface2:    #252e3f;
  --border:      #3a4456;
  --accent:      #4090ff;
  --accent-h:    #5ca8ff;
  --danger:      #f04040;
  --success:     #2ea84a;
  --warn:        #e09a10;
  --text:        #f0f4fa;
  --text-muted:  #aab4c4;
  --notes-bg:    rgba(224, 154, 16, 0.15);
  --notes-text:  #f0c040;
  --remarks-bg:  rgba(64, 144, 255, 0.13);
  --remarks-text:#7ec8ff;
  --freq-color:  #3dd68c;
  --radius:      6px;
  --radius-lg:   10px;
  --font:        'Segoe UI', system-ui, sans-serif;
  --font-mono:   'Consolas', 'Cascadia Code', monospace;
}

/* ── Light theme ── */
[data-theme="light"] {
  --bg:          #f0f2f5;
  --surface:     #ffffff;
  --surface2:    #e8ecf2;
  --border:      #b0bac8;
  --accent:      #1a6fe8;
  --accent-h:    #1558c0;
  --danger:      #c8201e;
  --success:     #1a7a32;
  --warn:        #a06800;
  --text:        #0d1320;
  --text-muted:  #445066;
  --notes-bg:    rgba(160, 104, 0, 0.10);
  --notes-text:  #7a4e00;
  --remarks-bg:  rgba(26, 111, 232, 0.10);
  --remarks-text:#0f4faa;
  --freq-color:  #0e7a30;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
button { cursor: pointer; font-family: var(--font); border: none; }

.primary-btn {
  background: var(--accent);
  color: #fff;
  padding: 6px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background .15s;
}
.primary-btn:hover { background: var(--accent-h); }

.secondary-btn {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: var(--radius);
  transition: background .15s;
}
.secondary-btn:hover { background: var(--border); }

.danger-btn {
  background: var(--danger);
  color: #fff;
  padding: 6px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  transition: opacity .15s;
}
.danger-btn:hover { opacity: .85; }

.icon-btn {
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  padding: 2px 4px;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
  line-height: 1;
}
.icon-btn:hover { color: var(--text); background: var(--surface2); }

.hidden { display: none !important; }

/* ─── Inline SVG icons ────────────────────────────────────────────────────── */
svg.icon {
  width: 15px;
  height: 15px;
  display: block;
  pointer-events: none;
  flex-shrink: 0;
}

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  margin-bottom: 16px;
}
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.form-grid label.full-width { grid-column: 1 / -1; }

.form-grid input,
.form-grid select,
.form-grid textarea,
textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-family: var(--font);
  font-size: 13px;
  width: 100%;
  transition: border-color .15s;
}
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.hint { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
small { font-size: 11px; color: var(--text-muted); font-weight: 400; text-transform: none; }
