:root {
  --bg: #f3f5f7;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #111827;
  --accent: #1d4ed8;
  --success: #16a34a;
  --warning: #ca8a04;
  --danger: #dc2626;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Inter', Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: #0f172a; color: #fff; padding: 28px 22px; display: flex; flex-direction: column; justify-content: space-between; }
.brand { font-size: 24px; font-weight: 800; }
.brand-sub { color: #94a3b8; font-size: 13px; margin-top: 8px; }
.menu { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.menu-link { color: #e2e8f0; padding: 12px 14px; border-radius: 12px; transition: 0.2s; }
.menu-link:hover { background: rgba(255,255,255,0.08); }
.sidebar-footer { font-size: 14px; color: #cbd5e1; display: grid; gap: 10px; }
.main-content { flex: 1; padding: 34px; }
.full-width { width: 100%; }
.center-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card, .public-card { width: 100%; max-width: 520px; background: var(--card); border-radius: 22px; box-shadow: 0 20px 60px rgba(0,0,0,0.08); padding: 34px; }
.public-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
h1 { margin: 0 0 10px 0; font-size: 34px; line-height: 1.15; }
h2 { margin: 0; font-size: 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.credentials-box { margin: 18px 0; padding: 16px; border-radius: 14px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }
.stack-form { display: grid; gap: 16px; }
.grid-form { display: grid; gap: 22px; }
.form-grid { display: grid; gap: 16px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full { grid-column: 1 / -1; }
label { display: grid; gap: 8px; font-size: 14px; font-weight: 600; }
input, textarea { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; font: inherit; background: #fff; }
textarea { resize: vertical; }
.checkbox-row { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.checkbox-row input { width: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; padding: 13px 18px; font-weight: 700; border: none; cursor: pointer; }
.btn-primary { background: linear-gradient(135deg, #111827, #1d4ed8); color: #fff; }
.btn-block { width: 100%; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card, .card { background: var(--card); border-radius: 20px; box-shadow: 0 10px 32px rgba(0,0,0,0.05); border: 1px solid rgba(229,231,235,0.7); }
.stat-card { padding: 22px; }
.stat-card span { display: block; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.stat-card strong { font-size: 34px; }
.card { padding: 24px; }
.card-header { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
.table-sub { color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: capitalize; }
.badge-sent { background: #dcfce7; color: #166534; }
.badge-simulated { background: #fef3c7; color: #92400e; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.actions-row { display: flex; justify-content: flex-end; }
.preview-toolbar { display: flex; gap: 24px; margin-bottom: 16px; color: var(--muted); }
.email-preview-frame { background: #dbe4f2; padding: 18px; border-radius: 20px; box-shadow: inset 0 0 0 1px rgba(148,163,184,.3); }
.flash-stack { display: grid; gap: 10px; margin-bottom: 16px; }
.flash { padding: 13px 16px; border-radius: 14px; font-weight: 600; }
.flash-success { background: #dcfce7; color: #166534; }
.flash-warning { background: #fef3c7; color: #92400e; }
.flash-error { background: #fee2e2; color: #991b1b; }
@media (max-width: 980px) {
  .sidebar { display: none; }
  .main-content { padding: 18px; }
  .stats-grid, .two-col { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .preview-toolbar { flex-direction: column; gap: 8px; }
}
