:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #6366f1;
  --ok: #10b981;
  --err: #f87171;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); }
a { color: #a5b4fc; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--panel); border-right: 1px solid var(--border); padding: 1rem; flex-shrink: 0; }
.sidebar nav a { display: block; padding: 0.5rem 0.75rem; border-radius: 8px; color: var(--muted); text-decoration: none; margin-bottom: 4px; }
.sidebar nav a:hover, .sidebar nav a.active { background: #334155; color: var(--text); }
.main { flex: 1; padding: 1.5rem 2rem; overflow: auto; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; margin-bottom: 1rem; }
h2 { margin-top: 0; font-size: 1.25rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
.btn { display: inline-block; padding: 0.45rem 1rem; border-radius: 8px; border: none; cursor: pointer; font-size: 0.9rem; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: #475569; color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8rem; }
input, select, textarea { width: 100%; padding: 0.5rem; border-radius: 8px; border: 1px solid var(--border); background: #0f172a; color: var(--text); margin-top: 0.25rem; }
label { display: block; margin-bottom: 0.75rem; font-size: 0.85rem; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.flash { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.flash.ok { background: #064e3b; color: #6ee7b7; }
.flash.err { background: #7f1d1d; color: #fca5a5; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; }
.badge-running { background: #1e3a8a; color: #93c5fd; }
.badge-draft { background: #374151; color: #d1d5db; }
.badge-completed { background: #065f46; color: #6ee7b7; }
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { max-width: 420px; width: 100%; }
.stats { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.stat strong { font-size: 1.5rem; display: block; }
.hint { font-size: 0.85rem; color: var(--muted); }
.err { color: var(--err); }
.ok { color: var(--ok); }
code { background: #0f172a; padding: 2px 6px; border-radius: 4px; font-size: 0.85rem; word-break: break-all; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-header h2 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.page-header-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.live-pill { font-size: 0.75rem; padding: 0.35rem 0.75rem; border-radius: 999px; background: #334155; color: #64748b; transition: all 0.3s; }
.live-pill.active { background: #312e81; color: #a5b4fc; box-shadow: 0 0 12px rgba(99, 102, 241, 0.5); animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: 0.7; } }
.campaigns-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.campaign-card { background: linear-gradient(145deg, #1e293b 0%, #172033 100%); border: 1px solid var(--border); border-radius: 14px; padding: 1.15rem; transition: box-shadow 0.2s, border-color 0.2s; }
.campaign-card:hover { border-color: #475569; box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.campaign-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.campaign-title { margin: 0; font-size: 1.05rem; color: #f1f5f9; }
.campaign-meta, .campaign-subject { font-size: 0.8rem; color: var(--muted); margin: 0.35rem 0 0; }
.campaign-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 1rem 0; }
.cstat { text-align: center; padding: 0.5rem; border-radius: 8px; }
.cstat-sent { background: rgba(16, 185, 129, 0.12); }
.cstat-fail { background: rgba(248, 113, 113, 0.12); }
.cstat-pend { background: rgba(56, 189, 248, 0.12); }
.cstat-num { display: block; font-size: 1.35rem; font-weight: 700; }
.cstat-sent .cstat-num { color: #34d399; }
.cstat-fail .cstat-num { color: #f87171; }
.cstat-pend .cstat-num { color: #38bdf8; }
.cstat-lbl { font-size: 0.65rem; text-transform: uppercase; color: var(--muted); }
.progress-wrap { height: 8px; background: #0f172a; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #10b981); transition: width 0.35s ease; }
.progress-label { font-size: 0.75rem; color: var(--muted); margin: 0.35rem 0 0.75rem; }
.campaign-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.campaign-logs { margin-top: 0.75rem; max-height: 200px; overflow: auto; }
.campaign-logs.hidden { display: none; }
.log-mini { font-size: 0.75rem; }
.log-mini td, .log-mini th { padding: 0.35rem; }
.badge-paused { background: #78350f; color: #fcd34d; }
.badge-error { background: #7f1d1d; color: #fca5a5; }
.hidden { display: none !important; }
.empty-msg { color: var(--muted); padding: 2rem; text-align: center; grid-column: 1 / -1; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert.info { background: #1e3a5f; color: #93c5fd; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.smtp-test-form label { display: block; margin-bottom: 0.5rem; }
.smtp-test-results table { margin-top: 0.75rem; }
.inline-label { margin-bottom: 0; flex: 1; min-width: 200px; }
.list-chip { display: inline-flex; align-items: center; margin: 0 0.5rem 0.5rem 0; }
.list-del { margin-left: 0.25rem; color: var(--err); text-decoration: none; font-size: 1.1rem; line-height: 1; }
.form-actions-span { grid-column: 1 / -1; }
.template-list { margin: 0; padding-left: 1.25rem; }
.template-list li { margin: 0.35rem 0; }
.link-danger { color: var(--err); margin-left: 0.5rem; font-size: 0.85rem; }
.template-form textarea { min-height: 280px; }
.template-toolbar { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.nav-badge { display: inline-block; min-width: 1.1rem; padding: 0 0.35rem; border-radius: 999px; background: #dc2626; color: #fff; font-size: 0.7rem; text-align: center; }
.card-warn { border-color: #b45309; }
.cell-small { font-size: 0.8rem; color: var(--muted); max-width: 280px; word-break: break-word; }
.card-alert { font-size: 0.85rem; color: #fcd34d; background: rgba(120, 53, 15, 0.25); padding: 0.5rem 0.75rem; border-radius: 8px; margin: 0.5rem 0; }
.stat-grid-5 { grid-template-columns: repeat(5, 1fr); }
.stat-box.open { background: rgba(167, 139, 250, 0.15); }
.stat-box.open .stat-num { color: #c4b5fd; }
@media (max-width: 900px) { .stat-grid-5 { grid-template-columns: repeat(2, 1fr); } }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .campaigns-grid { grid-template-columns: 1fr; }
}

/* Mail tester */
.page-header-hint { flex: 1 1 100%; margin: 0; max-width: 720px; }
.mt-result-head .mt-disclaimer { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--border); }
.mt-score-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.mt-score {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  padding: 1rem 1.5rem;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: #0f172a;
}
.mt-score--good { border-color: #059669; background: rgba(16, 185, 129, 0.08); }
.mt-score--mid { border-color: #d97706; background: rgba(245, 158, 11, 0.08); }
.mt-score--low { border-color: #dc2626; background: rgba(248, 113, 113, 0.08); }
.mt-score-num { font-size: 2.75rem; font-weight: 800; line-height: 1; }
.mt-score--good .mt-score-num { color: #34d399; }
.mt-score--mid .mt-score-num { color: #fbbf24; }
.mt-score--low .mt-score-num { color: #f87171; }
.mt-score-max { font-size: 1.1rem; color: var(--muted); }
.mt-grade { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.35rem; }
.mt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }
.mt-section h3 { margin-top: 0; font-size: 1rem; color: #c7d2fe; }
.mt-section--wide { grid-column: 1 / -1; }
.mt-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; margin-right: 0.35rem; }
.mt-badge--ok { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.mt-badge--warn { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.mt-record {
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-all;
  background: #0f172a;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  max-height: 120px;
  overflow: auto;
}
.mt-list { margin: 0.35rem 0; padding-left: 1.25rem; }
.mt-section .flash { margin-top: 0.5rem; }
.sa-fixes { margin: 1rem 0; padding: 0.75rem 1rem; background: rgba(30, 41, 59, 0.5); border-radius: 8px; border-left: 3px solid #f59e0b; }
.sa-fixes ol { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.sa-fixes li { margin-bottom: 0.35rem; }
.sa-details summary { cursor: pointer; color: #93c5fd; margin-top: 0.75rem; }
.sa-report h3 { margin-top: 0; }
.sa-scale-hint { margin: 0 0 1rem; padding: 0.5rem 0.75rem; background: rgba(30, 41, 59, 0.4); border-radius: 6px; }
.sa-report .mt-score-max { display: block; font-size: 0.85rem; margin-top: 0.15rem; }
.cl-section { margin: 1rem 0 0.35rem; font-size: 0.95rem; color: #cbd5e1; }
.cl-table { width: 100%; font-size: 0.9rem; margin-bottom: 0.5rem; }
.cl-table td:first-child { max-width: 14rem; }
.cl-badge { display: inline-block; padding: 0.1rem 0.45rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.cl-ok { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.cl-fail { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.cl-warn { background: rgba(245, 158, 11, 0.25); color: #fcd34d; }
.cl-auto { background: rgba(59, 130, 246, 0.25); color: #93c5fd; }
.cl-info { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.mt-details-heading { margin: 1.5rem 0 0.35rem; font-size: 1.1rem; }

/* Nawigacja boczna — grupy */
.nav-label {
  margin: 1rem 0 0.35rem 0.85rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}
.sidebar-nav .nav-label:first-child { margin-top: 0.25rem; }
.nav-logout { margin-top: 0.75rem; color: #94a3b8 !important; }

/* Pasek kroków (workflow) */
.workflow-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.65rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
}
.workflow-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
  font-size: 0.85rem;
}
.workflow-step:hover { color: var(--text); background: rgba(51, 65, 85, 0.45); }
.workflow-step.is-active {
  color: #fff;
  border-color: rgba(6, 182, 212, 0.45);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.5), rgba(6, 182, 212, 0.35));
}
.workflow-step.is-done { color: #86efac; }
.workflow-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.8);
}
.workflow-step.is-active .workflow-num { background: rgba(255, 255, 255, 0.2); }
.help-details { margin-top: 1rem; }
.help-details summary {
  cursor: pointer;
  color: #93c5fd;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}
.help-details[open] summary { margin-bottom: 0.5rem; }
.help-details .hint { margin: 0.35rem 0; }
.step-card {
  border-left: 3px solid rgba(6, 182, 212, 0.55);
  padding-left: 0.85rem;
  margin-bottom: 1rem;
}
.step-card h3 { margin-top: 0; }
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.app-panel-layout,
.lists-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.lists-sidebar,
.app-sidebar { margin-bottom: 0; padding: 1rem; }
.lists-main,
.app-main { min-width: 0; }
.lists-sidebar-title { margin: 0 0 0.75rem; font-size: 0.95rem; color: #c7d2fe; }
.lists-new-form input { margin-top: 0; }
.lists-nav { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.lists-nav-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.35rem;
  border-radius: 10px;
  border: 1px solid transparent;
}
.lists-nav-item.is-active {
  border-color: rgba(6, 182, 212, 0.45);
  background: rgba(6, 182, 212, 0.08);
}
.lists-nav-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 10px;
}
.lists-nav-link:hover { background: rgba(51, 65, 85, 0.5); }
.lists-nav-name { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lists-nav-count {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  color: var(--muted);
}
.lists-nav-item.is-active .lists-nav-count { background: rgba(6, 182, 212, 0.25); color: #e0f2fe; }
.lists-nav-del {
  padding: 0.35rem 0.5rem;
  color: var(--err);
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.7;
}
.lists-nav-del:hover { opacity: 1; }
.lists-head-card { margin-bottom: 1rem; }
.lists-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.lists-current-name { margin: 0 0 0.35rem; font-size: 1.25rem; }
.lists-head-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}
.tab-nav-link {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.tab-nav-link:hover { color: var(--text); background: rgba(51, 65, 85, 0.45); }
.tab-nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.85), rgba(6, 182, 212, 0.65));
  border-color: rgba(6, 182, 212, 0.35);
}
.card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.card-toolbar h3 { margin: 0; }
.empty-state, .empty-state-inline { text-align: center; padding: 1.5rem 1rem; }
.empty-state-inline p { margin-bottom: 0.75rem; }
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
.table-wrap table { margin: 0; }
.table-wrap th { background: rgba(15, 23, 42, 0.65); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.cell-email { font-size: 0.85rem; }
.form-grid--4 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.import-drop .file-label { display: block; margin: 0.75rem 0; }
.file-label-text { display: block; margin-bottom: 0.35rem; color: var(--muted); font-size: 0.85rem; }
.export-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.export-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1rem 1.15rem !important;
  text-align: left;
}
.export-card strong { font-size: 1rem; color: #fff; }
.export-card .hint { margin: 0; }
.recipients-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.recipients-search { flex: 1; min-width: 200px; margin-bottom: 0; }
.recipients-meta { margin: 0 0 0.75rem; }
.cell-num { color: var(--muted); font-size: 0.8rem; width: 2.5rem; }
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.pagination-info { color: var(--muted); font-size: 0.9rem; }
.sidebar-quicklink {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #93c5fd;
}

/* Statusy odbiorców */
.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-badge--active { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.status-badge--unsub { background: rgba(251, 191, 36, 0.2); color: #fde68a; }
.status-badge--fail { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.status-badge--muted { background: rgba(100, 116, 139, 0.35); color: #cbd5e1; }
.status-legend { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.stat-big { font-size: 2rem; font-weight: 700; margin: 0.25rem 0 0; }

/* Edytor szablonów — pełna szerokość */
.template-studio { width: 100%; max-width: none; }
.template-studio-top { margin-bottom: 1rem; padding: 1rem; }
.template-studio-pick { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; margin-bottom: 0.75rem; }
.template-select-label { flex: 1 1 280px; margin: 0; }
.template-select { width: 100%; max-width: 100%; }
.template-studio-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.template-studio-body { padding: 1rem; background: var(--card, rgba(15, 23, 42, 0.6)); border-radius: 14px; border: 1px solid var(--border); }
.template-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }
.template-view-tabs { margin-left: auto; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.template-view-tabs .is-active { border-color: rgba(6, 182, 212, 0.6); background: rgba(6, 182, 212, 0.15); }
.template-editor-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  min-height: min(72vh, 720px);
}
.template-editor-layout[data-view="code"] { grid-template-columns: 1fr; }
.template-editor-layout[data-view="code"] .template-pane-preview { display: none; }
.template-editor-layout[data-view="preview"] { grid-template-columns: 1fr; }
.template-editor-layout[data-view="preview"] .template-pane-code { display: none; }
.template-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pane-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; }
.template-html-input {
  flex: 1;
  min-height: 420px;
  width: 100%;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}
.template-preview-frame {
  flex: 1;
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.lists-nav-name { word-break: break-word; white-space: normal; line-height: 1.25; }
.order-server-form textarea { width: 100%; margin-top: 0.35rem; }
@media (max-width: 900px) {
  .template-editor-layout,
  .template-editor-layout[data-view="split"] { grid-template-columns: 1fr; }
  .template-studio-meta { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .lists-layout,
  .app-panel-layout { grid-template-columns: 1fr; }
  .lists-sidebar,
  .app-sidebar { order: 0; }
  .workflow-bar { flex-direction: column; }
}

/* AI templates */
.ai-preview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr); gap: 1rem; align-items: start; }
.ai-preview-frame { width: 100%; min-height: 620px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.wysiwyg-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-bottom: 0.5rem; }
.wysiwyg-toolbar select { width: auto; min-width: 110px; margin-top: 0; padding: 0.35rem; }
.wysiwyg-color { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; color: var(--muted); }
.wysiwyg-color input { width: 42px; height: 32px; padding: 2px; margin: 0; }
@media (max-width: 1000px) { .ai-preview-grid { grid-template-columns: 1fr; } }

/* Final visual polish */
:root {
  --bg: #08111f;
  --panel: rgba(15, 23, 42, 0.88);
  --panel-strong: #111c30;
  --border: rgba(148, 163, 184, 0.22);
  --text: #eef4ff;
  --muted: #a8b6cc;
  --accent: #7c3aed;
  --accent-2: #06b6d4;
  --ok: #22c55e;
  --err: #fb7185;
}
body {
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.22), transparent 36rem),
    radial-gradient(circle at 78% 12%, rgba(6, 182, 212, 0.16), transparent 34rem),
    linear-gradient(135deg, #08111f 0%, #111827 52%, #0f172a 100%);
  color: var(--text);
}
.layout { background: rgba(2, 6, 23, 0.16); }
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.94));
  border-right: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 18px 0 40px rgba(0, 0, 0, 0.22);
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: block;
  margin: 0.35rem 0.55rem 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  text-decoration: none;
}
.sidebar-logo {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  object-fit: contain;
}
.auth-logo {
  display: block;
  width: min(100%, 280px);
  max-height: 88px;
  margin: 0 auto 0.75rem;
  object-fit: contain;
}
.sidebar nav a {
  margin-bottom: 0.35rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.sidebar nav a:hover {
  transform: translateX(2px);
  background: rgba(51, 65, 85, 0.78);
  border-color: rgba(148, 163, 184, 0.16);
}
.sidebar nav a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(6, 182, 212, 0.72));
  box-shadow: 0 12px 28px rgba(6, 182, 212, 0.14);
}
.main { padding: 2rem clamp(1rem, 3vw, 3rem); }
.card,
.campaign-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.78));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}
.card:hover { border-color: rgba(148, 163, 184, 0.28); }
h2 { font-size: 1.8rem; letter-spacing: -0.04em; }
h3 { color: #f8fafc; letter-spacing: -0.02em; }
input, select, textarea {
  background: rgba(2, 6, 23, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 11px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(6, 182, 212, 0.72);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.12);
  background: rgba(2, 6, 23, 0.76);
}
.btn {
  border-radius: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  box-shadow: 0 12px 30px rgba(6, 182, 212, 0.18);
}
.btn-secondary {
  background: rgba(71, 85, 105, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.18);
}
.btn-danger {
  background: linear-gradient(135deg, #e11d48, #f97316);
}
table {
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
}
th {
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.92);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
td { background: rgba(15, 23, 42, 0.36); }
tr:hover td { background: rgba(30, 41, 59, 0.52); }
.flash, .alert {
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}
.flash.ok { background: rgba(6, 95, 70, 0.82); }
.flash.err, .alert.err { background: rgba(127, 29, 29, 0.82); }
.badge {
  font-weight: 800;
  letter-spacing: 0.02em;
}
.auth-page {
  background:
    radial-gradient(circle at 20% 20%, rgba(124, 58, 237, 0.26), transparent 28rem),
    radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.18), transparent 30rem),
    #08111f;
}
.auth-card {
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}
.auth-card h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.05em;
}
.provider-pill,
.nav-badge {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.info-box {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text);
}
.info-box-highlight {
  border-color: rgba(6, 182, 212, 0.35);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(6, 182, 212, 0.1));
}
.info-box h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.info-box p { margin: 0.45rem 0; }
.info-box ul { margin: 0.5rem 0 0.25rem 1.2rem; color: var(--muted); }
.info-box li { margin: 0.35rem 0; }
.warmup-table-wrap { overflow-x: auto; margin-top: 0.75rem; }
.warmup-schedule-table { width: 100%; font-size: 0.92rem; }
.warmup-schedule-table th:nth-child(2),
.warmup-schedule-table td:nth-child(2) { text-align: right; }
.warmup-schedule-table th:nth-child(3),
.warmup-schedule-table td:nth-child(3) { text-align: right; }
.warmup-week-row td {
  font-weight: 700;
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.08);
  padding-top: 0.85rem;
}
.warmup-post-row td { font-weight: 600; color: #c4b5fd; }
@media (max-width: 768px) {
  .sidebar {
    position: static;
    height: auto;
    width: 100%;
  }
  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }
}
