/* ═══════════════════════════════════════════════════════════
   IMAP Auto-Responder — app.css
   ═══════════════════════════════════════════════════════════ */

/* ── Custom Properties ──────────────────────────────────────────────── */
:root {
  --brand:       #4f46e5;
  --brand-dark:  #4338ca;
  --brand-light: #e0e7ff;
  --brand-50:    #eef2ff;
  --brand-200:   #c7d2fe;
  --brand-700:   #4338ca;
  --brand-900:   #312e81;

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --green-100: #dcfce7;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;

  --red-50:  #fef2f2;
  --red-100: #fee2e2;
  --red-200: #fecaca;
  --red-600: #dc2626;
  --red-700: #b91c1c;

  --amber-50:  #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-800: #92400e;

  --radius-sm:   0.25rem;
  --radius:      0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-full: 9999px;

  --shadow-sm:  0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow:     0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md:  0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* ── Reset & Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 0.875rem;
  color: var(--slate-900);
  background: var(--slate-50);
  line-height: 1.5;
}

a { color: inherit; }
button { cursor: pointer; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
code { font-family: ui-monospace, 'Cascadia Code', monospace; }

/* ── App Shell ──────────────────────────────────────────────────────── */
.app-shell { display: flex; height: 100%; }

/* ── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
  width: 15rem;
  flex-shrink: 0;
  background: var(--slate-800);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--slate-700);
}

.sidebar-brand { display: flex; align-items: center; gap: 0.5rem; }
.sidebar-brand-icon { font-size: 1.5rem; }
.sidebar-brand-name { color: #fff; font-weight: 700; font-size: 0.875rem; line-height: 1.25; }
.sidebar-brand-tagline { color: var(--slate-400); font-size: 0.75rem; }

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sidebar-nav-section { padding-top: 1rem; display: flex; flex-direction: column; gap: 0.125rem; }

.sidebar-nav-label {
  padding: 0.25rem 0.75rem;
  color: var(--slate-500);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--slate-300);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 150ms, background-color 150ms;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.nav-link:hover { background: var(--slate-700); color: #fff; }
.nav-link.active { background: var(--brand); color: #fff; }
.nav-link svg { width: 1rem; height: 1rem; flex-shrink: 0; }

.nav-link--signout { color: #f87171; }
.nav-link--signout:hover { color: #fca5a5; background: rgb(127 29 29 / 0.2); }

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--slate-700);
}

.sidebar-user { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }

.sidebar-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-full);
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-username { color: var(--slate-300); font-size: 0.875rem; }

/* ── Main Content ───────────────────────────────────────────────────── */
.main-content { flex: 1; overflow-y: auto; }
.page-wrap { padding: 1.5rem 2rem; }

/* ── Flash Messages ─────────────────────────────────────────────────── */
.flash {
  margin: 1.5rem 2rem 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flash--success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.flash--error   { background: var(--red-50); border: 1px solid var(--red-200); color: var(--red-700); }
.flash-close {
  background: none; border: none; opacity: 0.6; margin-left: 1rem;
  font-size: 1rem; line-height: 1; color: inherit; padding: 0;
}
.flash-close:hover { opacity: 1; }

/* ── Alerts (inline form errors, warnings) ──────────────────────────── */
.alert { margin-bottom: 1.5rem; padding: 1rem; border-radius: var(--radius); }

.alert--error { background: var(--red-50); border: 1px solid var(--red-200); }
.alert--error .alert-title { color: var(--red-700); font-weight: 500; font-size: 0.875rem; margin-bottom: 0.25rem; }
.alert--error ul { list-style: disc; padding-left: 1.25rem; color: var(--red-600); font-size: 0.875rem; }
.alert--error li + li { margin-top: 0.125rem; }

.alert--warning { background: var(--amber-50); border: 1px solid var(--amber-200); color: var(--amber-800); }
.alert--warning .alert-title { font-weight: 600; margin-bottom: 0.25rem; }
.alert--warning ul { list-style: disc; padding-left: 1.25rem; font-size: 0.75rem; }
.alert--warning li + li { margin-top: 0.25rem; }
.alert--warning code { color: #78350f; }

/* ── Page Header ────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-header-start { display: flex; align-items: center; gap: 0.75rem; }
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--slate-900); }
.page-subtitle { color: var(--slate-500); font-size: 0.875rem; margin-top: 0.125rem; }
.page-clock { font-size: 0.75rem; color: var(--slate-400); }

.back-link {
  color: var(--slate-400);
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 150ms;
}
.back-link:hover { color: var(--slate-600); }
.back-link svg { width: 1.25rem; height: 1.25rem; }

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200);
  padding: 1.5rem;
}
.card--no-pad { padding: 0; overflow: hidden; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-title { font-weight: 600; color: var(--slate-900); }
.card-link { font-size: 0.75rem; color: var(--brand); text-decoration: none; }
.card-link:hover { color: var(--brand-dark); }

.section-title {
  font-weight: 600;
  color: var(--slate-800);
  font-size: 1rem;
  border-bottom: 1px solid var(--slate-100);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-danger, .btn-warning {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms, color 150ms, border-color 150ms;
  line-height: 1.25;
  white-space: nowrap;
}

.btn-primary   { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }

.btn-secondary { background: #fff; border-color: var(--slate-300); color: var(--slate-700); }
.btn-secondary:hover { background: var(--slate-50); }

.btn-danger    { background: var(--red-600); color: #fff; }
.btn-danger:hover { background: var(--red-700); }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-warning { background: #fff; border-color: var(--amber-200); color: var(--amber-700); }
.btn-warning:hover { background: var(--amber-50); }

.btn-sm  { padding: 0.375rem 0.75rem; font-size: 0.75rem; }
.btn-xs  { padding: 0.25rem 0.5rem;  font-size: 0.75rem; }
.btn-wide { padding-left: 2rem; padding-right: 2rem; }

.btn-icon svg { width: 1rem; height: 1rem; }

/* Colour overrides applied by JS in accounts test connection */
.text-green-600 { color: var(--green-600) !important; }
.text-red-600   { color: var(--red-600)   !important; }

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.form-stack { display: flex; flex-direction: column; gap: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-700);
  margin-bottom: 0.25rem;
}

.form-input {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--slate-300);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  box-shadow: var(--shadow-sm);
  background: #fff;
  color: var(--slate-900);
  transition: border-color 150ms, box-shadow 150ms;
}
.form-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(79 70 229 / 0.15);
}
.form-input--sm  { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.form-input--mono { font-family: ui-monospace, monospace; }
.form-input--narrow { width: 7rem; flex-shrink: 0; }
textarea.form-input { resize: vertical; }

.form-hint { margin-top: 0.25rem; font-size: 0.75rem; color: var(--slate-500); }
.form-hint a { color: var(--brand); }
.form-hint a:hover { text-decoration: underline; }
.form-hint code { background: var(--slate-100); padding: 0.125rem 0.25rem; border-radius: var(--radius-sm); }

.form-row { display: flex; gap: 0.5rem; }

.form-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}
.form-cols .col-2 { grid-column: span 2; }

.check-row { display: flex; align-items: center; gap: 0.75rem; }
.check-row input[type="checkbox"] {
  width: 1rem; height: 1rem;
  border-radius: var(--radius-sm);
  accent-color: var(--brand);
  flex-shrink: 0;
}
.check-row label { font-size: 0.875rem; font-weight: 500; color: var(--slate-700); cursor: pointer; }

.info-hint {
  font-size: 0.75rem;
  color: var(--slate-500);
  background: var(--slate-50);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.info-hint p + p { margin-top: 0.25rem; }
.info-hint-title { font-weight: 500; color: var(--slate-600); margin-bottom: 0.25rem; }

.form-actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.5rem; }

/* ── Tables ─────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.data-table { width: 100%; font-size: 0.875rem; border-collapse: collapse; }

.data-table thead { background: var(--slate-50); border-bottom: 1px solid var(--slate-200); }

.data-table th {
  text-align: left;
  padding: 0.75rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--slate-50); }
.data-table tbody tr.row--failed { background: #fef2f2; }

.data-table--compact th { padding: 0.5rem 0.75rem; }
.data-table--compact td { padding: 0.5rem 0.75rem; }

.col-actions { text-align: right; width: 1%; white-space: nowrap; }
.td-actions { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end; }

.cell-title { font-weight: 500; color: var(--slate-800); }
.cell-sub   { font-size: 0.75rem; color: var(--slate-500); margin-top: 0.125rem; }
.cell-mono  { font-family: ui-monospace, monospace; font-size: 0.75rem; color: var(--slate-700); }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap   { white-space: nowrap; }

/* ── Badges ─────────────────────────────────────────────────────────── */
.badge-pending, .badge-sent, .badge-failed, .badge-skipped {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
}
.badge-pending { background: var(--amber-100); color: var(--amber-800); }
.badge-sent    { background: var(--green-100); color: var(--green-700); }
.badge-failed  { background: var(--red-100);   color: var(--red-700); }
.badge-skipped { background: var(--slate-100); color: var(--slate-600); }

a.badge-pending:hover, a.badge-sent:hover,
a.badge-failed:hover, a.badge-skipped:hover { opacity: 0.8; }

/* ── Status Pill ────────────────────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}
.status-pill--active { background: var(--green-100); color: var(--green-700); }
.status-pill--paused { background: var(--slate-100); color: var(--slate-500); }

.status-dot {
  width: 0.375rem; height: 0.375rem;
  border-radius: var(--radius-full);
  flex-shrink: 0; display: inline-block;
}
.status-dot--active { background: var(--green-500); }
.status-dot--paused { background: var(--slate-400); }

/* ── Dashboard ──────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card { display: flex; align-items: center; gap: 1rem; }

.stat-icon {
  width: 3rem; height: 3rem;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.stat-icon--indigo { background: var(--brand-light); }
.stat-icon--amber  { background: var(--amber-100); }
.stat-icon--green  { background: var(--green-100); }
.stat-icon--red    { background: var(--red-100); }

.stat-value          { font-size: 1.5rem; font-weight: 700; color: var(--slate-900); }
.stat-value--amber   { color: var(--amber-600); }
.stat-value--green   { color: var(--green-600); }
.stat-value--red     { color: var(--red-600); }
.stat-label          { font-size: 0.75rem; color: var(--slate-500); }
.stat-sublabel       { font-size: 0.75rem; color: var(--slate-400); }
.stat-sublabel a     { color: inherit; }
.stat-sublabel a:hover { color: var(--red-700); text-decoration: underline; }

.dash-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }

.account-list { display: flex; flex-direction: column; gap: 0.75rem; }

.account-item {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 0.75rem; border-radius: var(--radius);
  background: var(--slate-50); border: 1px solid var(--slate-100);
}
.account-item-body { min-width: 0; flex: 1; }
.account-item-name-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.125rem; }

.account-dot { width: 0.5rem; height: 0.5rem; border-radius: var(--radius-full); flex-shrink: 0; }
.account-dot--active   { background: var(--green-400); }
.account-dot--inactive { background: var(--slate-300); }

.account-item-name     { font-size: 0.875rem; font-weight: 500; color: var(--slate-800); }
.account-item-email    { font-size: 0.75rem; color: var(--slate-500); padding-left: 1rem; }
.account-item-template { font-size: 0.75rem; padding-left: 1rem; margin-top: 0.125rem; }
.account-item-template--set     { color: var(--brand); }
.account-item-template--missing { color: var(--amber-500); }

.account-item-meta { text-align: right; margin-left: 0.5rem; flex-shrink: 0; }
.account-item-time { font-size: 0.75rem; color: var(--slate-400); margin-top: 0.25rem; white-space: nowrap; }

/* ── Filter Bar (Logs) ──────────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.filter-field { display: flex; flex-direction: column; }
.filter-field--grow { flex: 1; min-width: 12rem; }

/* ── Pagination ─────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: space-between; }
.pagination-info  { color: var(--slate-500); }
.pagination-links { display: flex; gap: 0.5rem; }

/* ── Token Reference Card ───────────────────────────────────────────── */
.token-hint { background: var(--brand-50); border-color: var(--brand-200); margin-bottom: 1.5rem; }
.token-hint-inner { display: flex; align-items: flex-start; gap: 0.75rem; }
.token-hint-icon  { font-size: 1.125rem; margin-top: 0.125rem; }
.token-hint-title { font-size: 0.875rem; font-weight: 600; color: var(--brand-900); margin-bottom: 0.5rem; }
.token-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.token-tag {
  padding: 0.125rem 0.5rem;
  background: #fff;
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-sm);
  color: var(--brand-700);
  font-size: 0.75rem;
  font-family: ui-monospace, monospace;
}

/* ── Template Grid & Cards ──────────────────────────────────────────── */
.template-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }

.template-card { transition: box-shadow 150ms; }
.template-card:hover { box-shadow: var(--shadow-md); }

.template-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.template-card-title { font-weight: 600; color: var(--slate-900); }
.template-card-date  { font-size: 0.75rem; color: var(--slate-500); margin-top: 0.125rem; }

.template-usage-badge {
  display: inline-flex; align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--brand-light); color: var(--brand-700);
  font-size: 0.75rem; font-weight: 500;
  flex-shrink: 0; margin-left: 0.5rem;
}

.template-field-label { font-size: 0.75rem; font-weight: 500; color: var(--slate-500); margin-bottom: 0.25rem; }

.template-subject-value {
  font-size: 0.875rem; color: var(--slate-700);
  background: var(--slate-50); border-radius: var(--radius-sm);
  padding: 0.375rem 0.75rem; font-family: ui-monospace, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 0.75rem;
}

.template-body-preview {
  font-size: 0.75rem; color: var(--slate-600);
  background: var(--slate-50); border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem; height: 2.5rem;
  overflow: hidden; position: relative; margin-bottom: 1rem;
}
.template-body-fade {
  position: absolute; inset: auto 0 0 0; height: 1.25rem;
  background: linear-gradient(to top, var(--slate-50), transparent);
}

.template-actions {
  display: flex; align-items: center; gap: 0.5rem;
  padding-top: 0.75rem; border-top: 1px solid var(--slate-100);
}

/* ── Template Editor ────────────────────────────────────────────────── */
.editor-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }

.token-bar { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
.token-bar-label { font-size: 0.75rem; color: var(--slate-500); }

.token-btn {
  padding: 0.125rem 0.5rem;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-sm);
  color: var(--brand-700);
  font-size: 0.75rem;
  font-family: ui-monospace, monospace;
  cursor: pointer;
  transition: background 150ms;
}
.token-btn:hover { background: var(--brand-light); }

.preview-sticky { position: sticky; top: 1.5rem; }

.preview-subject-box {
  margin-bottom: 0.75rem; padding: 0.5rem;
  background: var(--slate-50); border-radius: var(--radius-sm);
  border: 1px solid var(--slate-200);
}
.preview-subject-label { font-size: 0.75rem; color: var(--slate-500); font-weight: 500; }
.preview-subject-value { font-size: 0.875rem; color: var(--slate-800); font-family: ui-monospace, monospace; }

.preview-frame-wrap {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  overflow: hidden; height: 520px;
}
.preview-frame-wrap iframe { width: 100%; height: 100%; display: block; border: none; }

/* ── Settings ───────────────────────────────────────────────────────── */
.sys-info { display: flex; flex-direction: column; }

.sys-row {
  display: flex; justify-content: space-between;
  padding: 0.5rem 0; border-bottom: 1px solid var(--slate-50);
  font-size: 0.875rem;
}
.sys-row:last-child { border-bottom: none; }
.sys-row-label { color: var(--slate-500); }
.sys-row-value { font-family: ui-monospace, monospace; color: var(--slate-700); font-size: 0.75rem; }

.code-inline {
  padding: 0.125rem 0.375rem;
  background: var(--slate-100); border-radius: var(--radius-sm);
  font-size: 0.75rem; color: var(--slate-700);
  font-family: ui-monospace, monospace;
}

/* ── Empty State ────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-state-icon  { font-size: 2.25rem; margin-bottom: 1rem; }
.empty-state-title { font-size: 1.125rem; font-weight: 600; color: var(--slate-700); margin-bottom: 0.25rem; }
.empty-state-text  { color: var(--slate-500); font-size: 0.875rem; margin-bottom: 1.25rem; }

/* ── Error Page ─────────────────────────────────────────────────────── */
.error-state { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.error-state-inner { text-align: center; }
.error-state-icon  { font-size: 3.75rem; margin-bottom: 1rem; }
.error-state-title { font-size: 1.875rem; font-weight: 700; color: var(--slate-800); margin-bottom: 0.5rem; }
.error-state-text  { color: var(--slate-500); font-size: 1.125rem; margin-bottom: 1.5rem; }

/* ── Login Page ─────────────────────────────────────────────────────── */
.login-page {
  display: flex; height: 100%;
  background: var(--slate-900);
  align-items: center; justify-content: center;
}
.login-wrap { width: 100%; max-width: 28rem; padding: 0 1.5rem; }

.login-header { text-align: center; margin-bottom: 2rem; }
.login-header-icon     { font-size: 3rem; }
.login-header-title    { margin-top: 1rem; font-size: 1.5rem; font-weight: 700; color: #fff; }
.login-header-subtitle { margin-top: 0.25rem; color: var(--slate-400); font-size: 0.875rem; }

.login-card { background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-2xl); padding: 2rem; }

.login-error {
  margin-bottom: 1.25rem; padding: 0.75rem 1rem;
  background: var(--red-50); border: 1px solid var(--red-200);
  border-radius: var(--radius); color: var(--red-700); font-size: 0.875rem;
}

.login-form { display: flex; flex-direction: column; gap: 1.25rem; }

.login-submit {
  width: 100%; padding: 0.625rem;
  background: var(--brand); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: background 150ms;
}
.login-submit:hover { background: var(--brand-dark); }

/* ── Utility ────────────────────────────────────────────────────────── */
.hidden   { display: none; }
.ml-auto  { margin-left: auto; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  .form-grid   { grid-template-columns: 1fr 1fr; }
  .editor-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid   { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
  .template-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1280px) {
  .template-grid { grid-template-columns: 1fr 1fr 1fr; }
  .dash-grid     { grid-template-columns: 2fr 1fr; }
}
