/* ══════════════════════════════════════════════════════════════
   Tendery Admin — premium dark console
   Linear / Stripe-dashboard inspired. All class hooks preserved.
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0a0e18;
  --bg-soft: #0d1322;
  --card: #101828;
  --card-2: #131c31;
  --border: rgba(148, 163, 184, 0.13);
  --border-strong: rgba(148, 163, 184, 0.24);
  --text: #e8edf7;
  --muted: #8b96b0;
  --faint: #5c6578;
  --accent: #5b8cff;
  --accent-2: #38bdf8;
  --accent-deep: #3b6fe0;
  --accent-glow: rgba(91, 140, 255, 0.35);
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.12);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.12);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.12);
  --blue-dim: rgba(91, 140, 255, 0.12);
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;
}

* { box-sizing: border-box; }

html { scrollbar-color: #2a3550 var(--bg); }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(91, 140, 255, 0.09), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, rgba(56, 189, 248, 0.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(91, 140, 255, 0.35); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #26314d; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #334163; }

.app { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0c1222 0%, #080d18 100%);
  border-right: 1px solid var(--border);
  color: #c3cede;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { color: #fff; font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.brand-text span { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.4px; font-weight: 600; }

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  background: none;
  border: none;
  color: #a7b1c9;
  text-align: left;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
  position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.22), rgba(56, 189, 248, 0.12));
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(91, 140, 255, 0.35), 0 2px 12px rgba(91, 140, 255, 0.15);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.nav-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon svg { width: 18px; height: 18px; }

.sidebar-footer {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}
.active-offer-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); font-weight: 600; }
.active-offer-name {
  color: #fff; font-weight: 600; margin: 5px 0 9px; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Main layout ─────────────────────────────────────── */
.main { flex: 1; min-width: 0; padding: 0 30px 56px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(180deg, rgba(10, 14, 24, 0.92), rgba(10, 14, 24, 0.78));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.offer-picker-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.offer-picker {
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  min-width: 220px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.offer-picker:hover { border-color: rgba(91, 140, 255, 0.5); }
.offer-picker:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.offer-picker option { background: var(--card); }

.view.hidden, .hidden { display: none !important; }
.view:not(.hidden) { animation: viewIn 0.38s cubic-bezier(0.2, 0.7, 0.3, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { margin: 0; font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; }
.mt { margin-top: 24px; }

.grid-2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; align-items: start; }
.grid-holders { display: grid; grid-template-columns: 1.8fr 1fr; gap: 22px; align-items: start; }
.grid-comms { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
.side-stack { display: flex; flex-direction: column; gap: 22px; }
.grow { min-width: 0; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ── Tables ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  font-weight: 650;
  color: var(--muted);
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background 0.14s ease; }
.table tbody tr:hover { background: rgba(91, 140, 255, 0.05); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.actions-col { width: 90px; text-align: right; }
.empty { padding: 30px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ── Forms ───────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 15px; }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }
.form-group { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.form-group.grow { flex: 1; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.form input, .form select, .form textarea,
.csv-box, .code-box {
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  font-size: 13.5px;
  font-family: inherit;
  background: #0c1222;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.form input::placeholder, .form textarea::placeholder { color: #4d5878; }
.form input:hover, .form select:hover, .form textarea:hover { border-color: rgba(148, 163, 184, 0.35); }
.form input:focus, .form select:focus, .form textarea:focus, .csv-box:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: #0e1526;
}
.form select option { background: var(--card); }
.form-inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.csv-box { width: 100%; font-family: var(--mono); font-size: 12.5px; resize: vertical; }
.code-box { font-family: var(--mono); font-size: 12.5px; resize: vertical; line-height: 1.6; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  padding: 10px 17px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
  letter-spacing: 0.005em;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(91, 140, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(91, 140, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.18); filter: brightness(1.08); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(148, 163, 184, 0.4); }
.btn-warn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1a1206;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}
.btn-warn:hover { filter: brightness(1.07); box-shadow: 0 6px 20px rgba(245, 158, 11, 0.42); }
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { filter: brightness(1.07); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.link-btn {
  background: none; border: none; color: var(--accent-2);
  cursor: pointer; font-size: 13px; font-weight: 600; padding: 3px 5px;
  font-family: inherit; border-radius: 5px;
  transition: color 0.14s, background 0.14s;
}
.link-btn:hover { color: #fff; background: rgba(91, 140, 255, 0.16); text-decoration: none; }

/* ── Badges ──────────────────────────────────────────── */
.status-badge, .elect-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.status-badge::before, .elect-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.status-draft { background: var(--blue-dim); color: #8db4ff; border-color: rgba(91, 140, 255, 0.3); }
.status-live { background: var(--green-dim); color: var(--green); border-color: rgba(52, 211, 153, 0.3); }
.status-closed { background: rgba(148, 163, 184, 0.1); color: var(--muted); border-color: var(--border); }
.elect-elected, .elect-accepted { background: var(--green-dim); color: var(--green); border-color: rgba(52, 211, 153, 0.3); }
.elect-pending { background: var(--amber-dim); color: var(--amber); border-color: rgba(251, 191, 36, 0.3); }
.elect-declined { background: var(--red-dim); color: var(--red); border-color: rgba(248, 113, 113, 0.3); }
.elect-prorated { background: var(--blue-dim); color: #8db4ff; border-color: rgba(91, 140, 255, 0.3); }
.elect-none { background: rgba(148, 163, 184, 0.1); color: var(--muted); border-color: var(--border); }

/* ── Stats ───────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 17px 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(91, 140, 255, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(91, 140, 255, 0.35); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); }
.stat-card:hover::after { opacity: 1; }
.stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.stat-value { font-size: 25px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat-card.stat-elected { border-left: 3px solid var(--green); }
.stat-card.stat-elected .stat-value { color: var(--green); }

.progress {
  height: 10px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 14px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
  min-width: 2%;
  position: relative;
  overflow: hidden;
}
.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shimmer 2.2s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.progress-bar.progress-warn { background: linear-gradient(90deg, #d97706, var(--amber)); }
.legend { display: flex; gap: 18px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.legend b { color: var(--text); font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; box-shadow: 0 0 8px currentColor; }
.dot-elected { background: var(--green); color: var(--green); }
.dot-declined { background: var(--red); color: var(--red); }
.dot-pending { background: var(--amber); color: var(--amber); }

.alert {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.14), rgba(248, 113, 113, 0.07));
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fca5a5;
  border-radius: var(--radius);
  padding: 14px 17px;
  margin-bottom: 20px;
  font-size: 13.5px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: viewIn 0.3s ease;
}
.alert strong { color: #fecaca; }

/* ── Compliance ──────────────────────────────────────── */
.compliance-groups { display: flex; flex-direction: column; gap: 20px; margin-top: 18px; }
.comp-group h3 {
  margin: 0 0 9px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--muted);
  font-weight: 700;
}
.comp-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}
.comp-item:hover { background: rgba(91, 140, 255, 0.06); border-color: rgba(91, 140, 255, 0.3); }
.comp-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  margin: 1px 0 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  background: #0c1222;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.comp-item input[type="checkbox"]:hover { border-color: var(--accent); }
.comp-item input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--green), #10b981);
  border-color: var(--green);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
}
.comp-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px; top: 2.5px;
  width: 5px; height: 9px;
  border: solid #06281c;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(42deg);
}
.comp-item .item-text { flex: 1; font-size: 13.5px; }
.comp-item.done { opacity: 0.62; }
.comp-item.done .item-text { text-decoration: line-through; color: var(--muted); }
.comp-due { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.comp-due.overdue { color: var(--red); font-weight: 700; }

/* ── Communications / templates ──────────────────────── */
.template-list { display: flex; flex-direction: column; gap: 9px; }
.template-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 15px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
  background: rgba(255, 255, 255, 0.015);
}
.template-item:hover { background: rgba(91, 140, 255, 0.06); border-color: rgba(91, 140, 255, 0.35); transform: translateX(2px); }
.template-item.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.14), rgba(56, 189, 248, 0.06));
  box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(91, 140, 255, 0.15);
}
.template-kind { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--accent-2); }
.template-subject { font-size: 13.5px; font-weight: 600; margin-top: 5px; color: var(--text); }

.preview {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 16px;
  background: #0c1222;
  overflow: hidden;
}
.preview-subject { padding: 13px 17px; font-weight: 700; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); font-size: 14px; }
.preview-body { padding: 17px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.7; color: #c9d3e8; }
.divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

/* ── Misc ────────────────────────────────────────────── */
.no-offer { text-align: center; padding: 70px 20px; color: var(--muted); }
.no-offer p { font-size: 15.5px; margin-bottom: 18px; }

.toast {
  position: fixed;
  bottom: 26px;
  right: 26px;
  background: rgba(16, 24, 40, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  padding: 13px 18px 13px 15px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--green);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 300;
  font-size: 13.5px;
  font-weight: 500;
  animation: toastIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  max-width: min(420px, calc(100vw - 52px));
}
.toast.error { border-left-color: var(--red); }
@keyframes toastIn { from { transform: translateY(14px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }

code {
  background: rgba(91, 140, 255, 0.12);
  border: 1px solid rgba(91, 140, 255, 0.22);
  color: #a9c6ff;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 12px;
  font-family: var(--mono);
}

/* ── Documents: modals, deploy groups, variable help ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4, 7, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px; z-index: 200; overflow-y: auto;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-backdrop.hidden { display: none; }
.modal {
  background: linear-gradient(180deg, #141d33, #101828);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  max-width: 720px; width: 100%; padding: 26px;
  animation: modalIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
@keyframes modalIn { from { transform: translateY(16px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 17.5px; font-weight: 700; letter-spacing: -0.01em; }
.modal-meta { margin-bottom: 14px; color: var(--muted); }
.doc-preview {
  white-space: pre-wrap; font-family: Georgia, 'Times New Roman', serif; font-size: 14px; line-height: 1.7;
  background: #0b1120; border: 1px solid var(--border); border-radius: 10px;
  padding: 22px; max-height: 480px; overflow-y: auto; margin: 0 0 18px; color: #d5ddee;
}
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; flex-wrap: wrap; }

.var-help { margin-top: 14px; font-size: 12.5px; }
.var-help summary { cursor: pointer; color: var(--accent-2); font-weight: 600; }
.var-help summary:hover { color: #fff; }
.var-help code { display: block; margin-top: 8px; line-height: 2; white-space: normal; }

.deploy-group { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 9px; background: rgba(255, 255, 255, 0.015); overflow: hidden; }
.deploy-group summary { padding: 13px 17px; cursor: pointer; list-style: none; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; transition: background 0.14s; }
.deploy-group summary::-webkit-details-marker { display: none; }
.deploy-group summary:hover { background: rgba(91, 140, 255, 0.05); }
.deploy-group[open] summary { border-bottom: 1px solid var(--border); background: rgba(91, 140, 255, 0.04); }

.alert-error {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.14), rgba(248, 113, 113, 0.06));
  color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.4);
  padding: 13px 16px; border-radius: 10px; font-size: 13px; line-height: 1.6;
}
.alert-error strong { color: #fecaca; }

.link-danger { color: var(--red); }
.link-danger:hover { color: #fff; background: rgba(248, 113, 113, 0.2); }

/* ── Skeleton shimmer (for future loading states) ────── */
.skeleton {
  position: relative; overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px; color: transparent !important;
  pointer-events: none; user-select: none;
}
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  animation: shimmer 1.5s infinite;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1150px) {
  .grid-2, .grid-holders, .grid-comms { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0;
    flex-direction: row; align-items: center;
    padding: 0 10px; border-right: none; border-bottom: 1px solid var(--border);
  }
  .brand { padding: 12px 10px; border-bottom: none; }
  .brand-mark { width: 32px; height: 32px; font-size: 15px; border-radius: 9px; }
  .brand-text span { display: none; }
  .nav { flex-direction: row; overflow-x: auto; padding: 10px 6px; gap: 6px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { white-space: nowrap; padding: 8px 13px; font-size: 13px; }
  .nav-item.active::before { display: none; }
  .sidebar-footer { display: none; }
  .main { padding: 0 16px 48px; }
  .topbar { padding: 16px 0 12px; flex-wrap: wrap; }
  .topbar h1 { font-size: 19px; }
  .offer-picker { min-width: 0; flex: 1; }
  .form-row { flex-direction: column; }
  .stat-value { font-size: 21px; }
  .modal-backdrop { padding: 24px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
