/* GMP Control Panel — utilitarian dark admin theme */
/* Monospace-forward, high-contrast, operator-grade. No gradients, no decoration. */

:root {
  /* surfaces */
  --bg-page:   linear-gradient(135deg,#ffcedd 0%,#e2d2ff 52%,#c9efe2 100%); /* body */
  --bg-raised: #fffcff;   /* cards / panels / config rows */
  --bg:        #f9f3ff;   /* inputs, recessed insets */
  --bg-border: #ecdbf6;   /* borders */
  --nav-bg:    rgba(255,255,255,0.86);
  /* text */
  --text:      #4a4060;   /* soft-plum, readable */
  --text-dim:  #8a7ba0;   /* secondary */
  /* brand + accents */
  --brand:      #d2589a;
  --accent:     #7d5ae0;  /* borders / active underline */
  --accent-deep:#6a45cf;  /* accent text on light (links, active tab, regen) */
  --accent-dim: #cbb6f2;  /* soft accent — button borders, badges */
  --danger:     #d9636e;
  --danger-dim: #f3c6c6;
  --success:    #1f9e7e;
  /* fills */
  --card-shadow:0 6px 22px rgba(160,120,215,0.22);
  --badge-bg:   #ece0ff;
  --regen-bg:   #e8dafb;
  --upload-bg:  #f2eafb;
  --delete-bg:  #fdf0f0;
  --plus-grad:  linear-gradient(90deg,#ff99c4,#a888ef);
  --plus-text:  #ffffff;
  --pill-mint-bg:#c7efe4;  --pill-mint-text:#168470;   /* framed */
  --pill-sky-bg: #cfe5fb;  --pill-sky-text:#3a6cbb;    /* weather */
  --pill-lav-bg: #e6dafb;  --pill-lav-text:#6a45cf;    /* datacard */
  --pill-idx-bg: #eaddf8;                              /* #N index (text = --text-dim) */
  /* shape + type */
  --radius:       20px;
  --radius-input: 12px;
  --radius-pill:  999px;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  --font-ui:   "Quicksand", "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-head: "Baloo 2", "Quicksand", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg-page) fixed;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ──────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--bg-border);
  padding: 0 1.5rem;
  height: 48px;
}

.nav-brand {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--brand);
  text-transform: none;
  margin-right: 2rem;
  white-space: nowrap;
}

.nav-shows {
  display: flex;
  gap: 0.4rem;
  margin-right: 1.5rem;
  overflow-x: auto;
}

.nav-show {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-pill);
  background: #fff;
  white-space: nowrap;
  transition: color 0.1s, border-color 0.1s;
}

.nav-show:hover {
  color: var(--text);
  border-color: var(--accent);
}

.nav-show.current {
  color: var(--accent-deep);
  border-color: var(--accent);
  background: var(--badge-bg);
}

.nav-tabs {
  display: flex;
  gap: 0;
  flex: 1;
}

.nav-tab {
  display: block;
  padding: 0 1.25rem;
  line-height: 48px;
  font-size: 14px;
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 0.1s, border-color 0.1s;
}

.nav-tab:hover {
  color: var(--text);
}

.nav-tab.active {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
}

.nav-logout {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-pill);
  background: #fff;
  margin-left: auto;
  transition: color 0.1s, border-color 0.1s;
}

.nav-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ── Content ──────────────────────────────────────── */
.content {
  padding: 2rem 2.5rem;
  max-width: 1240px;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  font-size: 19px;
  color: var(--text);
  margin-bottom: 1.25rem;
}

/* ── Login page ───────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  width: 340px;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 2.5rem 2rem;
}

.login-box .brand {
  font-family: var(--font-head);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--brand);
  margin-bottom: 2rem;
  text-align: center;
}

.login-box label {
  display: block;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.login-box input[type="password"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-input);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 0.55rem 0.75rem;
  outline: none;
  transition: border-color 0.1s;
}

.login-box input[type="password"]:focus {
  border-color: var(--accent);
}

.login-box button {
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.65rem;
  background: var(--plus-grad);
  border: none;
  border-radius: var(--radius-pill);
  color: var(--plus-text);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: filter 0.1s;
}

.login-box button:hover {
  background: var(--plus-grad);
  filter: brightness(1.05);
}

.login-error {
  margin-top: 1rem;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--danger);
  text-align: center;
}

/* ── Buttons (shared base; pages may extend with colour variants) ── */
.btn {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--bg-border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s, filter 0.1s, border-color 0.1s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Show prompts (read-only) ────────────────────── */
.show-prompts {
  margin-bottom: 1.5rem;
}

.show-prompts summary {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 0.4rem 0;
}

.show-prompts .script-prompt {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-input);
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  white-space: pre-wrap;
  max-height: 320px;
  overflow-y: auto;
}

.show-prompts .muted {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

/* ── Expandable plugin panel (plugins page) ──────── */
.btn-caret {
  font-size: 11px;
  padding: 0.2rem 0.45rem;
  flex-shrink: 0;
}

.plugin-panel {
  border-top: 1px solid var(--bg-border);
  background: var(--bg);
  padding: 0.75rem 1rem;
}

.plugin-panel[hidden] {
  display: none;
}

/* ── Utility ──────────────────────────────────────── */
.placeholder-note {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-dim);
  padding: 1rem;
  border: 1px dashed var(--bg-border);
  border-radius: var(--radius);
}

/* Per-plugin card (shared by settings + plugins tabs) */
.btn-plugin-save {
  border-color: #bfe6d6;
  color: var(--success);
  background: #eafaf4;
  font-size: 11px;
  padding: 0.3rem 0.7rem;
}
.btn-plugin-save:hover:not(:disabled) { background: #d7f3e8; }

.knob-override-marker {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: middle;
}

.plugin-override-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.plugin-override-confirm label {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;

  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

.plugin-override-confirm input[type="checkbox"] {
  width: 12px;
  height: 12px;
  accent-color: var(--accent);
}

.plugin-error-msg {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--danger);
  letter-spacing: 0.02em;
  padding: 0.4rem 0;
}

.card-group { padding: 0.6rem 0 0.9rem 0; border-bottom: 1px dashed var(--bg-border); }
.card-group:last-child { border-bottom: none; }
.group-label {
  font-family: var(--font-ui); font-size: 11px; color: var(--text-dim);
  letter-spacing: 0.08em;  display: block; margin-bottom: 0.5rem;
}
.knob-row { display: grid; grid-template-columns: 220px 1fr auto; gap: 0.6rem;
            align-items: start; padding: 0.3rem 0; }
.knob-label { font-family: var(--font-ui); font-size: 12px; color: var(--text);
              padding-top: 0.35rem; }
.knob-help { font-size: 11px; color: var(--text-dim); display: block; letter-spacing: 0.02em; }
.knob-input input[type="text"], .knob-input input[type="number"], .knob-input select {
  background: var(--bg); border: 1px solid var(--bg-border); border-radius: var(--radius-input);
  color: var(--text); font-family: var(--font-mono); font-size: 12px;
  padding: 0.35rem 0.6rem; width: 100%; max-width: 420px; outline: none;
}
.knob-input textarea {
  background: var(--bg); border: 1px solid var(--bg-border); border-radius: var(--radius-input);
  color: var(--text); font-family: var(--font-mono); font-size: 12px; line-height: 1.5;
  padding: 0.35rem 0.6rem; width: 100%; min-height: 56px; resize: vertical; outline: none;
}
.knob-default-hint { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); display: block;
                     margin-top: 2px; word-break: break-all; }
.btn-reset { font-size: 11px; padding: 0.2rem 0.45rem; }
.decl-error { font-family: var(--font-ui); font-size: 11px; color: var(--danger);
              padding: 0.2rem 0; }
details.advanced summary { font-family: var(--font-ui); font-size: 11px;
  color: var(--text-dim); cursor: pointer; letter-spacing: 0.06em; padding: 0.3rem 0; }
.note-textarea { width: 100%; min-height: 56px; background: var(--bg);
  border: 1px solid var(--bg-border); border-radius: var(--radius-input); color: var(--text);
  font-family: var(--font-ui); font-size: 13px; line-height: 1.5;
  padding: 0.4rem 0.6rem; resize: vertical; outline: none; }
.backdrop-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 0.6rem;
                align-items: start; padding: 0.35rem 0; }
.bd-thumb { width: 96px; border-radius: var(--radius); border: 1px solid var(--bg-border);
            display: block; }
.bd-name { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim);
           margin-bottom: 0.25rem; letter-spacing: 0; }
.bd-main textarea { width: 100%; min-height: 48px; background: var(--bg);
  border: 1px solid var(--bg-border); border-radius: var(--radius-input); color: var(--text);
  font-family: var(--font-ui); font-size: 12px; line-height: 1.5;
  padding: 0.4rem 0.6rem; resize: vertical; outline: none; }
.stale-badge { color: var(--danger); font-size: 11px; margin-left: 0.4rem; }
