/* =========================================================
   Aardvark GTM — Marketing Command Centre
   Dark navy + warm gold glassmorphic theme (matches landing)
   ========================================================= */

:root {
  --bg-deep:      #07090f;
  --bg-dark:      #0a0e1a;
  --bg-dark2:     #1a1f2e;
  --bg-card:      rgba(255,255,255,0.04);
  --bg-card-hov:  rgba(255,255,255,0.08);
  --gold:         #c9a84c;
  --gold-light:   #e2c277;
  --gold-dim:     rgba(201,168,76,0.15);
  --gold-glow:    rgba(201,168,76,0.35);
  --green:        #6fcf97;
  --green-dim:    rgba(111,207,151,0.14);
  --red:          #e07a6a;
  --red-dim:      rgba(224,122,106,0.14);
  --blue:         #6ea8dc;
  --blue-dim:     rgba(110,168,220,0.14);
  --text-primary: #f0ede8;
  --text-muted:   #8b8fa8;
  --text-dim:     #5a5e72;
  --border:       rgba(201,168,76,0.18);
  --border-subtle: rgba(255,255,255,0.07);
  --nav-h:        64px;
  --radius:       14px;
  --radius-sm:    8px;
  --shadow-gold:  0 0 40px rgba(201,168,76,0.12);
  --transition:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(201,168,76,0.07), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(110,168,220,0.05), transparent 60%),
    linear-gradient(160deg, var(--bg-dark) 0%, var(--bg-deep) 55%, #0b0f1c 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }
ul { list-style: none; }
h1,h2,h3,h4 { font-family: 'Outfit', sans-serif; line-height: 1.25; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; font-size: 0.9rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 12px;
  outline: none;
  transition: border var(--transition), background var(--transition);
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); background: rgba(255,255,255,0.07); }
select option { background: var(--bg-dark2); color: var(--text-primary); }
::placeholder { color: var(--text-dim); }

/* ── Glass card ─────────────────────────────────────────── */
.glass {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.glass-gold { border-color: var(--border); box-shadow: var(--shadow-gold); }

/* ── Topbar ─────────────────────────────────────────────── */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 900;
  background: rgba(7,9,15,0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 28px; padding: 0 22px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; object-fit: contain;
  display: block; flex-shrink: 0;
  box-shadow: 0 0 18px rgba(201,168,76,0.35);
}
.brand-text { font-family: 'Outfit', sans-serif; font-size: 1.02rem; color: var(--text-primary); letter-spacing: 0.02em; }
.brand-text b { color: var(--gold); font-weight: 700; }
#main-nav { display: flex; gap: 4px; flex: 1; }
#main-nav a {
  font-family: 'Outfit', sans-serif; font-size: 0.86rem; font-weight: 500;
  color: var(--text-muted); padding: 8px 14px; border-radius: 100px;
  transition: all var(--transition);
}
#main-nav a:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
#main-nav a.active { color: var(--gold-light); background: var(--gold-dim); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.day-chip {
  font-family: 'Outfit', sans-serif; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em;
  color: var(--gold-light); background: var(--gold-dim); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 100px; white-space: nowrap;
}
.sync-chip { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; }
.sync-chip.ok { color: var(--green); }
.sync-chip.local { color: var(--blue); }
.sync-chip.err { color: var(--red); }
#nav-burger { display: none; background: none; border: none; flex-direction: column; gap: 5px; padding: 6px; }
#nav-burger span { width: 22px; height: 2px; background: var(--gold); border-radius: 2px; }

/* ── Layout ─────────────────────────────────────────────── */
#app { max-width: 1280px; margin: 0 auto; padding: calc(var(--nav-h) + 28px) 22px 60px; }
.view { display: none; animation: fadeIn 0.3s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-head { margin-bottom: 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.7rem; font-weight: 700; }
.page-head p { color: var(--text-muted); font-size: 0.92rem; max-width: 640px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card { padding: 20px 22px; }
.card h3 {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card h3 .h3-side { color: var(--text-dim); letter-spacing: 0; text-transform: none; font-weight: 500; font-size: 0.75rem; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 0.88rem;
  border-radius: 100px; padding: 10px 22px; border: 1px solid transparent;
  transition: all var(--transition);
}
.btn-gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #07090f; }
.btn-gold:hover { box-shadow: 0 0 24px var(--gold-glow); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--gold-light); }
.btn-outline:hover { background: var(--gold-dim); }
.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-ghost-sm {
  background: none; border: 1px solid var(--border-subtle); color: var(--text-muted);
  font-size: 0.75rem; border-radius: 100px; padding: 5px 12px; transition: all var(--transition);
}
.btn-ghost-sm:hover { color: var(--text-primary); border-color: var(--border); }
.btn-danger-sm {
  background: none; border: none; color: var(--text-dim); font-size: 0.85rem; padding: 2px 6px; border-radius: 6px;
}
.btn-danger-sm:hover { color: var(--red); background: var(--red-dim); }
.copy-btn {
  background: var(--gold-dim); border: 1px solid var(--border); color: var(--gold-light);
  font-size: 0.72rem; font-weight: 600; border-radius: 100px; padding: 4px 12px;
  transition: all var(--transition);
}
.copy-btn:hover { background: rgba(201,168,76,0.3); }

/* ── Progress bars & rings ─────────────────────────────── */
.pbar { height: 8px; background: rgba(255,255,255,0.06); border-radius: 100px; overflow: hidden; }
.pbar > i {
  display: block; height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 0.5s ease;
}
.pbar.green > i { background: linear-gradient(90deg, #4daa74, var(--green)); }
.pbar-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.pbar-row .pbar { flex: 1; }
.pbar-label { font-size: 0.82rem; color: var(--text-muted); min-width: 150px; }
.pbar-pct { font-size: 0.8rem; color: var(--gold-light); font-weight: 600; min-width: 40px; text-align: right; }

.stat-big { font-family: 'Outfit', sans-serif; font-size: 1.9rem; font-weight: 700; color: var(--text-primary); }
.stat-big small { font-size: 0.95rem; color: var(--text-muted); font-weight: 400; }
.stat-sub { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }
.stat-target { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }
.stat-target b { color: var(--gold-light); }

/* ── Tasks / plan ───────────────────────────────────────── */
.phase { margin-bottom: 20px; overflow: hidden; }
.phase-head {
  display: flex; align-items: center; gap: 14px; padding: 16px 22px; cursor: pointer;
  user-select: none;
}
.phase-head h2 { font-size: 1.05rem; font-weight: 600; flex: 1; }
.phase-head .phase-meta { font-size: 0.78rem; color: var(--text-muted); }
.phase-head .chev { color: var(--gold); transition: transform var(--transition); font-size: 0.8rem; }
.phase.open .chev { transform: rotate(90deg); }
.phase-body { display: none; padding: 0 22px 18px; }
.phase.open .phase-body { display: block; }
.week-block { margin: 14px 0; }
.week-block h4 {
  font-size: 0.8rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 8px;
}
.task {
  display: flex; align-items: flex-start; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.task:hover { background: rgba(255,255,255,0.03); }
.task input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; width: 19px; height: 19px; margin-top: 2px;
  border: 1.5px solid var(--text-dim); border-radius: 6px; cursor: pointer; position: relative;
  transition: all var(--transition);
}
.task input[type="checkbox"]:checked { background: var(--gold); border-color: var(--gold); }
.task input[type="checkbox"]:checked::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #07090f; font-size: 0.75rem; font-weight: 800;
}
.task-main { flex: 1; min-width: 0; }
.task-toggle {
  width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  background: none; border: none; padding: 0; text-align: left; color: inherit;
}
.task-label { font-size: 0.9rem; color: var(--text-primary); line-height: 1.5; }
.task.done .task-label { color: var(--text-dim); text-decoration: line-through; }
.task-right { display: flex; align-items: center; gap: 10px; white-space: nowrap; flex: none; }
.note-dot { color: var(--gold); font-size: 0.78rem; }
.task-ref { font-size: 0.7rem; color: var(--text-dim); }
.see-details { font-size: 0.72rem; color: var(--gold); font-family: 'Outfit', sans-serif; font-weight: 500; }
.see-details i { display: inline-block; font-style: normal; transition: transform var(--transition); }
.task-toggle.open .see-details i { transform: rotate(90deg); }
.task-toggle:hover .see-details { color: var(--gold-light); }
@media (max-width: 720px) { .task-ref { display: none; } }

/* Task how-to detail panel */
.task-detail {
  margin: 12px 0 6px; padding: 16px 18px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold); border-radius: var(--radius-sm);
  font-size: 0.86rem; line-height: 1.6;
}
.task-detail h5 {
  font-family: 'Outfit', sans-serif; font-size: 0.74rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-light);
  margin: 14px 0 6px;
}
.task-detail h5:first-child { margin-top: 0; }
.task-detail p { color: var(--text-muted); margin: 6px 0; }
.task-detail ol, .task-detail ul { margin: 6px 0 6px 18px; }
.task-detail li { margin: 5px 0; color: var(--text-muted); }
.task-detail b { color: var(--text-primary); }
.task-detail a { word-break: break-word; }
.task-detail code {
  background: rgba(0,0,0,0.35); padding: 1px 6px; border-radius: 4px;
  font-size: 0.82em; color: var(--gold-light);
}
.snippet { position: relative; margin: 8px 0; }
.snippet pre {
  background: rgba(0,0,0,0.4); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  padding: 12px 14px; padding-right: 64px; overflow-x: auto;
  font-family: 'Consolas', monospace; font-size: 0.78rem; color: var(--text-primary);
  white-space: pre-wrap; word-break: break-word;
}
.snippet .copy-btn { position: absolute; top: 8px; right: 8px; }
.task-note-wrap { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.task-note-wrap label { display: block; font-size: 0.72rem; color: var(--text-dim); margin-bottom: 5px; }
.task-note { width: 100%; margin: 0; font-size: 0.82rem; min-height: 44px; resize: vertical; }

/* Native date picker on dark theme */
input[type="date"] { color-scheme: dark; }

/* ── Tables ─────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th {
  text-align: left; font-family: 'Outfit', sans-serif; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted);
  padding: 8px 10px; border-bottom: 1px solid var(--border-subtle);
}
td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--text-primary); vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,0.02); }
td input { width: 90px; padding: 5px 8px; font-size: 0.84rem; }
td input.wide { width: 100%; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.t-muted { color: var(--text-muted); }
.t-warn { color: #ffb020; }
.t-good { color: #4ade80; }
.warn-box {
  border: 1px solid rgba(255, 176, 32, .45);
  background: rgba(255, 176, 32, .08);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 12px 0;
}
.warn-box > :first-child { margin-top: 0; }
.warn-box > :last-child { margin-bottom: 0; }
.t-gold { color: var(--gold-light); }
.t-green { color: var(--green); }
.t-red { color: var(--red); }
.pill {
  display: inline-block; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.05em;
  border-radius: 100px; padding: 2px 10px; text-transform: uppercase;
}
.pill.gold { background: var(--gold-dim); color: var(--gold-light); border: 1px solid var(--border); }
.pill.green { background: var(--green-dim); color: var(--green); }
.pill.red { background: var(--red-dim); color: var(--red); }
.pill.blue { background: var(--blue-dim); color: var(--blue); }

/* ── Playbook ───────────────────────────────────────────── */
.pb-section { margin-bottom: 18px; overflow: hidden; }
.pb-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; cursor: pointer; user-select: none; }
.pb-head h2 { font-size: 1rem; font-weight: 600; flex: 1; }
.pb-head .chev { color: var(--gold); transition: transform var(--transition); font-size: 0.8rem; }
.pb-section.open .pb-head .chev { transform: rotate(90deg); }
.pb-body { display: none; padding: 4px 22px 20px; color: var(--text-primary); font-size: 0.9rem; }
.pb-section.open .pb-body { display: block; }
.pb-body h4 { color: var(--gold-light); font-size: 0.92rem; margin: 16px 0 8px; }
.pb-body p { margin: 8px 0; color: var(--text-muted); }
.pb-body p b, .pb-body li b { color: var(--text-primary); }
.pb-body ul { margin: 8px 0 8px 4px; }
.pb-body li { margin: 5px 0; padding-left: 18px; position: relative; color: var(--text-muted); }
.pb-body li::before { content: "◆"; position: absolute; left: 0; top: 1px; color: var(--gold); font-size: 0.6rem; }
.pb-body table { margin: 10px 0; }
.tpl {
  position: relative; background: rgba(255,255,255,0.03); border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold); border-radius: var(--radius-sm);
  padding: 16px 18px; margin: 12px 0; white-space: pre-wrap;
  font-size: 0.86rem; color: var(--text-primary); line-height: 1.65;
}
.tpl-head { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 6px; }
.tpl-head span { font-size: 0.82rem; font-weight: 600; color: var(--gold-light); font-family: 'Outfit', sans-serif; }

/* ── Tools ──────────────────────────────────────────────── */
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.tool-link {
  display: flex; flex-direction: column; gap: 3px; padding: 13px 15px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); transition: all var(--transition);
}
.tool-link:hover { border-color: var(--border); background: var(--gold-dim); transform: translateY(-2px); }
.tool-link b { font-size: 0.88rem; color: var(--text-primary); font-family: 'Outfit', sans-serif; font-weight: 600; }
.tool-link span { font-size: 0.72rem; color: var(--text-muted); }
.webhook-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); flex-wrap: wrap; }
.webhook-info { flex: 1; min-width: 200px; }
.webhook-info b { font-size: 0.9rem; }
.webhook-info span { display: block; font-size: 0.72rem; color: var(--text-dim); word-break: break-all; }
.webhook-result {
  width: 100%; font-size: 0.76rem; font-family: monospace; color: var(--text-muted);
  background: rgba(0,0,0,0.3); border-radius: var(--radius-sm); padding: 10px 12px;
  max-height: 160px; overflow: auto; white-space: pre-wrap;
}
.form-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.form-row input, .form-row select { flex: 1; min-width: 140px; }
.form-row textarea { flex-basis: 100%; min-height: 60px; font-family: monospace; font-size: 0.8rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-subtle);
  border-radius: 100px; padding: 4px 6px 4px 12px;
}
.chip button { background: none; border: none; color: var(--text-dim); font-size: 0.9rem; padding: 0 5px; }
.chip button:hover { color: var(--red); }

/* ── Charts ─────────────────────────────────────────────── */
.chart-wrap { width: 100%; overflow-x: auto; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-legend { display: flex; gap: 18px; margin-top: 8px; flex-wrap: wrap; }
.chart-legend span { font-size: 0.75rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ── Dashboard specials ────────────────────────────────── */
.rules-list li { font-size: 0.88rem; color: var(--text-primary); margin: 10px 0; padding-left: 26px; position: relative; }
.rules-list li::before {
  content: attr(data-n); position: absolute; left: 0; top: 1px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--gold-dim);
  color: var(--gold-light); font-size: 0.68rem; font-weight: 700;
  display: grid; place-items: center; border: 1px solid var(--border);
}
.next-task { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-size: 0.87rem; }
.next-task .dot { color: var(--gold); margin-top: 1px; }
.next-task .nt-meta { color: var(--text-dim); font-size: 0.72rem; white-space: nowrap; margin-top: 2px; }
#quick-notes { width: 100%; min-height: 120px; resize: vertical; font-size: 0.88rem; line-height: 1.6; }

/* ── Login ──────────────────────────────────────────────── */
.login-overlay {
  position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center;
  background: rgba(7,9,15,0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.login-card { width: min(380px, 92vw); padding: 40px 34px; text-align: center; border-color: var(--border); box-shadow: var(--shadow-gold); }
.login-logo { font-family: 'Outfit', sans-serif; font-size: 1.5rem; font-weight: 700; }
.login-logo span { color: var(--gold); }
.login-sub { color: var(--text-muted); font-size: 0.82rem; margin: 6px 0 24px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-error { color: var(--red); font-size: 0.8rem; margin-top: 12px; }
.login-card .btn-ghost-sm { margin-top: 18px; }

/* ── Network (warm-network activation) ─────────────────── */
.t-dim { color: var(--text-dim); }
.net-table td { padding: 7px 8px; }
.net-table td input, .net-table td select { font-size: 0.8rem; padding: 5px 8px; }
.net-table tr.net-blocked td { opacity: 0.55; }
.net-table tr.net-blocked td:first-child b { color: var(--red); }
.net-status-cell { min-width: 148px; vertical-align: top; }
.net-status { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.net-status .pill { white-space: nowrap; }
.net-status-sub { font-size: 0.68rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.net-check {
  display: flex; align-items: center; gap: 6px; margin-top: 6px; width: fit-content;
  font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; cursor: pointer;
}
.net-check:hover { color: var(--text-primary); }
.net-check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; width: 15px; height: 15px; margin: 0;
  background: rgba(255,255,255,0.04); border: 1.5px solid var(--text-dim); border-radius: 4px;
  cursor: pointer; position: relative; transition: all var(--transition);
}
.net-check input[type="checkbox"]:hover { border-color: var(--gold); }
.net-check input[type="checkbox"]:checked { background: var(--gold); border-color: var(--gold); }
.net-check input[type="checkbox"]:checked::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #07090f; font-size: 0.62rem; font-weight: 800;
}
.net-table .net-outcome { display: block; margin-top: 6px; font-size: 0.72rem; padding: 3px 6px; }
.net-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.net-pager-btns { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.net-pagebtn {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-subtle); color: var(--text-muted);
  font-size: 0.78rem; font-family: 'Outfit', sans-serif; border-radius: 7px; padding: 5px 10px; min-width: 32px;
  transition: all var(--transition);
}
.net-pagebtn:hover:not(:disabled) { color: var(--text-primary); border-color: var(--border); background: var(--gold-dim); }
.net-pagebtn.active { background: var(--gold-dim); border-color: var(--border); color: var(--gold-light); font-weight: 600; }
.net-pagebtn:disabled { opacity: 0.35; cursor: default; }
.net-ellipsis { color: var(--text-dim); padding: 0 2px; }
.tpl-row { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); margin: 8px 0; overflow: hidden; }
.tpl-row-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer;
  user-select: none; font-size: 0.86rem; flex-wrap: wrap;
}
.tpl-row-head:hover { background: rgba(255,255,255,0.03); }
.tpl-row-head .chev { color: var(--gold); font-size: 0.7rem; transition: transform var(--transition); }
.tpl-row.open .chev { transform: rotate(90deg); }
.tpl-row-body { padding: 4px 14px 14px; border-top: 1px solid var(--border-subtle); }
.modal-overlay {
  position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center;
  background: rgba(7,9,15,0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 20px; overflow-y: auto;
}
.modal-card { width: min(680px, 96vw); max-height: 92vh; overflow-y: auto; padding: 22px 24px; border-color: var(--border); box-shadow: var(--shadow-gold); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-card label { font-size: 0.76rem; color: var(--text-muted); }
.modal-card label input, .modal-card label select { display: block; width: 100%; margin-top: 3px; font-size: 0.86rem; }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 3000;
  background: rgba(20,24,38,0.95); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: 100px; padding: 10px 22px; font-size: 0.85rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5); transition: opacity 0.3s ease;
}
.hidden { display: none !important; }

/* ── Footer ─────────────────────────────────────────────── */
#footer {
  max-width: 1280px; margin: 0 auto; padding: 18px 22px 34px;
  display: flex; gap: 18px; flex-wrap: wrap;
  color: var(--text-dim); font-size: 0.76rem;
  border-top: 1px solid var(--border-subtle);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  #main-nav {
    position: fixed; top: var(--nav-h); left: 0; right: 0; flex-direction: column;
    background: rgba(7,9,15,0.97); padding: 12px 20px 20px; gap: 6px;
    border-bottom: 1px solid var(--border-subtle);
    display: none;
  }
  #main-nav.open { display: flex; }
  #nav-burger { display: flex; }
  .topbar-inner { gap: 12px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .day-chip { display: none; }
  #app { padding-top: calc(var(--nav-h) + 18px); }
  td input { width: 64px; }
}
