/*
  InboxGP Main Stylesheet
  ============================================================
  Global TOC
  - 01) Theme Tokens and Reset
  - 02) App Shell Layout
  - 03) Navigation
  - 04) Utility and Top Bars
  - 05) Shared Surfaces and Components
  - 06) Form System
  - 07) Table and List System
  - 08) Dashboard Module
  - 09) Login Module
  - 10) Theme Toggle Controls
  - 11) Responsive Rules

  Module TOC: Dashboard
  - .dashboard-tabs
  - .dashboard-hero*
  - .dashboard-split
  - .dashboard-bars / .dashboard-bar

  Module TOC: Forms
  - .form-grid-2 / .form-grid-3
  - .form-card variants
  - .field-help / .checkbox-inline / .form-actions

  Module TOC: Lists
  - .module-tabs
  - .sparkline / .bar height helpers
  - .table-pagination
*/

/* 01) Theme Tokens and Reset */
:root {
  --bg: #f3f6fb;
  --bg-soft: #f8fbff;
  --panel: #ffffff;
  --ink: #172233;
  --muted: #66788f;
  --border: #d9e3f0;
  --brand: #12c972;
  --brand-deep: #0cae63;
  --nav-bg: #0f1f31;
  --nav-hover: #1b3148;
  --topbar: #0d1a2a;
  --danger: #dd425c;

  --surface-elev: #ffffff;
  --surface-muted: #f8fbff;
  --text-primary: #172233;
  --text-secondary: #66788f;
  --shadow-soft: 0 10px 26px rgba(21, 35, 54, 0.06);
  --ring: 0 0 0 3px rgba(0, 194, 111, 0.17);
}

body.theme-dark {
  --bg: #0f1826;
  --bg-soft: #121f30;
  --panel: #162435;
  --ink: #e4edf8;
  --muted: #9cb0c5;
  --border: #25384f;
  --brand: #18d07a;
  --brand-deep: #11b369;
  --nav-bg: #0b1420;
  --nav-hover: #14263a;
  --topbar: #0a1320;

  --surface-elev: #162435;
  --surface-muted: #142132;
  --text-primary: #e4edf8;
  --text-secondary: #9cb0c5;
  --shadow-soft: 0 14px 28px rgba(0, 0, 0, 0.28);
  --ring: 0 0 0 3px rgba(24, 208, 122, 0.2);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  color: var(--text-primary);
}

/* 02) App Shell Layout */
body.app-shell {
  background:
    radial-gradient(1200px 420px at 8% -10%, #dfffee 0%, rgba(223, 255, 238, 0) 45%),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 42%, #eef3f9 100%);
}
body.theme-dark.app-shell {
  background:
    radial-gradient(900px 380px at 8% -12%, rgba(24, 208, 122, 0.08) 0%, rgba(24, 208, 122, 0) 45%),
    linear-gradient(180deg, #0d1623 0%, var(--bg) 50%, #101b2b 100%);
}
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.main { padding: 0; }
.main-inner { padding: 16px; }

/* 03) Navigation */
.nav {
  background: linear-gradient(180deg, #11243a 0%, var(--nav-bg) 100%);
  color: #adc0d5;
  padding: 10px 10px 18px;
  border-right: 1px solid #203349;
}
.brand { display: flex; align-items: center; gap: 10px; margin: 6px 8px 14px; }
.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, #00d57a, #00b867);
  box-shadow: 0 0 0 4px rgba(0, 194, 111, 0.14);
}
.nav h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.01em;
  color: #e8f2ff;
  font-family: 'Sora', 'Plus Jakarta Sans', sans-serif;
}
.nav-group-label {
  margin: 14px 8px 8px;
  color: #7590a8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-section {
  margin: 4px 0 6px;
}
.nav-section > summary {
  list-style: none;
  cursor: pointer;
  color: #8da3ba;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 10px;
  border-radius: 10px;
}
.nav-section > summary::-webkit-details-marker {
  display: none;
}
.nav-section > summary:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #d6e6f6;
}
.nav-subitem {
  margin-left: 6px;
}
.nav a {
  display: block;
  color: #b8cae0;
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 10px;
  margin-bottom: 2px;
  font-weight: 600;
  font-size: 13px;
  transition: background-color 120ms ease, color 120ms ease, transform 120ms ease;
}
.nav a.active {
  background: rgba(18, 201, 114, 0.16);
  color: #e9fff4;
  border: 1px solid rgba(18, 201, 114, 0.42);
}
.nav a:hover {
  background: var(--nav-hover);
  color: #eff6ff;
  transform: translateX(1px);
}
.nav a .ni {
  display: inline-flex;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border-radius: 6px;
  border: 1px solid #355270;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #c1d4e7;
  background: rgba(255, 255, 255, 0.05);
}
.nav a.active .ni {
  border-color: rgba(18, 201, 114, 0.42);
  color: #deffef;
  background: rgba(18, 201, 114, 0.2);
}

/* 04) Utility and Top Bars */
.utility {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid #203243;
  background: linear-gradient(180deg, #14263b 0%, var(--topbar) 100%);
  color: #dbe9f7;
}
.search {
  width: 280px;
  max-width: 55vw;
  background: #0e1e2f;
  border: 1px solid #344a60;
  color: #d9e9f8;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}
.search::placeholder { color: #97a7b3; }
.utility-links { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.utility-links a { color: #dce5eb; text-decoration: none; }
.utility-links a:hover { text-decoration: underline; }
.utility-pill {
  border: 0;
  background: #2b4660;
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  padding: 5px 7px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.account-menu { position: relative; }
.account-menu-trigger {
  cursor: pointer;
  transition: transform .12s ease, box-shadow .16s ease;
}
.account-menu-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(7, 23, 37, 0.3);
}
.account-menu-trigger:focus-visible {
  outline: 2px solid #2ecf84;
  outline-offset: 2px;
}
.account-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 300px;
  background: #ffffff;
  border: 1px solid #d9e4f0;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(16, 32, 52, 0.22);
  color: #1d2c3c;
  z-index: 60;
  overflow: hidden;
}
.account-menu-head {
  padding: 14px 16px;
  border-bottom: 1px solid #e6edf5;
}
.account-menu-name {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 600;
  color: #1f2f42;
}
.account-menu-email {
  margin-top: 3px;
  color: #6c7f94;
  font-size: 14px;
}
.account-menu-links {
  display: grid;
  border-bottom: 1px solid #e6edf5;
}
.account-menu-links a,
.account-menu-footer a,
.account-menu-logout {
  text-decoration: none;
  color: #1f67d8;
  font-size: 16px;
}
.account-menu-links a {
  padding: 12px 16px;
  color: #29415a;
}
.account-menu-links a:hover { background: #f3f8ff; }
.account-menu-footer {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.account-menu-footer form { margin: 0; }
.account-menu-logout {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font-family: inherit;
  cursor: pointer;
}
.account-menu-logout:hover,
.account-menu-footer a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .account-menu-panel {
    right: -8px;
    width: min(88vw, 320px);
  }
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #dfe7f1;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  color: #4f6277;
}
.top strong { display: block; font-weight: 600; font-size: 14px; }
.top-subtle { color: #8395a2; font-size: 12px; }

/* 05) Shared Surfaces and Components */
.card {
  background: var(--surface-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-soft);
}
.card.form-card { padding: 18px; }
.card-narrow { max-width: 760px; }
.card-medium { max-width: 860px; }
.card-wide { max-width: 900px; }
.card-xwide { max-width: 980px; }

.profile-kpi-strip {
  margin-bottom: 12px;
}

.page-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 12px; }
.page-header h2 {
  margin: 0;
  letter-spacing: -0.01em;
  font-size: 28px;
  font-weight: 500;
  color: #24354a;
  font-family: 'Sora', 'Plus Jakarta Sans', sans-serif;
}
.form-page-title {
  margin: 0 0 12px;
  font-family: 'Sora', 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
  color: #24354a;
}

.btn-primary {
  display: inline-block;
  text-decoration: none;
  border: 1px solid var(--brand-deep);
  background: linear-gradient(180deg, #07c971 0%, var(--brand-deep) 100%);
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(18, 201, 114, 0.32);
}
.btn-primary:hover { filter: brightness(1.03); }

.btn-secondary {
  display: inline-block;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); background: rgba(18,201,114,.08); }

.btn-danger {
  display: inline-block;
  text-decoration: none;
  border: 1px solid rgba(221,66,92,.35);
  background: rgba(221,66,92,.08);
  color: var(--danger);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}
.btn-danger:hover { background: rgba(221,66,92,.15); border-color: var(--danger); }

.btn-sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }

.actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.actions a,
.actions button {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-elev);
  color: var(--text-primary);
  transition: border-color .15s, color .15s, background .15s;
  line-height: 1.6;
}
.actions a:hover,
.actions button:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--surface-elev);
  text-decoration: none;
}
.actions button[type="submit"]:hover {
  border-color: var(--danger);
  color: var(--danger);
}
.actions form { display: inline; }

/* Customer search */
.cust-search-form { margin-bottom: 1rem; }
.cust-search-wrap { position: relative; max-width: 360px; }
.cust-search-icon {
    position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; color: var(--text-secondary); pointer-events: none;
}
.cust-search {
    width: 100%; box-sizing: border-box;
    background: var(--surface-muted); border: 1px solid var(--border);
    border-radius: 9px; color: var(--text-primary);
    padding: .5rem 2rem .5rem 2.1rem;
    font-size: .88rem; font-family: inherit;
}
.cust-search:focus { outline: none; border-color: var(--brand); }
.cust-search-clear {
    position: absolute; right: .65rem; top: 50%; transform: translateY(-50%);
    font-size: .75rem; color: var(--text-secondary); text-decoration: none;
    line-height: 1; opacity: .6;
}
.cust-search-clear:hover { opacity: 1; color: var(--danger); }
.spaced-card { margin-bottom: 14px; }
.spaced-card-top { margin-top: 14px; }
.full-span { grid-column: 1 / -1; }
.media-thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; }
.media-inline-form { gap: 8px; min-width: 280px; }

.preview-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
}
.preview-modal.is-open { display: block; }
.preview-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 14, 25, 0.56);
}
.preview-modal-dialog {
  position: relative;
  width: min(1100px, calc(100vw - 48px));
  height: min(82vh, 860px);
  margin: 40px auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.28);
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
}
.preview-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
}
.preview-modal-sub {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
}
#templatePreviewFrame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.smtp-delete-dialog {
  width: min(560px, calc(100vw - 40px));
  height: auto;
  grid-template-rows: auto auto 1fr;
}
.smtp-delete-body {
  padding: 14px 14px 16px;
}
.smtp-delete-warning {
  margin: 0 0 12px;
  color: var(--text-primary);
  line-height: 1.5;
}
.smtp-delete-body label {
  display: block;
  margin: 0 0 6px;
  font-weight: 600;
}
.smtp-delete-body input {
  width: 100%;
  max-width: 240px;
}
.smtp-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.confirm-modal-dialog {
  width: min(560px, calc(100vw - 40px));
  height: auto;
  grid-template-rows: auto auto 1fr;
}
.confirm-modal-body {
  padding: 14px 14px 16px;
}
.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.confirm-typed-wrap label {
  display: block;
  margin: 0 0 6px;
  font-weight: 600;
}
.confirm-typed-wrap input {
  width: 100%;
  max-width: 240px;
}

.smtp-test-dialog {
  width: min(560px, calc(100vw - 40px));
  height: auto;
  grid-template-rows: auto auto 1fr;
}
.smtp-test-body {
  padding: 14px 14px 16px;
}
.smtp-test-body label {
  display: block;
  margin: 0 0 6px;
  font-weight: 600;
}
.smtp-test-body input {
  width: 100%;
}
.smtp-test-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.smtp-test-submit-loading {
  position: relative;
  padding-left: 18px;
}
.smtp-test-submit-loading::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: #fff;
  border-radius: 50%;
  animation: smtp-spin 0.8s linear infinite;
}

@keyframes smtp-spin {
  to { transform: rotate(360deg); }
}

.smtp-default-prompt-head {
  margin: 0;
}

.smtp-default-prompt-title {
  display: block;
  margin-bottom: 4px;
}

.smtp-deliverability-form textarea {
  min-height: 170px;
}

.smtp-deliverability-result {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.smtp-deliverability-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.recipient-preview-dialog {
  width: min(760px, calc(100vw - 40px));
  height: min(80vh, 740px);
}
.recipient-preview-body {
  padding: 12px;
  overflow: auto;
}
.recipient-preview-description {
  margin: 0 0 10px;
  color: var(--text-secondary);
}
.recipient-preview-subtitle {
  margin: 0 0 8px;
}
.recipient-preview-empty {
  color: var(--text-secondary);
}
.recipient-preview-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
}

.templates-preview-dialog {
  width: min(1180px, calc(100vw - 40px));
  height: min(86vh, 920px);
}
.templates-preview-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.device-toggle {
  border: 1px solid var(--border);
  background: var(--surface-elev);
  color: var(--text-primary);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.device-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.device-toggle.is-active {
  border-color: var(--brand);
  background: rgba(18, 201, 114, 0.1);
  color: var(--brand-deep);
}
.templates-preview-body {
  padding: 12px;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.template-preview-viewport {
  width: 100%;
  height: 100%;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: width .2s ease;
}
.templates-preview-dialog #templatesPreviewFrame {
  width: 100%;
  height: 100%;
  min-height: 640px;
  border: 0;
  background: #fff;
}
.templates-preview-dialog.is-desktop .template-preview-viewport {
  width: 100%;
  max-width: 1040px;
}
.templates-preview-dialog.is-tablet .template-preview-viewport {
  width: 820px;
}
.templates-preview-dialog.is-mobile .template-preview-viewport {
  width: 420px;
}

.media-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px 16px;
}
.media-picker-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 14, 25, 0.62);
  backdrop-filter: blur(3px);
}
.media-picker-dialog {
  position: relative;
  width: min(1040px, 100%);
  max-height: calc(100vh - 80px);
  background: var(--surface-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.32);
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  animation: mpSlideIn .18s ease;
}
@keyframes mpSlideIn {
  from { opacity: 0; transform: translateY(-12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.media-picker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.media-picker-head strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.01em;
}
.media-picker-head button {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 5px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.media-picker-head button:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--surface-muted);
}
.media-picker-toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  align-items: center;
}
.media-picker-toolbar input[type="text"] {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-elev);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.media-picker-toolbar input[type="text"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(18,201,114,.15);
}
.media-picker-toolbar input[type="file"] {
  font-size: 13px;
  color: var(--text-secondary);
}
.media-picker-toolbar button {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.media-picker-toolbar button:hover { background: var(--brand-deep); }
.media-picker-grid {
  padding: 16px 20px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.media-picker-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px;
  background: var(--surface-elev);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.media-picker-item:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 14px rgba(18,201,114,.18);
  transform: translateY(-2px);
}
.media-picker-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 7px;
}
.media-picker-item span {
  display: block;
  margin-top: 7px;
  padding: 0 2px;
  font-size: 11px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-picker-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.metric-card { padding: 12px; }
.metric-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.metric-value {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-card h3 { margin-top: 0; }
.mini-chart-wrap {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 150px;
  margin-top: 6px;
}
.mini-chart-col { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.mini-bars { height: 124px; display: flex; align-items: end; gap: 5px; }
.mini-bar { display: inline-block; width: 14px; border-radius: 6px 6px 2px 2px; }
.mini-bar.sent { background: #7f8ea0; }
.mini-bar.open { background: #0ab76a; }
.mini-bar.click { background: #0d5bff; }
.mini-label { font-size: 11px; color: var(--text-secondary); }
.legend-row { margin-top: 10px; display: flex; gap: 8px; }
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
}
.legend-chip.open::before,
.legend-chip.click::before,
.legend-chip.sent::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}
.legend-chip.sent::before { background: #7f8ea0; }
.legend-chip.open::before { background: #0ab76a; }
.legend-chip.click::before { background: #0d5bff; }

.timeline-chart-wrap {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 168px;
}
.timeline-chart-col { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.timeline-bars { height: 124px; display: flex; align-items: end; gap: 4px; }
.timeline-label { font-size: 10px; color: var(--text-secondary); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1.4;
}
.badge.ok { color: #0b6d41; background: #e8fff2; border-color: #9ce9c2; }
.badge.warn { color: #7a5b00; background: #fff8df; border-color: #f0dd99; }
.badge.off { color: #5f7482; background: #edf3f7; border-color: #d6e0e7; }
.badge.err { color: #9c2137; background: #fff1f4; border-color: #f5c5ce; }

.flash { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.flash.ok { background: #e7fff2; border: 1px solid #9ce9c2; color: #08683b; }
.flash.info { background: #ecf4ff; border: 1px solid #b8d6ff; color: #0b4f9e; }
.flash.warn { background: #fff7e9; border: 1px solid #f2d293; color: #7d5200; }
.flash.err { background: #fff0f3; border: 1px solid #f5c5ce; color: #9c2137; }
.flash-link { margin-left: 10px; font-weight: 700; color: inherit; text-decoration: underline; }

/* 06) Form System */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.field-block { margin-top: 12px; }
.field-help { margin: 8px 0 0; color: #5f7286; font-size: 12px; line-height: 1.45; }
.form-actions { margin-top: 14px; display: flex; gap: 10px; align-items: center; }
.form-actions .btn-primary,
.form-actions .btn-secondary,
.form-actions .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.checkbox-row { margin-top: 12px; display: flex; gap: 18px; align-items: center; }
.checkbox-inline { display: flex; align-items: center; gap: 7px; margin-bottom: 0; font-weight: 600; color: #4a5d72; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.push-down { margin-top: 28px; }

label { display: block; font-size: 13px; color: #425867; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #cad6df;
  border-radius: 10px;
  font: inherit;
  background: var(--surface-muted);
  color: var(--text-primary);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #74dba8;
  box-shadow: var(--ring);
}
form { margin: 0; }
button {
  border: 1px solid #cad4db;
  border-radius: 10px;
  background: #fff;
  color: #1f2d38;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 500;
}
button:not(.btn-primary):not(.btn-secondary):not(.btn-danger):hover { background: #f7fbfd; }
.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 9px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.btn-logout:hover { background: transparent !important; border-color: var(--danger); color: var(--danger); }

/* 07) Table and List System */
.table-pagination { margin-top: 12px; }

.table-pagination nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.table-pagination nav > div:first-child {
  display: none;
}
.table-pagination nav > div:last-child {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.table-pagination nav > div:last-child > a,
.table-pagination nav > div:last-child > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-elev);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 12px;
  line-height: 1;
}
.table-pagination nav > div:last-child > a:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.table-pagination [aria-current="page"] > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(18, 201, 114, 0.42);
  background: rgba(18, 201, 114, 0.16);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 12px;
}
.table-pagination svg {
  width: 14px;
  height: 14px;
}

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 9px; border-bottom: 1px solid #edf2f5; font-size: 13px; }
th { color: #5f7482; font-weight: 700; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
tbody tr:hover { background: #f8fbff; }
td a { color: #1159ad; text-decoration: none; font-weight: 500; }
td a:hover { text-decoration: underline; }

.module-tabs {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid #d9e0e5;
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
  color: #667987;
  box-shadow: 0 4px 14px rgba(20, 34, 51, 0.04);
}
.module-tabs .tab { color: #667987; text-decoration: none; font-weight: 600; }
.module-tabs .tab.active { color: #2d404c; border-bottom: 2px solid #10b86d; padding-bottom: 4px; }

.sparkline {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-left: 1px solid #d7e2e9;
  margin-left: 8px;
}
.sparkline .bar {
  width: 5px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, #1de18b 0%, #07ae63 100%);
  opacity: 0.9;
  height: 40%;
}
.h22 { height: 22%; }
.h25 { height: 25%; }
.h28 { height: 28%; }
.h29 { height: 29%; }
.h31 { height: 31%; }
.h32 { height: 32%; }
.h33 { height: 33%; }
.h34 { height: 34%; }
.h36 { height: 36%; }
.h39 { height: 39%; }
.h40 { height: 40%; }
.h41 { height: 41%; }
.h42 { height: 42%; }
.h44 { height: 44%; }
.h45 { height: 45%; }
.h47 { height: 47%; }
.h48 { height: 48%; }
.h50 { height: 50%; }
.h52 { height: 52%; }
.h53 { height: 53%; }
.h54 { height: 54%; }
.h55 { height: 55%; }
.h56 { height: 56%; }
.h57 { height: 57%; }
.h58 { height: 58%; }
.h59 { height: 59%; }
.h61 { height: 61%; }
.h63 { height: 63%; }
.h66 { height: 66%; }
.h67 { height: 67%; }
.h68 { height: 68%; }
.h69 { height: 69%; }
.h71 { height: 71%; }
.h75 { height: 75%; }
.h82 { height: 82%; }

/* 08) Dashboard Module */
.grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.metric {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.metric .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.metric .v { font-size: 24px; font-weight: 700; font-family: 'Sora', 'Plus Jakarta Sans', sans-serif; }

.dashboard-tabs {
  display: flex;
  gap: 22px;
  margin: 0 0 14px;
  padding: 0 2px 10px;
  border-bottom: 1px solid #d6dfe6;
  color: #6a7c89;
  font-weight: 600;
  font-size: 14px;
}
.dashboard-tabs-active {
  color: #334854;
  border-bottom: 3px solid #12b86d;
  padding-bottom: 8px;
}
.dashboard-hero {
  margin-bottom: 14px;
  background: linear-gradient(120deg, #0f2238 0%, #173451 48%, #1e4a4e 100%);
  border-color: #183754;
  color: #e6f2ff;
}
.dashboard-hero-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.dashboard-hero-title {
  margin: 0 0 6px;
  font-family: 'Sora', 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
}
.dashboard-hero-subtitle { margin: 0; color: #b8cde2; }
.dashboard-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.dashboard-card-title {
  margin: 0 0 8px;
  font-family: 'Sora', 'Plus Jakarta Sans', sans-serif;
}
.dashboard-card-copy { margin: 0 0 14px; color: #607482; }
.dashboard-workspace-row,
.dashboard-workspace-row-last { color: #607482; }
.dashboard-workspace-row { margin: 0 0 10px; }
.dashboard-workspace-row-last { margin: 0; }
.dashboard-edit-profile {
    display: inline-block;
    margin-top: .9rem;
    font-size: .85rem;
    font-weight: 600;
    color: #19d4ad;
    text-decoration: none;
}
.dashboard-edit-profile:hover { text-decoration: underline; }

/* ── Profile avatar ── */
.profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.profile-avatar-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    overflow: hidden;
    display: block;
}
.profile-avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.profile-avatar-initials {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #19d4ad 0%, #0fa88a 100%);
    color: #052e25;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
}
.profile-avatar-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.5);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .18s;
}
.profile-avatar-wrap:hover .profile-avatar-overlay { opacity: 1; }

/* Header avatar image */
.utility-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.dashboard-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(10px, 1fr));
  gap: 6px;
  align-items: end;
  height: 130px;
}
.dashboard-bar {
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #0ccd76 0%, #06a95f 100%);
}

/* 09) Login Page */
body.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #0b0f0e;
    color: #e8eeec;
    font-family: "Plus Jakarta Sans", sans-serif;
    overflow-x: hidden;
}

.lp-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}
.lp-orb--teal   { width: 700px; height: 700px; top: -200px; left: -200px; background: rgba(25, 212, 173, 0.11); }
.lp-orb--violet { width: 500px; height: 500px; bottom: -100px; right: -150px; background: rgba(167, 139, 250, 0.09); }

.lp-nav {
    position: relative;
    z-index: 1;
    padding: 1.5rem 2rem;
}
.lp-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: #e8eeec;
    font-family: "Sora", sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
}
.lp-brand-icon {
    width: 1rem;
    height: 1rem;
    border-radius: 0.28rem;
    background: linear-gradient(140deg, #19d4ad 0%, #0fa88a 50%, #f0ab44 100%);
    box-shadow: 0 0 10px rgba(25, 212, 173, 0.4);
}

.lp-wrap {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.lp-card {
    width: 100%;
    max-width: 420px;
    background: #111815;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 1.25rem;
    padding: 2.25rem;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(25,212,173,0.08) inset;
}

.lp-card-head {
    margin-bottom: 1.75rem;
}
.lp-title {
    margin: 0 0 0.4rem;
    font-family: "Sora", sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #e8eeec;
    letter-spacing: -0.02em;
}
.lp-subtitle {
    margin: 0;
    color: #7a908a;
    font-size: 0.92rem;
}

.lp-error {
    margin-bottom: 1.25rem;
    background: rgba(220, 60, 80, 0.1);
    border: 1px solid rgba(220, 60, 80, 0.3);
    color: #ff8fa0;
    padding: 0.7rem 1rem;
    border-radius: 0.65rem;
    font-size: 0.88rem;
}

.lp-field {
    margin-bottom: 1.1rem;
}
.lp-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #7a908a;
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}
.lp-field input {
    width: 100%;
    box-sizing: border-box;
    background: #0e1512;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0.65rem;
    color: #e8eeec;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.lp-field input::placeholder { color: #3d5550; }
.lp-field input:focus {
    border-color: rgba(25, 212, 173, 0.45);
    box-shadow: 0 0 0 3px rgba(25, 212, 173, 0.1);
}

.lp-submit {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.85rem;
    background: #19d4ad;
    color: #052e25;
    border: none;
    border-radius: 0.75rem;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 0.97rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.lp-submit:hover {
    background: #21f0c6;
    box-shadow: 0 0 22px rgba(25, 212, 173, 0.4);
}
.lp-submit:disabled { cursor: not-allowed; }
.su-submit-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
@keyframes su-spin {
    to { transform: rotate(360deg); }
}
.su-spin {
    animation: su-spin 0.75s linear infinite;
    flex-shrink: 0;
}

/* Signup extensions */
.lp-wrap--signup { align-items: flex-start; padding-top: 2rem; padding-bottom: 3rem; }
.lp-card--signup { max-width: 500px; }

.su-top-link {
    text-align: center;
    font-size: 0.85rem;
    color: #7a908a;
    margin: 0 0 1.5rem;
}
.su-top-link a {
    color: #19d4ad;
    text-decoration: none;
    font-weight: 600;
}
.su-top-link a:hover { text-decoration: underline; }

.su-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #fff;
    color: #1f1f1f;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 0.65rem;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s, box-shadow 0.18s;
    margin-bottom: 1.25rem;
}
.su-google-btn:hover { background: #f5f5f5; box-shadow: 0 4px 14px rgba(0,0,0,0.18); }

.su-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: #3d5550;
    font-size: 0.82rem;
}
.su-divider::before,
.su-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.07); }

/* Stepper */
.su-stepper {
    display: flex;
    align-items: center;
    margin-bottom: 1.75rem;
}
.su-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.su-step-dot {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    border: 2px solid #3d5550;
    background: transparent;
    transition: all 0.22s;
}
.su-step.active .su-step-dot {
    border-color: #19d4ad;
    background: #19d4ad;
    box-shadow: 0 0 10px rgba(25,212,173,0.5);
}
.su-step.done .su-step-dot {
    border-color: #19d4ad;
    background: #19d4ad;
}
.su-step span {
    font-size: 0.72rem;
    font-weight: 600;
    color: #3d5550;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: color 0.22s;
}
.su-step.active span,
.su-step.done span { color: #19d4ad; }

.su-step-line {
    flex: 1;
    height: 2px;
    background: #1e2e2a;
    margin: 0 0.4rem;
    margin-bottom: 1.1rem;
    transition: background 0.22s;
}

/* Panes */
.su-pane { display: none; }
.su-pane.active { display: block; }

.su-pane-note {
    font-size: 0.8rem;
    color: #7a908a;
    margin: 0 0 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.su-req { color: #19d4ad; font-size: 0.7rem; }
.su-hint { font-weight: 400; color: #3d5550; }

.su-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.lp-field select {
    width: 100%;
    box-sizing: border-box;
    background: #0e1512;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0.65rem;
    color: #e8eeec;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a908a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.lp-field select:focus {
    border-color: rgba(25,212,173,0.45);
    box-shadow: 0 0 0 3px rgba(25,212,173,0.1);
}
.lp-field select option { background: #0e1512; }

.su-captcha { margin: 1.1rem 0; }

.su-url-wrap {
    display: flex;
    align-items: stretch;
    background: var(--input-bg, #1a2020);
    border: 1px solid var(--input-border, #2e3d3a);
    border-radius: 8px;
    overflow: hidden;
}
.su-url-wrap:focus-within {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0,230,180,.12);
}
.su-url-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: rgba(0,230,180,.07);
    color: var(--teal);
    font-size: .85rem;
    font-family: 'Sora', monospace;
    white-space: nowrap;
    border-right: 1px solid var(--input-border, #2e3d3a);
    user-select: none;
}
.su-url-wrap input {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 12px 14px;
}
.su-url-wrap input:focus {
    outline: none;
    box-shadow: none !important;
}

.su-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.su-btn {
    border: none;
    border-radius: 999px;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.6rem 1.2rem;
    transition: all 0.18s;
}
.su-btn--next {
    background: #19d4ad;
    color: #052e25;
}
.su-btn--next:hover { background: #21f0c6; box-shadow: 0 0 16px rgba(25,212,173,0.35); }
.su-btn--back {
    background: transparent;
    color: #7a908a;
    border: 1px solid rgba(255,255,255,0.08);
}
.su-btn--back:hover { color: #e8eeec; }

.su-field-err {
    font-size: 0.78rem;
    color: #ff8fa0;
    margin: 0.3rem 0 0;
}

@media (max-width: 520px) {
    .su-row { grid-template-columns: 1fr; }
    .lp-card--signup { padding: 1.5rem 1.25rem; }
}

/* Legacy login classes — kept for compatibility */
.login-page .login-wrap,
.login-page .login-card,
.login-page .utility { display: none !important; }

/* 10) Theme Toggle Controls */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #3a526a;
  background: #12263a;
  color: #d9ebff;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.theme-toggle:hover { background: #19334b; }
.theme-toggle-glyph {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid #d9ebff;
  box-shadow: inset -3px -3px 0 0 #d9ebff;
  transform: rotate(-20deg);
}
.theme-toggle-label { line-height: 1; }
body.theme-dark .theme-toggle {
  border-color: #4a6580;
  background: #0f2133;
}
body.theme-dark .theme-toggle-glyph {
  border-color: #ffe7a8;
  box-shadow: none;
  background: #ffd472;
  transform: none;
}

/* Dark mode component adjustments */
body.theme-dark .card,
body.theme-dark .module-tabs,
body.theme-dark .metric,
body.theme-dark table,
body.theme-dark .login-card {
  background: #162435;
  border-color: #25384f;
}
body.theme-dark th,
body.theme-dark td,
body.theme-dark .field-help,
body.theme-dark .dashboard-card-copy,
body.theme-dark .dashboard-workspace-row,
body.theme-dark .dashboard-workspace-row-last,
body.theme-dark .login-subtitle {
  color: #9cb0c5;
}
body.theme-dark tbody tr:hover { background: #1a2a3b; }
body.theme-dark .module-tabs .tab { color: #9ab0c5; }
body.theme-dark .module-tabs .tab.active { color: #dff0ff; }
body.theme-dark label { color: #aec1d3; }
body.theme-dark button:hover { background: #1b2a3b; }
body.theme-dark .top {
  background: rgba(16, 29, 45, 0.88);
  border-bottom-color: #203349;
}
body.theme-dark .top-subtle { color: #9cb0c5; }
body.theme-dark .flash.ok { background: #0f2a20; border-color: #1f5a43; color: #7fe0b2; }
body.theme-dark .flash.info { background: #17273f; border-color: #2f4f7a; color: #9cc9ff; }
body.theme-dark .flash.warn { background: #322713; border-color: #6f5427; color: #ffd892; }
body.theme-dark .flash.err { background: #301820; border-color: #613040; color: #ffb4c0; }
body.theme-dark .main {
  background: linear-gradient(180deg, #0f1929 0%, #111f31 100%);
}
body.theme-dark .utility {
  background: linear-gradient(180deg, #08111d 0%, #0b1624 100%);
  border-bottom-color: #1b2e42;
}
body.theme-dark .search {
  background: #0c1828;
  border-color: #2a3f57;
  color: #dceaf8;
}
body.theme-dark .search::placeholder {
  color: #8fa6bb;
}
body.theme-dark .login-card {
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
}
body.theme-dark .page-header h2,
body.theme-dark .form-page-title,
body.theme-dark .top strong {
  color: #e4edf8;
}
body.theme-dark .preview-modal-dialog { background: #162435; border-color: #25384f; }
body.theme-dark .preview-modal-head,
body.theme-dark .preview-modal-sub { border-color: #25384f; }
body.theme-dark #templatePreviewFrame { background: #fff; }
body.theme-dark .media-picker-item { background: var(--surface-elev); }

/* 11) Responsive Rules */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .nav { border-right: 0; border-bottom: 1px solid #203341; }
  .analytics-grid { grid-template-columns: 1fr 1fr; }
  .timeline-chart-wrap { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .page-header { flex-direction: column; align-items: flex-start; }
  .form-grid-2, .form-grid-3, .dashboard-split { grid-template-columns: 1fr; }
  .checkbox-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .utility { padding: 10px 12px; }
  .search { width: 100%; max-width: none; }
  .top { padding: 12px 12px; }
  .main-inner { padding: 14px; }
}

@media (max-width: 760px) {
  .analytics-grid { grid-template-columns: 1fr; }
  .utility-links { display: none; }
  .preview-modal-dialog { width: calc(100vw - 20px); margin: 10px auto; height: calc(100vh - 20px); }
  .media-picker-toolbar { grid-template-columns: 1fr; }
}

/* ============================================================
   Landing page  (scoped to body.landing-page)
   ============================================================ */

/* ---------- tokens ---------- */
.landing-page {
    --l-bg: #0b0f0e;
    --l-surface: #111815;
    --l-card: #141c19;
    --l-border: rgba(255,255,255,0.07);
    --l-text: #e8eeec;
    --l-muted: #7a908a;
    --l-accent: #19d4ad;
    --l-accent2: #a78bfa;
    --l-amber: #f0ab44;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--l-bg);
    color: var(--l-text);
    font-family: "Plus Jakarta Sans", sans-serif;
    overflow-x: hidden;
}

/* ---------- ambient orbs ---------- */
.l-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}
.l-orb--teal   { width: 820px; height: 820px; top: -220px; left: -200px; background: rgba(25, 212, 173, 0.12); }
.l-orb--violet { width: 600px; height: 600px; top: 40%; right: -180px; background: rgba(167, 139, 250, 0.10); }
.l-orb--amber  { width: 480px; height: 480px; bottom: 10%; left: 30%; background: rgba(240, 171, 68, 0.07); }

/* everything above the orbs */
.landing-page > *:not(.l-orb) { position: relative; z-index: 1; }

/* ---------- nav ---------- */
.l-nav {
    max-width: 1160px;
    margin: 0 auto;
    padding: 1.4rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}
.l-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: var(--l-text);
    font-family: "Sora", sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.01em;
}
.l-brand-icon {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 0.3rem;
    background: linear-gradient(140deg, var(--l-accent) 0%, #0fa88a 50%, var(--l-amber) 100%);
    box-shadow: 0 0 12px rgba(25, 212, 173, 0.45);
}
.l-nav-links {
    display: flex;
    gap: 1.5rem;
    margin-left: 1rem;
}
.l-nav-links a {
    color: var(--l-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.18s;
}
.l-nav-links a:hover { color: var(--l-text); }

/* nav spacer — group sign-in + get-started buttons */
.l-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* ---------- buttons ---------- */
.l-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 0.6rem 1.25rem;
    transition: all 0.18s;
    white-space: nowrap;
    cursor: pointer;
    border: none;
}
.l-btn--primary {
    background: var(--l-accent);
    color: #052e25;
}
.l-btn--primary:hover {
    background: #21f0c6;
    box-shadow: 0 0 22px rgba(25, 212, 173, 0.45);
}
.l-btn--outline {
    background: transparent;
    color: var(--l-text);
    border: 1px solid var(--l-border);
}
.l-btn--outline:hover {
    border-color: rgba(25, 212, 173, 0.45);
    color: var(--l-accent);
}
.l-btn--ghost {
    background: rgba(255,255,255,0.06);
    color: var(--l-muted);
    border: 1px solid var(--l-border);
}
.l-btn--ghost:hover { color: var(--l-text); background: rgba(255,255,255,0.09); }
.l-btn--lg { padding: 0.85rem 1.75rem; font-size: 1rem; }

/* ---------- badge ---------- */
.l-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(25, 212, 173, 0.1);
    color: var(--l-accent);
    border: 1px solid rgba(25, 212, 173, 0.25);
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.4rem;
}

/* ---------- hero ---------- */
.l-hero {
    max-width: 1160px;
    margin: 3rem auto 0;
    padding: 0 2rem 5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
    align-items: center;
}
.l-hero-h1 {
    font-family: "Sora", sans-serif;
    font-size: clamp(2.2rem, 2.8vw + 1rem, 3.6rem);
    line-height: 1.1;
    font-weight: 800;
    margin: 0 0 1.25rem;
    letter-spacing: -0.02em;
}
.l-gradient-text {
    background: linear-gradient(110deg, var(--l-accent) 20%, var(--l-accent2) 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.l-hero-sub {
    color: var(--l-muted);
    line-height: 1.65;
    font-size: 1.05rem;
    max-width: 48ch;
    margin: 0 0 2rem;
}
.l-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ---------- mockup ---------- */
.l-hero-visual { perspective: 1200px; }
.l-mockup {
    background: #0e1512;
    border: 1px solid rgba(25, 212, 173, 0.18);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow:
        0 2px 0 rgba(25,212,173,0.12) inset,
        0 32px 80px rgba(0,0,0,0.55),
        0 0 0 1px rgba(255,255,255,0.04);
    transform: rotateY(-4deg) rotateX(2deg);
    transition: transform 0.4s ease;
}
.l-mockup:hover { transform: rotateY(0) rotateX(0); }
.l-mockup-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    background: #0b110e;
    border-bottom: 1px solid var(--l-border);
}
.l-dot {
    width: 0.6rem; height: 0.6rem;
    border-radius: 50%;
}
.l-dot--r { background: #ff5f57; }
.l-dot--y { background: #febc2e; }
.l-dot--g { background: #28c840; }
.l-mockup-tab {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--l-muted);
    padding: 0.22rem 0.7rem;
    border-radius: 0.4rem;
    margin-left: 0.35rem;
    cursor: default;
}
.l-mockup-tab.active {
    background: rgba(25, 212, 173, 0.12);
    color: var(--l-accent);
}
.l-mockup-body { padding: 0.85rem; }

.l-mk-row {
    display: grid;
    grid-template-columns: 2fr 1.1fr 1fr 1fr;
    padding: 0.45rem 0.3rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    align-items: center;
    gap: 0.5rem;
}
.l-mk-row--header { margin-bottom: 0.1rem; }
.l-mk-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--l-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.l-mk-cell { font-size: 0.78rem; color: #c5d4d0; }
.l-mk-name { font-weight: 600; color: var(--l-text); font-size: 0.8rem; }
.l-mk-hi { color: var(--l-accent); font-weight: 700; font-size: 0.8rem; }

.l-mk-badge {
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    display: inline-block;
}
.l-mk-badge--sent   { background: rgba(25,212,173,0.14); color: var(--l-accent); }
.l-mk-badge--active { background: rgba(167,139,250,0.14); color: var(--l-accent2); }
.l-mk-badge--sched  { background: rgba(240,171,68,0.14); color: var(--l-amber); }

.l-mk-chart { margin-top: 0.9rem; padding-top: 0.7rem; border-top: 1px solid rgba(255,255,255,0.05); }
.l-mk-chart-title {
    font-size: 0.67rem;
    color: var(--l-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}
.l-mk-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 56px;
}
.l-bar {
    flex: 1;
    height: var(--h, 50%);
    background: rgba(25, 212, 173, 0.22);
    border-radius: 2px 2px 0 0;
    transition: background 0.2s;
}
.l-bar--accent { background: rgba(25, 212, 173, 0.7); }

/* ---------- stats strip ---------- */
.l-stats {
    max-width: 1160px;
    margin: 0 auto 5rem;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--l-border);
    border-radius: 1rem;
}
.l-stat {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 1rem;
    gap: 0.2rem;
}
.l-stat strong {
    font-family: "Sora", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--l-accent);
}
.l-stat span {
    font-size: 0.78rem;
    color: var(--l-muted);
}
.l-stat-sep {
    width: 1px;
    height: 2.5rem;
    background: var(--l-border);
}

/* ---------- features section ---------- */
.l-features {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 2rem 6rem;
    text-align: center;
}
.l-section-label {
    display: inline-block;
    color: var(--l-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.9rem;
}
.l-section-h2 {
    font-family: "Sora", sans-serif;
    font-size: clamp(1.6rem, 2vw + 0.8rem, 2.6rem);
    font-weight: 800;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}
.l-section-sub {
    color: var(--l-muted);
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 56ch;
    margin: 0 auto 2.75rem;
}
.l-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    text-align: left;
}
.l-card {
    background: var(--l-card);
    border: 1px solid var(--l-border);
    border-radius: 1.15rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.l-card:hover {
    border-color: rgba(25, 212, 173, 0.28);
    box-shadow: 0 0 32px rgba(25, 212, 173, 0.06);
}
.l-card-icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.65rem;
    background: rgba(25, 212, 173, 0.1);
    border: 1px solid rgba(25, 212, 173, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--l-accent);
    margin-bottom: 0.25rem;
    flex-shrink: 0;
}
.l-card h3 {
    margin: 0;
    font-family: "Sora", sans-serif;
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--l-text);
}
.l-card p {
    margin: 0;
    color: var(--l-muted);
    line-height: 1.55;
    font-size: 0.88rem;
}
.l-card-tag {
    margin-top: auto;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(25, 212, 173, 0.6);
    letter-spacing: 0.03em;
}

/* ---------- Why InboxGP ---------- */
.l-why {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 2rem 6rem;
    text-align: center;
}
.l-why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    text-align: left;
    margin-top: 2.75rem;
}
.l-why-item {
    display: flex;
    gap: 1rem;
    background: #141c19;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 1.15rem;
    padding: 1.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.l-why-item:hover {
    border-color: rgba(25, 212, 173, 0.28);
    box-shadow: 0 0 32px rgba(25, 212, 173, 0.06);
}
.l-why-icon {
    flex-shrink: 0;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.6rem;
    background: rgba(25, 212, 173, 0.1);
    border: 1px solid rgba(25, 212, 173, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #19d4ad;
    margin-top: 0.05rem;
}
.l-why-item h4 {
    margin: 0 0 0.45rem;
    font-family: "Sora", sans-serif;
    font-size: 0.93rem;
    font-weight: 700;
    color: #e8eeec;
}
.l-why-item p {
    margin: 0;
    color: #7a908a;
    font-size: 0.86rem;
    line-height: 1.6;
}
.l-why-item p em {
    font-style: normal;
    color: #19d4ad;
}
@media (max-width: 960px) {
    .l-why-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .l-why-grid { grid-template-columns: 1fr; }
    .l-why { padding: 0 1.25rem 3.5rem; }
}

/* ---------- CTA band ---------- */
.l-cta-band {
    position: relative;
    overflow: hidden;
    margin: 0 2rem 0;
    max-width: calc(1160px);
    margin-left: auto;
    margin-right: auto;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, #0e1c18 0%, #0d1714 50%, #130e1f 100%);
    border: 1px solid rgba(25, 212, 173, 0.18);
    padding: 5rem 3rem;
    text-align: center;
    margin-bottom: 5rem;
}
.l-cta-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(25,212,173,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.l-cta-inner { position: relative; z-index: 1; }
.l-cta-h2 {
    font-family: "Sora", sans-serif;
    font-size: clamp(1.6rem, 2vw + 0.9rem, 2.8rem);
    font-weight: 800;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}
.l-cta-sub {
    color: var(--l-muted);
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 52ch;
    margin: 0 auto 2.25rem;
}
.l-cta-actions { display: flex; justify-content: center; gap: 0.85rem; }

/* ---------- footer ---------- */
.l-footer {
    max-width: 1160px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-top: 1px solid var(--l-border);
    margin-bottom: 0;
}
.l-footer-copy {
    color: var(--l-muted);
    font-size: 0.82rem;
    margin-left: auto;
}
.l-footer-link {
    color: var(--l-muted);
    font-size: 0.82rem;
    text-decoration: none;
    transition: color 0.18s;
}
.l-footer-link:hover { color: var(--l-accent); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
    .l-hero { grid-template-columns: 1fr; gap: 2.5rem; }
    .l-hero-visual { display: none; }
    .l-cards { grid-template-columns: repeat(2, 1fr); }
    .l-stat-sep { display: none; }
    .l-stat { flex: 0 0 50%; }
}
@media (max-width: 640px) {
    .l-nav-links { display: none; }
    .l-cards { grid-template-columns: 1fr; }
    .l-stat { flex: 0 0 100%; }
    .l-cta-band { padding: 3rem 1.5rem; margin: 0 1rem 3rem; }
    .l-hero { padding: 0 1.25rem 3.5rem; }
    .l-features { padding: 0 1.25rem 3.5rem; }
    .l-stats { margin: 0 1.25rem 3.5rem; }
    .l-footer { padding: 1.5rem 1.25rem; gap: 1rem; flex-wrap: wrap; }
    .l-footer-copy { margin-left: 0; }
}

/* ════════════════════════════════════════════════════════════
   Analytics page  (.an-*)
   ════════════════════════════════════════════════════════════ */
.an-wrap { display: flex; flex-direction: column; gap: 1.5rem; }

/* ── Page header ── */
.an-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
}
.an-eyebrow {
    font-size: .7rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--brand); margin: 0 0 .2rem;
}
.an-title {
    font-size: 1.65rem; font-weight: 900; letter-spacing: -.03em;
    margin: 0; color: var(--text-primary);
}

/* ── Range pill selector ── */
.an-range-form {
    display: flex; gap: 2px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
}
.an-range-btn {
    background: transparent; border: none;
    color: var(--text-secondary);
    font-family: inherit; font-size: .8rem; font-weight: 600;
    padding: .3rem .75rem; border-radius: 8px; cursor: pointer;
    transition: background .15s, color .15s;
}
.an-range-btn:hover { color: var(--text-primary); }
.an-range-btn--active {
    background: var(--surface-elev);
    color: var(--brand);
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

/* ── KPI strip ── */
.an-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.an-kpi {
    position: relative; overflow: hidden;
    border-radius: 16px;
    padding: 1.25rem 1.35rem 1.1rem;
    border: 1px solid var(--border);
    background: var(--surface-elev);
    box-shadow: var(--shadow-soft);
}
.an-kpi-glow {
    position: absolute; top: -40px; right: -20px;
    width: 120px; height: 120px; border-radius: 50%;
    opacity: .12; pointer-events: none;
}
.an-kpi--blue  .an-kpi-glow { background: #3b82f6; }
.an-kpi--teal  .an-kpi-glow { background: #12c972; }
.an-kpi--purple .an-kpi-glow { background: #a855f7; }
.an-kpi--amber .an-kpi-glow { background: #f59e0b; }
.an-kpi--red   .an-kpi-glow { background: #ef4444; }

.an-kpi-icon {
    position: absolute; bottom: .9rem; right: 1rem;
    width: 28px; height: 28px; opacity: .15;
}
.an-kpi--blue   { border-top: 2px solid #3b82f6; }
.an-kpi--blue   .an-kpi-icon { color: #3b82f6; opacity: .3; }
.an-kpi--teal   { border-top: 2px solid #12c972; }
.an-kpi--teal   .an-kpi-icon { color: #12c972; opacity: .3; }
.an-kpi--purple { border-top: 2px solid #a855f7; }
.an-kpi--purple .an-kpi-icon { color: #a855f7; opacity: .3; }
.an-kpi--amber  { border-top: 2px solid #f59e0b; }
.an-kpi--amber  .an-kpi-icon { color: #f59e0b; opacity: .3; }
.an-kpi--red    { border-top: 2px solid #ef4444; }
.an-kpi--red    .an-kpi-icon { color: #ef4444; opacity: .3; }

.an-kpi-label {
    font-size: .7rem; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: var(--text-secondary); margin: 0 0 .5rem;
}
.an-kpi-value {
    font-size: 2rem; font-weight: 900; letter-spacing: -.04em;
    line-height: 1; margin: 0 0 .4rem; color: var(--text-primary);
}
.an-kpi-unit { font-size: 1.1rem; font-weight: 700; opacity: .6; }
.an-kpi-sub  { font-size: .73rem; color: var(--text-secondary); margin: 0; }

/* ── Shared card padding ── */
.an-chart-card.card,
.an-table-card.card { padding: 1.4rem; }

/* ── Chart ── */
.an-chart-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.an-section-title { font-size: 1rem; font-weight: 700; margin: 0 0 .2rem; color: var(--text-primary); }
.an-section-sub   { font-size: .82rem; color: var(--text-secondary); margin: 0; }
.an-chart-legend {
    display: flex; align-items: center; gap: .85rem;
    font-size: .78rem; color: var(--text-secondary); flex-wrap: wrap;
}
.an-legend-pip {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 3px; margin-right: .3rem; vertical-align: middle;
}
.an-chart-body  { position: relative; height: 270px; }

/* ── Table ── */
.an-table-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.an-table-controls { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.an-search-wrap { position: relative; }
.an-search-icon {
    position: absolute; left: .65rem; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; color: var(--text-secondary); pointer-events: none;
}
.an-search {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    padding: .5rem .85rem .5rem 2rem;
    font-size: .84rem;
    font-family: inherit;
    min-width: 180px;
}
.an-search:focus { outline: none; border-color: var(--brand); }
.an-select {
    appearance: none;
    background: var(--surface-muted) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2312c972' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right .7rem center;
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: .5rem 2rem .5rem .8rem;
    font-size: .84rem;
    font-family: inherit;
    cursor: pointer;
}
.an-select:focus { outline: none; border-color: var(--brand); }
.an-table-wrap { overflow-x: auto; margin: 0 -1.4rem; }
.an-table { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 700px; }
.an-table thead th {
    padding: .6rem 1.4rem;
    text-align: left;
    font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-secondary); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.an-col-num  { text-align: right; }
.an-col-rate { text-align: right; min-width: 120px; }
.an-tr td {
    padding: .8rem 1.4rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-primary);
}
.an-tr:last-child td { border-bottom: none; }
.an-tr:hover { background: var(--surface-muted); }

/* ── Campaign name cell ── */
.an-td-name { display: flex; align-items: center; gap: .75rem; }
.an-avatar {
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: 9px;
    background: color-mix(in srgb, var(--av) 20%, var(--surface-muted));
    color: var(--av);
    font-size: .75rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid color-mix(in srgb, var(--av) 35%, transparent);
}
.an-campaign-name { font-weight: 600; color: var(--text-primary); }
.an-campaign-sub  { font-size: .74rem; color: var(--text-secondary); margin-top: .1rem; }
.an-date-chip { font-size: .78rem; color: var(--text-secondary); white-space: nowrap; }

/* ── Rate cell: chip + minibar ── */
.an-rate-cell { display: flex; align-items: center; gap: .5rem; justify-content: flex-end; }
.an-chip { font-size: .72rem; font-weight: 700; padding: .18rem .45rem; border-radius: 99px; white-space: nowrap; }
.an-chip--good { background: rgba(18,201,114,.12);  color: #0cae63; }
.an-chip--med  { background: rgba(245,158,11,.12);   color: #d97706; }
.an-chip--low  { background: rgba(221,66,92,.12);    color: #dd425c; }
.an-minibar { width: 44px; height: 4px; border-radius: 99px; background: var(--border); flex-shrink: 0; }
.an-minibar-fill { height: 4px; border-radius: 99px; }
.an-minibar--good { background: var(--brand); }
.an-minibar--med  { background: #f59e0b; }
.an-minibar--low  { background: var(--danger); }

/* ── Pagination ── */
.an-pagination {
    display: flex; align-items: center; justify-content: space-between;
    padding: .9rem 1.4rem 0; flex-wrap: wrap; gap: .5rem;
}
.an-pag-info { font-size: .79rem; color: var(--text-secondary); }
.an-pag-btns { display: flex; gap: .5rem; }
.an-pag-btn {
    background: var(--surface-muted); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 8px;
    padding: .38rem .9rem; font-size: .8rem; cursor: pointer; font-family: inherit;
}
.an-pag-btn:disabled { opacity: .3; cursor: not-allowed; }
.an-pag-btn:not(:disabled):hover { border-color: var(--brand); color: var(--brand); }

/* ── Empty state ── */
.an-empty-state {
    padding: 3rem 1.5rem; text-align: center;
    color: var(--text-secondary); font-size: .9rem;
}
.an-empty-state svg { width: 36px; height: 36px; margin: 0 auto .75rem; display: block; opacity: .3; }

/* Campaign analytics detail page built on analytics design system */
.campaign-analytics-wrap { gap: 1.25rem; }
.campaign-an-head { margin-bottom: .1rem; }
.campaign-kpi-strip .an-kpi { min-height: 148px; }
.campaign-chart-card { padding-bottom: 1.1rem; }
.campaign-table-card { padding-top: 1.1rem; }
.campaign-table-head { margin-bottom: .8rem; }
.campaign-table-wrap { margin-top: .2rem; }
.campaign-table-wrap .an-table { min-width: 620px; }
.campaign-table-wrap .an-table td,
.campaign-table-wrap .an-table th { white-space: nowrap; }
#live-updated-at { margin: 0; }

/* ── Email Validation page ──────────────────────────────────────────────── */
.ev-card { margin-bottom: 1.5rem; }
.ev-section-header { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.ev-section-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.ev-section-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.ev-form-row { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.ev-field { flex: 1; min-width: 260px; }
.ev-label { font-size: 12px; color: var(--text-secondary); display: block; margin-bottom: .35rem; }
.ev-input { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-elev); color: var(--text-primary); font-size: 13px; font-family: inherit; outline: none; box-sizing: border-box; }
.ev-result { margin-top: 1rem; display: none; }
.ev-bulk-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: .5rem; }
.ev-bulk-controls { display: flex; gap: .5rem; align-items: center; }
.ev-mx-label { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
.ev-progress { margin-bottom: 1rem; }
.ev-progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.ev-progress-track { height: 6px; border-radius: 4px; background: var(--border); overflow: hidden; }
.ev-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand), #0af); border-radius: 4px; transition: width .4s; }
.ev-stats { display: none; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.ev-stat { text-align: center; padding: .6rem .4rem; }
.ev-stat-num { font-size: 1.4rem; font-weight: 700; }
.ev-stat-lbl { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.ev-result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; padding: .75rem; background: var(--bg); border-radius: 10px; border: 1px solid var(--border); }
.ev-result-cell { text-align: center; }
.ev-result-cell-flex { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ev-result-score { font-size: 2rem; font-weight: 800; }
.ev-result-metric-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; margin-top: 4px; }
.ev-result-issues { margin-top: .6rem; font-size: 12px; color: var(--text-secondary); }
.ev-result-ok { margin-top: .6rem; font-size: 12px; color: #22c55e; }
.ev-risk-chip { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; }

/* ── Onboarding: sending setup ─────────────────────────────────────────── */
.onboard-wrap { max-width: 580px; margin: 48px auto 64px; }
.onboard-wrap h2 { margin: 0 0 6px; font-size: 1.45rem; color: var(--text-primary); }
.onboard-wrap .subtitle { margin: 0 0 28px; color: var(--text-secondary); font-size: .9rem; }

.mode-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.mode-card { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border: 2px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface-elev); transition: border-color .15s, background .15s; }
.mode-card:hover { border-color: var(--brand); }
.mode-card.selected { border-color: var(--brand); background: var(--surface-muted); }
.mode-card input[type="radio"] {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  padding: 0;
  margin: 3px 0 0;
  accent-color: var(--brand);
  flex: 0 0 16px;
}
.mode-card-body { flex: 1 1 auto; min-width: 0; }
.mode-card-body strong { font-size: .95rem; color: var(--text-primary); display: flex; align-items: center; gap: 8px; font-weight: 600; }
.mode-card-body p { margin: 3px 0 0; font-size: .84rem; color: var(--text-secondary); line-height: 1.5; font-weight: normal; }
.badge-rec { background: #d1fae5; color: #065f46; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; letter-spacing: .02em; }
body.theme-dark .badge-rec { background: #064e35; color: #6ee7b7; }

.onboard-form { display: none; }
.onboard-form.active { display: block; }
.onboard-form .card { padding: 20px 22px; }

.prefix-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 18px; }
.prefix-opt { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--surface-muted); transition: border-color .12s, background .12s; }
.prefix-opt:hover { border-color: var(--brand); }
.prefix-opt.selected { border-color: var(--brand); background: var(--surface-elev); }
.prefix-opt input[type="radio"] {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  accent-color: var(--brand);
  flex: 0 0 16px;
}
.prefix-opt code { font-size: .82rem; color: var(--text-primary); }

.prefix-custom-row { display: none; margin: 2px 0 12px; }
.prefix-custom-row.is-visible { display: block; }
.prefix-custom-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}
.prefix-custom-input-wrap input {
  max-width: 260px;
}
.prefix-custom-domain {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.skip-link { text-align: center; margin-top: 18px; }
.skip-link button { background: none; border: none; color: var(--text-secondary); font-size: .84rem; cursor: pointer; text-decoration: underline; padding: 0; }
.skip-link button:hover { color: var(--text-primary); }
