/* =====================================================================
   Eventogen Mailer - SaaS theme v2 (modern dashboard)
   Bootstrap 5 base, light/dark via [data-bs-theme].
   ===================================================================== */

:root {
  --brand:         #1f9e98;
  --brand-600:     #16857f;
  --brand-grad:    linear-gradient(135deg, #1f9e98 0%, #3bb7ae 100%);
  --sidebar-w:     260px;
  --sidebar-bg:    #151b1f;
  --sidebar-bg2:   #12181b;
  --sidebar-fg:    #9aa6ad;
  --ring:          rgba(31,158,152,.35);
  --radius:        16px;
}

/* Dark mode: navy surfaces that match the sidebar (instead of Bootstrap grey). */
[data-bs-theme="dark"] {
  --bs-body-bg: #161d21;
  --bs-body-bg-rgb: 22,29,33;
  --bs-tertiary-bg: #1b2327;
  --bs-tertiary-bg-rgb: 27,35,39;
  --bs-secondary-bg: #222b30;
  --bs-border-color: rgba(255,255,255,.08);
  --bs-border-color-translucent: rgba(255,255,255,.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: #f5f7f8;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1c2434;
  -webkit-font-smoothing: antialiased;
}
[data-bs-theme="dark"] body { background: #101518; color: #e5eaec; }
a { text-decoration: none; }

/* ---- Shell ------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

/* ---- Sidebar ----------------------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  background:
    radial-gradient(120% 40% at 0% 0%, rgba(31,158,152,.20) 0%, transparent 60%),
    radial-gradient(90% 30% at 100% 100%, rgba(59,183,174,.10) 0%, transparent 70%),
    linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg2) 100%);
  color: var(--sidebar-fg);
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  padding: 18px 14px 14px; z-index: 1040;
  border-right: 1px solid rgba(255,255,255,.04);
  transition: transform .22s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  color: #fff; font-weight: 800; font-size: 1.15rem;
  padding: 4px 10px 18px; letter-spacing: -.02em;
}
.sidebar-brand .brand-logo {
  width: 36px; height: 36px; border-radius: 11px; flex: 0 0 auto;
  background: var(--brand-grad);
  display: grid; place-items: center; color: #fff; font-size: 1.05rem;
  box-shadow: 0 8px 20px -6px rgba(31,158,152,.7), inset 0 1px 0 rgba(255,255,255,.25);
}
.sidebar-brand .brand-img { height: 36px; max-width: 150px; width: auto; object-fit: contain; border-radius: 8px; }
.sidebar-brand .brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav {
  display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; margin: 0 -6px; padding: 0 6px 30px;
  scrollbar-width: thin; scrollbar-color: transparent transparent;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 14px), transparent);
          mask-image: linear-gradient(180deg, #000 calc(100% - 14px), transparent);
}
.sidebar-nav:hover { scrollbar-color: rgba(255,255,255,.14) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 9px; }
.sidebar-nav:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); }
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 12px;
  color: var(--sidebar-fg); padding: 9px 12px; border-radius: 10px;
  font-size: .875rem; font-weight: 500; position: relative;
  transition: background .15s, color .15s;
}
.sidebar-nav .nav-link i { font-size: 1rem; width: 20px; text-align: center; opacity: .85; transition: color .15s, opacity .15s; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.045); color: #f1f4f5; }
.sidebar-nav .nav-link:hover i { opacity: 1; }
.sidebar-nav .nav-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(31,158,152,.26), rgba(31,158,152,.08));
  box-shadow: inset 0 0 0 1px rgba(92,193,187,.18);
}
.sidebar-nav .nav-link.active i { color: #7fd6cf; opacity: 1; }
.sidebar-nav .nav-link.active::before {
  content: ''; position: absolute; left: -6px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #4fc0b8, #1f9e98); box-shadow: 0 0 12px rgba(31,158,152,.9);
}
.sidebar-nav .nav-link .badge { font-size: .66rem; }
.sidebar-section {
  text-transform: uppercase; font-size: .64rem; letter-spacing: .14em;
  color: #7d8894; padding: 16px 12px 6px; font-weight: 700;
}

/* plan + usage card */
.sidebar-plan {
  display: block; margin: 8px 2px 0; padding: 12px 13px; border-radius: 13px; color: var(--sidebar-fg);
  background: linear-gradient(160deg, rgba(31,158,152,.20), rgba(59,183,174,.06));
  border: 1px solid rgba(92,193,187,.20); transition: border-color .15s, transform .15s;
}
.sidebar-plan:hover { border-color: rgba(92,193,187,.45); color: var(--sidebar-fg); transform: translateY(-1px); }
.sidebar-plan .sp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-plan .sp-name { color: #fff; font-weight: 700; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-plan .sp-name i { color: #fbbf24; margin-right: 2px; }
.sidebar-plan .sp-cta { font-size: .72rem; font-weight: 600; color: #7fd6cf; white-space: nowrap; }
.sidebar-plan .sp-usage { display: flex; justify-content: space-between; gap: 6px; font-size: .7rem; margin-top: 8px; }
.sidebar-plan .sp-bar { height: 5px; border-radius: 9px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 6px; }
.sidebar-plan .sp-bar > span { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, #4fc0b8, #1f9e98); }
.sidebar-plan .sp-bar > span.hot { background: linear-gradient(90deg, #f59e0b, #ef4444); }

/* upgrade card (legacy) */
.upgrade-card {
  margin-top: 12px; border-radius: 14px; padding: 16px;
  background: linear-gradient(160deg, rgba(31,158,152,.22), rgba(59,183,174,.12));
  border: 1px solid rgba(59,183,174,.25); text-align: center;
}
.upgrade-card .crown { color: #fbbf24; font-size: 1.2rem; }
.upgrade-card .u-title { color: #fff; font-weight: 700; font-size: .92rem; margin: 6px 0 2px; }
.upgrade-card .u-sub { color: var(--sidebar-fg); font-size: .76rem; margin-bottom: 12px; }
.upgrade-card .btn { background: var(--brand-grad); border: 0; color: #fff; font-weight: 600; width: 100%; }

/* bottom theme switch */
.sidebar-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 8px 2px; margin-top: 10px; color: var(--sidebar-fg); font-size: .82rem;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-foot .form-check-input { background-color: rgba(255,255,255,.12); border-color: rgba(255,255,255,.14); cursor: pointer; }
.sidebar-foot .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* ---- Main / topbar ----------------------------------------------- */
.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 18px;
  background: var(--bs-body-bg);
  padding: 16px 28px; position: sticky; top: 0; z-index: 1030;
  border-bottom: 1px solid rgba(28,40,48,.06);
}
[data-bs-theme="dark"] .topbar { border-bottom-color: rgba(255,255,255,.06); }
.topbar-heading { flex: 0 0 auto; }
.topbar-heading h1 { font-size: 1.45rem; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.topbar-heading .welcome { color: #7d8894; font-size: .86rem; margin: 0; }

.topbar-search { flex: 1; max-width: 520px; margin: 0 auto; position: relative; display: flex; align-items: center;
  border: 1px solid rgba(28,40,48,.10); background: #f6f8f9; border-radius: 12px; padding: 11px 12px 11px 42px; cursor: text; }
.topbar-search:hover { border-color: rgba(31,158,152,.4); }
[data-bs-theme="dark"] .topbar-search { background: #1b2327; border-color: rgba(255,255,255,.08); }
.topbar-search-ph { flex: 1; text-align: left; font-size: .9rem; color: #8a94a0; }
.topbar-search .search-ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #8a94a0; }
.topbar-search .kbd {
  font-size: .72rem; color: #8a94a0; border: 1px solid rgba(28,40,48,.12); border-radius: 6px; padding: 1px 7px; white-space: nowrap;
}

/* ---- Command palette (Ctrl/Cmd + K) ------------------------------ */
.cmdk { position: fixed; inset: 0; z-index: 1100; background: rgba(16,22,26,.45); backdrop-filter: blur(2px);
  display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.cmdk.open { display: flex; }
.cmdk-box { width: 100%; max-width: 600px; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
  border-radius: 16px; box-shadow: 0 30px 70px -20px rgba(28,40,48,.5); overflow: hidden; animation: cmdkIn .14s ease; }
@keyframes cmdkIn { from { opacity: 0; transform: translateY(-8px) scale(.99); } to { opacity: 1; transform: none; } }
.cmdk-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--bs-border-color); }
.cmdk-head > i { font-size: 1.1rem; color: #8a94a0; }
.cmdk-head input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 1.02rem; color: var(--bs-body-color); }
.cmdk-head kbd { font-size: .68rem; color: #8a94a0; border: 1px solid var(--bs-border-color); border-radius: 5px; padding: 2px 6px; }
.cmdk-list { max-height: 56vh; overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .5px; color: #8a94a0; padding: 10px 12px 4px; font-weight: 600; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--bs-body-color); text-decoration: none; }
.cmdk-item .ci-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--bs-tertiary-bg); color: var(--brand); font-size: .95rem; flex: 0 0 auto; }
.cmdk-item .ci-label { flex: 1; font-size: .92rem; font-weight: 500; min-width: 0; }
.cmdk-item .ci-sub { font-weight: 400; color: #8a94a0; font-size: .82rem; margin-left: 6px; }
.cmdk-item .ci-enter { font-size: .7rem; color: #8a94a0; opacity: 0; }
.cmdk-item.active { background: color-mix(in srgb, var(--brand) 12%, var(--bs-body-bg)); }
.cmdk-item.active .ci-ico { background: var(--brand); color: #fff; }
.cmdk-item.active .ci-enter { opacity: 1; }
.cmdk-empty { text-align: center; color: #8a94a0; padding: 36px 16px; }
.cmdk-empty > i { font-size: 1.6rem; display: block; margin-bottom: 6px; opacity: .5; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(28,40,48,.08); background: #f6f8f9; color: #556270; position: relative;
  font-size: 1.05rem;
}
[data-bs-theme="dark"] .icon-btn { background: #1b2327; border-color: rgba(255,255,255,.07); color: #c3cbd2; }
.icon-btn:hover { background: #eef2f3; color: var(--brand); }
.icon-btn .badge-dot {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
  background: #f43f5e; color: #fff; border-radius: 9px; font-size: .66rem; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--bs-body-bg);
}

/* ---- Notifications dropdown ------------------------------------- */
.notif-menu {
  width: 360px; max-width: 92vw; padding: 0; overflow: hidden;
  border: 1px solid rgba(28,40,48,.08); border-radius: 14px;
  box-shadow: 0 18px 48px rgba(28,40,48,.16);
}
[data-bs-theme="dark"] .notif-menu { border-color: rgba(255,255,255,.08); }
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; font-weight: 700; font-size: .9rem;
  border-bottom: 1px solid rgba(28,40,48,.07);
}
[data-bs-theme="dark"] .notif-head { border-bottom-color: rgba(255,255,255,.07); }
.notif-head .notif-count {
  background: var(--brand-grad); color: #fff; font-size: .68rem; font-weight: 700;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-grid; place-items: center;
}
.notif-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 28px 16px; color: #7d8894; font-size: .85rem;
}
.notif-empty i { font-size: 1.6rem; color: #22c55e; }
.notif-item {
  display: flex; gap: 12px; padding: 12px 16px; color: inherit;
  border-bottom: 1px solid rgba(28,40,48,.05); transition: background .12s;
}
[data-bs-theme="dark"] .notif-item { border-bottom-color: rgba(255,255,255,.05); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: #f6f8f9; }
[data-bs-theme="dark"] .notif-item:hover { background: #1b2327; }
.notif-ico {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 1rem;
  background: #eef2f3; color: #556270;
}
[data-bs-theme="dark"] .notif-ico { background: #1b2327; color: #c3cbd2; }
.notif-item.notif-error   .notif-ico { background: rgba(244,63,94,.12);  color: #f43f5e; }
.notif-item.notif-warning .notif-ico { background: rgba(245,158,11,.14); color: #d97706; }
.notif-item.notif-success .notif-ico { background: rgba(34,197,94,.14);  color: #16a34a; }
.notif-item.notif-info    .notif-ico { background: rgba(31,158,152,.14); color: var(--brand); }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-title { font-size: .82rem; line-height: 1.35; font-weight: 500; }
.notif-time { font-size: .7rem; color: #7d8894; }
.btn-user { display: flex; align-items: center; gap: 10px; border: none; background: transparent; color: inherit; padding: 4px 6px; }
.btn-user .avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--brand-grad); color: #fff; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-user .u-meta { text-align: left; line-height: 1.1; }
.btn-user .u-meta .u-name { font-weight: 700; font-size: .9rem; }
.btn-user .u-meta .u-mail { font-size: .76rem; color: #7d8894; }

.date-pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(28,40,48,.10); background: var(--bs-body-bg); color: #556270;
  border-radius: 11px; padding: 9px 14px; font-size: .85rem; font-weight: 500;
}
[data-bs-theme="dark"] .date-pill { border-color: rgba(255,255,255,.08); color: #c3cbd2; }

.content { padding: 26px 28px 40px; flex: 1; }

/* ---- Cards ------------------------------------------------------- */
.card {
  border: 1px solid rgba(28,40,48,.06); border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(28,40,48,.04), 0 8px 24px -18px rgba(28,40,48,.18);
  background: var(--bs-body-bg);
}
[data-bs-theme="dark"] .card { border-color: rgba(255,255,255,.06); }
.card-header { background: transparent; border-bottom: 1px solid rgba(28,40,48,.06); font-weight: 700; padding: 16px 20px; }
[data-bs-theme="dark"] .card-header { border-bottom-color: rgba(255,255,255,.06); }

/* ---- Stat cards (with sparkline) --------------------------------- */
.stat-card {
  padding: 20px; border-radius: var(--radius); background: var(--bs-body-bg);
  border: 1px solid rgba(28,40,48,.06); height: 100%;
  box-shadow: 0 1px 3px rgba(28,40,48,.04), 0 10px 26px -20px rgba(28,40,48,.25);
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 4px 16px;
  /* Size the value to the card's own width (below), not the viewport — so a
     wide value like "$99.00" never spills out when cards get narrow. */
  container-type: inline-size;
}
[data-bs-theme="dark"] .stat-card { border-color: rgba(255,255,255,.06); }
/* Base icon-chip styling — works anywhere (.stat-card adds size/layout). */
.stat-icon { display: grid; place-items: center; color: #fff; border-radius: 14px; line-height: 1; }
.stat-card .stat-icon {
  grid-row: 1 / 3; align-self: start;
  width: 52px; height: 52px; font-size: 1.35rem; box-shadow: 0 10px 22px -10px currentColor;
}
.stat-card .stat-top { align-self: center; min-width: 0; }
.stat-card .stat-label { color: #7d8894; font-size: .82rem; font-weight: 500; }
/* Let the text column shrink (min-width:0 above) and scale wide values — e.g.
   currency like "$99.00" — down so they never overflow the card. */
.stat-card .stat-top > .d-flex { min-width: 0; }
.stat-card .stat-value {
  font-size: clamp(1.2rem, 15cqi, 1.85rem);
  font-weight: 800; line-height: 1.1; letter-spacing: -.02em;
  min-width: 0; white-space: nowrap; overflow-wrap: anywhere;
}
/* Very narrow cards (no container-query support, or extreme widths): allow the
   value to wrap rather than overflow, as a final safety net. */
@supports not (container-type: inline-size) {
  .stat-card .stat-value { font-size: 1.5rem; white-space: normal; }
}
.stat-card .stat-foot { grid-column: 2 / 3; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-card .spark { width: 96px; height: 36px; flex: 0 0 auto; }
.delta { font-size: .78rem; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.delta .muted { color: #8a94a0; font-weight: 500; }
.delta.up { color: #16a34a; } .delta.down { color: #ef4444; } .delta.flat { color: #8a94a0; }

/* Dashboard variant: icon + value + sparkline on one row, delta on its own row */
.stat-card.stat-card--spark { display: flex; flex-direction: column; gap: 14px; }
.stat-card--spark .stat-head { display: flex; align-items: center; gap: 14px; }
.stat-card--spark .stat-head .stat-top { flex: 1; min-width: 0; }
.stat-card--spark .stat-head .spark { width: 86px; height: 44px; }
.stat-card--spark .stat-foot { display: flex; }

/* gradient icon backgrounds */
.grad-violet { background: linear-gradient(135deg,#1f9e98,#3bb7ae); }
.grad-pink   { background: linear-gradient(135deg,#ec4899,#f43f5e); }
.grad-green  { background: linear-gradient(135deg,#10b981,#059669); }
.grad-blue   { background: linear-gradient(135deg,#3b82f6,#2563eb); }
.grad-orange { background: linear-gradient(135deg,#f59e0b,#f97316); }
.grad-sky    { background: linear-gradient(135deg,#0ea5e9,#3b82f6); }
.grad-red    { background: linear-gradient(135deg,#ef4444,#f43f5e); }
.grad-teal   { background: linear-gradient(135deg,#14b8a6,#06b6d4); }

/* legacy soft backgrounds (other pages) */
.bg-soft-primary { background:#e8f6f5;color:#1f9e98; } .bg-soft-success{background:#e9fbf3;color:#059669;}
.bg-soft-info{background:#eaf3ff;color:#2563eb;} .bg-soft-warning{background:#fff6e8;color:#d97706;}
.bg-soft-danger{background:#fdecec;color:#dc2626;} .bg-soft-purple{background:#e8f6f5;color:#16857f;}

/* mini summary strip under the chart */
.summary-strip { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid rgba(28,40,48,.06); }
[data-bs-theme="dark"] .summary-strip { border-top-color: rgba(255,255,255,.06); }
.summary-item { flex: 1 1 0; display: flex; align-items: center; gap: 12px; padding: 16px 18px; min-width: 150px; }
.summary-item .si-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 1.1rem; }
.summary-item .si-val { font-weight: 800; font-size: 1.15rem; line-height: 1; }
.summary-item .si-lbl { color: #7d8894; font-size: .78rem; }

/* engagement legend rows */
.legend-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: .88rem; }
.legend-row .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.legend-row .lg-val { margin-left: auto; font-weight: 700; }
.legend-row .lg-sub { color: #8a94a0; font-weight: 500; margin-left: 4px; }

/* ---- Buttons / brand --------------------------------------------- */
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }
.text-brand { color: var(--brand) !important; }
.btn-gradient { background: var(--brand-grad); border: 0; color: #fff; }
.btn-gradient:hover { color: #fff; filter: brightness(1.05); }

/* ---- Tables ------------------------------------------------------ */
.table > :not(caption) > * > * { padding: .8rem 1rem; }
.table thead th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: #8a94a0; font-weight: 700; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-size: 1.45rem; font-weight: 800; margin: 0; letter-spacing: -.02em; }

/* The page title is shown in the top bar — hide the duplicate in-page heading,
   keeping any action buttons (right-aligned). Title-only headers collapse. */
.page-head { justify-content: flex-end; }
.page-head > h2 { display: none; }
.page-head > div:first-child:has(> h2) { display: none; }
/* Collapse the bar only when nothing but the (now-hidden) title remains. */
.page-head:not(:has(> :not(h2):not(div:has(> h2)))) { display: none; margin: 0; }

/* ---- Recipient source toggle (campaign editor) ------------------ */
.src-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.src-opt {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px 16px; border: 1.5px solid var(--bs-border-color);
  border-radius: 12px; background: var(--bs-body-bg); color: var(--bs-body-color);
  cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s;
}
.src-opt:hover { border-color: var(--brand); }
.src-opt.active { border-color: var(--brand); background: rgba(31,158,152,.06); box-shadow: 0 6px 18px -10px var(--ring); }
.src-opt > i { font-size: 1.5rem; color: #8a94a0; }
.src-opt.active > i { color: var(--brand); }
.src-opt span { display: flex; flex-direction: column; line-height: 1.25; }
.src-opt-title { font-weight: 700; font-size: .9rem; }
.src-opt-sub { font-size: .76rem; color: #7d8894; }
@media (max-width: 575.98px) { .src-toggle { grid-template-columns: 1fr; } }

/* ---- Auth (split-screen) ---------------------------------------- */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
@media (max-width: 880px) { .auth-split { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* Left brand panel */
.auth-aside { position: relative; overflow: hidden; color: #fff; padding: 56px 52px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, #1f9e98 0%, #3bb7ae 55%, #5cc1bb 100%); }
.auth-aside::before, .auth-aside::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.auth-aside::before { width: 460px; height: 460px; top: -140px; right: -150px; background: rgba(255,255,255,.10); }
.auth-aside::after  { width: 300px; height: 300px; bottom: -110px; left: -90px;  background: rgba(255,255,255,.07); }
.aa-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; position: relative; z-index: 1; }
.aa-headline { position: relative; z-index: 1; }
.aa-headline h2 { font-weight: 800; font-size: 2rem; line-height: 1.22; margin: 0 0 12px; }
.aa-headline p { opacity: .88; font-size: 1.02rem; max-width: 34ch; margin: 0; }
.auth-feats { list-style: none; margin: 26px 0 0; padding: 0; }
.auth-feats li { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-size: .98rem; }
.auth-feats i { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255,255,255,.16); flex: 0 0 auto; font-size: 1.05rem; }
.auth-foot-note { position: relative; z-index: 1; opacity: .72; font-size: .85rem; }

/* Right form panel */
.auth-main { display: flex; align-items: center; justify-content: center; padding: 44px 24px; background: var(--bs-body-bg); }
.auth-card { width: 100%; max-width: 412px; }
.auth-card h1 { font-size: 1.62rem; font-weight: 800; margin: 0 0 4px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.4rem; color: var(--bs-body-color); }
.auth-brand i { color: var(--brand); }
.auth-mobile-brand { display: none; }
@media (max-width: 880px) { .auth-mobile-brand { display: flex; } }
.auth-legal { text-align: center; margin-top: 26px; font-size: .82rem; }
.auth-legal a { color: var(--bs-secondary-color); margin: 0 8px; text-decoration: none; }
.auth-legal a:hover { color: var(--brand); }

/* ---- Misc -------------------------------------------------------- */
.badge-soft { padding: .38em .65em; border-radius: 7px; font-weight: 600; font-size: .74rem; }
.builder-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.followup-step, .wf-step { border: 1px dashed rgba(28,40,48,.18); border-radius: 12px; padding: 16px; margin-bottom: 12px; position: relative; }
.empty-state { text-align: center; padding: 48px 20px; color: #8a94a0; }
.empty-state > i { font-size: 2.6rem; opacity: .4; display: block; margin-bottom: 4px; }
.code-pill { background: #eef2f3; padding: 2px 8px; border-radius: 6px; font-family: monospace; font-size: .8rem; cursor: pointer; color: #16857f; }
[data-bs-theme="dark"] .code-pill { background:#222b30; color:#9fe0da; }

/* ---- Pills (tags / status) --------------------------------------- */
.tag-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; line-height: 1.4; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: .76rem; font-weight: 600; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-subscribed   { background: #e9fbf3; color: #059669; }
.status-unsubscribed { background: #fdecec; color: #dc2626; }
.status-bounced      { background: #fff6e8; color: #d97706; }
.status-active       { background: #e9fbf3; color: #059669; }
[data-bs-theme="dark"] .status-subscribed,[data-bs-theme="dark"] .status-active { background: rgba(5,150,105,.16); }
[data-bs-theme="dark"] .status-unsubscribed { background: rgba(220,38,38,.16); }
[data-bs-theme="dark"] .status-bounced { background: rgba(217,119,6,.16); }

/* ---- Filter bar -------------------------------------------------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-bar .form-control, .filter-bar .form-select { border-radius: 11px; }
.search-field { position: relative; flex: 1; min-width: 220px; }
.search-field .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #8a94a0; }
.search-field input { padding-left: 40px; }

.row-check { width: 18px; height: 18px; border-radius: 5px; }
.row-actions { color: #8a94a0; border: 0; background: transparent; padding: 4px 8px; border-radius: 8px; }
.row-actions:hover { background: var(--bs-tertiary-bg); color: var(--brand); }

/* ---- Segmented tabs ---------------------------------------------- */
.seg-tabs { display: inline-flex; gap: 4px; background: #eef2f3; padding: 4px; border-radius: 12px; }
[data-bs-theme="dark"] .seg-tabs { background: #1b2327; }
.seg-tabs a, .seg-tabs button {
  border: 0; background: transparent; color: #556270; font-weight: 600; font-size: .86rem;
  padding: 7px 16px; border-radius: 9px; cursor: pointer;
}
.seg-tabs a.active, .seg-tabs button.active { background: var(--bs-body-bg); color: var(--brand); box-shadow: 0 2px 6px rgba(28,40,48,.08); }

/* ---- Template gallery -------------------------------------------- */
.tmpl-card { border: 1px solid rgba(28,40,48,.07); border-radius: 14px; overflow: hidden; background: var(--bs-body-bg); transition: transform .15s, box-shadow .15s; height: 100%; }
.tmpl-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -20px rgba(28,40,48,.35); }
.tmpl-thumb { height: 170px; display: grid; place-items: center; color: #fff; position: relative; overflow: hidden; }
.tmpl-thumb .tmpl-mini { position: absolute; inset: 14px; background: rgba(255,255,255,.92); border-radius: 8px; padding: 12px; color: #1c2434; font-size: .6rem; overflow: hidden; box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.tmpl-card .tmpl-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.tmpl-card:hover .tmpl-actions { opacity: 1; }
.tmpl-card .tmpl-actions a, .tmpl-card .tmpl-actions button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: rgba(255,255,255,.95); color: #1c2434; display: grid; place-items: center; }

/* ---- Wizard ------------------------------------------------------ */
.wizard { display: grid; grid-template-columns: 260px 1fr; gap: 22px; align-items: start; }
.wizard-steps { display: flex; flex-direction: column; gap: 4px; }
.wstep { display: flex; gap: 14px; padding: 14px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; }
.wstep .wnum { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-weight: 700; background: #eef2f3; color: #7d8894; border: 2px solid transparent; }
[data-bs-theme="dark"] .wstep .wnum { background:#1b2327; }
.wstep .wtitle { font-weight: 700; font-size: .92rem; }
.wstep .wsub { color: #8a94a0; font-size: .78rem; }
.wstep.active { background: var(--bs-body-bg); border-color: rgba(31,158,152,.25); box-shadow: 0 8px 22px -16px rgba(28,40,48,.4); }
.wstep.active .wnum { background: var(--brand-grad); color: #fff; }
.wstep.done .wnum { background: #e9fbf3; color: #059669; }

/* email editor toolbar + blocks panel */
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; border: 1px solid rgba(28,40,48,.10); border-radius: 11px; padding: 6px 8px; margin-bottom: 12px; background: var(--bs-body-bg); }
.editor-toolbar .tb { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 7px; color: #556270; }
.editor-toolbar .tb:hover { background: var(--bs-tertiary-bg); color: var(--brand); }
.editor-toolbar .sep { width: 1px; height: 20px; background: rgba(28,40,48,.12); margin: 0 4px; }
.blocks-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.block-btn { border: 1px solid rgba(28,40,48,.10); border-radius: 11px; background: var(--bs-body-bg); padding: 16px 8px; text-align: center; color: #556270; font-size: .8rem; font-weight: 600; cursor: pointer; transition: .15s; }
.block-btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.block-btn i { display: block; font-size: 1.3rem; margin-bottom: 6px; }

/* ---- Design-method chooser (text editor vs. import HTML) ---------- */
.design-method { display: flex; align-items: center; gap: 12px; border: 1.5px solid rgba(28,40,48,.10); border-radius: 12px; background: var(--bs-body-bg); padding: 14px 16px; cursor: pointer; transition: .15s; height: 100%; }
.design-method:hover { border-color: var(--brand); }
.design-method.active { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, var(--bs-body-bg)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.design-method > i { font-size: 1.6rem; color: var(--brand); }
.upload-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 2px dashed rgba(28,40,48,.18); border-radius: 12px; background: var(--bs-tertiary-bg); padding: 30px 16px; cursor: pointer; color: #556270; transition: .15s; }
.upload-drop:hover, .upload-drop.dragover { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--bs-body-bg)); }
.upload-drop > i { font-size: 2rem; color: var(--brand); }

/* ---- Toast notifications ----------------------------------------- */
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 1080; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.app-toast { display: flex; align-items: flex-start; gap: 10px; background: var(--bs-body-bg); border: 1px solid rgba(28,40,48,.10); border-left: 4px solid #64748b; border-radius: 12px; padding: 12px 14px; box-shadow: 0 12px 32px rgba(28,40,48,.16); font-size: .88rem; opacity: 0; transform: translateX(20px); transition: .22s ease; }
.app-toast.show { opacity: 1; transform: none; }
.app-toast i { font-size: 1.05rem; margin-top: 1px; }
.app-toast span { flex: 1; color: var(--bs-body-color); }
.app-toast button { border: 0; background: transparent; font-size: 1.2rem; line-height: 1; color: #8a94a0; cursor: pointer; }
.app-toast--success { border-left-color: #10b981; } .app-toast--success i { color: #10b981; }
.app-toast--danger  { border-left-color: #ef4444; } .app-toast--danger i  { color: #ef4444; }
.app-toast--warning { border-left-color: #f59e0b; } .app-toast--warning i { color: #f59e0b; }
.app-toast--info    { border-left-color: #1f9e98; } .app-toast--info i    { color: #1f9e98; }

/* ---- Confirm dialog ---------------------------------------------- */
.confirm-backdrop { position: fixed; inset: 0; z-index: 1090; background: rgba(16,22,26,.42); display: flex; align-items: center; justify-content: center; opacity: 0; transition: .18s; padding: 16px; }
.confirm-backdrop.show { opacity: 1; }
.confirm-box { background: var(--bs-body-bg); border-radius: 16px; padding: 22px; max-width: 420px; width: 100%; box-shadow: 0 24px 60px rgba(28,40,48,.28); transform: scale(.96); transition: .18s; }
.confirm-backdrop.show .confirm-box { transform: none; }
.confirm-msg { font-size: .95rem; color: var(--bs-body-color); margin-bottom: 18px; line-height: 1.55; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---- App footer -------------------------------------------------- */
.app-foot a:hover { color: var(--brand) !important; text-decoration: underline; }

/* ---- Recent campaigns list (dashboard) --------------------------- */
.rc-list { padding: 6px; }
.rc-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: inherit; transition: background .15s; }
.rc-row + .rc-row { border-top: 1px solid var(--bs-border-color); }
.rc-row:hover { background: var(--bs-tertiary-bg); }
.rc-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 1.05rem; flex: 0 0 auto; }
.rc-main { min-width: 0; flex: 1 1 auto; }
.rc-name { font-weight: 600; color: var(--bs-body-color); }
.rc-sub { font-size: .78rem; margin-top: 2px; }
.rc-metrics { display: flex; gap: 22px; flex: 0 0 auto; }
.rc-metric { text-align: center; min-width: 44px; }
.rc-val { font-weight: 700; font-size: .95rem; line-height: 1.1; }
.rc-lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; color: #8a94a0; }
.rc-chev { color: #c5cad8; font-size: .9rem; flex: 0 0 auto; }
@media (max-width: 575px) { .rc-metrics { gap: 12px; } .rc-chev { display: none; } }

.rc-empty { text-align: center; padding: 26px 16px; }
.rc-empty-ico { width: 56px; height: 56px; border-radius: 16px; display: inline-grid; place-items: center; color: #fff; font-size: 1.5rem; margin-bottom: 12px; box-shadow: 0 10px 22px -10px rgba(31,158,152,.55); }

/* ---- SMTP mini rows (dashboard) ---------------------------------- */
.smtp-row { padding: 11px 2px; }
.smtp-row + .smtp-row { border-top: 1px solid var(--bs-border-color); }
.smtp-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.smtp-dot.on { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.smtp-dot.off { background: #cbd2e0; }

/* ---- Settings page (tabbed) -------------------------------------- */
.settings-nav .nav-link { display: flex; align-items: center; gap: 10px; text-align: left; color: var(--bs-body-color); font-weight: 500; border-radius: 10px; padding: 10px 14px; margin-bottom: 2px; border: 0; background: transparent; }
.settings-nav .nav-link i { font-size: 1.05rem; color: #8a94a0; width: 18px; }
.settings-nav .nav-link:hover { background: var(--bs-tertiary-bg); }
.settings-nav .nav-link.active { background: color-mix(in srgb, var(--brand) 12%, var(--bs-body-bg)); color: var(--brand); }
.settings-nav .nav-link.active i { color: var(--brand); }

.theme-card { width: 100%; border: 2px solid var(--bs-border-color); background: var(--bs-body-bg); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; font-weight: 600; color: var(--bs-body-color); transition: .15s; cursor: pointer; }
.theme-card:hover { border-color: var(--brand); }
.theme-card.active { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.theme-card > span:last-child { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .9rem; }
.theme-preview { height: 64px; border-radius: 9px; border: 1px solid var(--bs-border-color); position: relative; overflow: hidden; }
.theme-preview::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 32%; }
.theme-preview::after { content: ''; position: absolute; right: 8px; top: 10px; left: 38%; height: 10px; border-radius: 4px; }
.theme-preview--light { background: #f5f7f8; } .theme-preview--light::before { background: #fff; border-right: 1px solid #e7ecee; } .theme-preview--light::after { background: #d8dfe2; }
.theme-preview--dark { background: #151b1f; } .theme-preview--dark::before { background: #1b2327; border-right: 1px solid #2a353b; } .theme-preview--dark::after { background: #34414a; }

.plan-banner { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 16px; border: 1px solid rgba(31,158,152,.28); background: linear-gradient(160deg, rgba(31,158,152,.10), rgba(59,183,174,.04)); }
.plan-tile { display: flex; align-items: center; gap: 12px; border: 1px solid var(--bs-border-color); border-radius: 12px; padding: 13px 15px; height: 100%; background: var(--bs-body-bg); transition: .15s; }
.plan-tile:hover { border-color: rgba(31,158,152,.35); box-shadow: 0 6px 18px -12px rgba(31,158,152,.5); }

/* ---- Quick-verify chat ------------------------------------------- */
.qv-chat { min-height: 230px; max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.qv-row { display: flex; }
.qv-row.qv-me { justify-content: flex-end; }
.qv-row.qv-bot { justify-content: flex-start; }
.qv-bubble { max-width: 80%; padding: 9px 13px; border-radius: 14px; font-size: .88rem; line-height: 1.4; box-shadow: 0 1px 3px rgba(28,40,48,.06); }
.qv-me .qv-bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.qv-bot .qv-bubble { background: var(--bs-tertiary-bg); color: var(--bs-body-color); border-bottom-left-radius: 4px; }
.qv-typing { display: inline-flex; gap: 3px; }
.qv-typing span { width: 6px; height: 6px; border-radius: 50%; background: #9aa0b5; animation: qvb 1s infinite; }
.qv-typing span:nth-child(2) { animation-delay: .15s; }
.qv-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes qvb { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---- Usage bars / mini doughnut / top links ---------------------- */
.usage-row { display: grid; grid-template-columns: 160px 1fr 130px; align-items: center; gap: 14px; padding: 10px 0; }
.usage-row .bar { height: 8px; border-radius: 999px; background: #eef2f3; overflow: hidden; }
[data-bs-theme="dark"] .usage-row .bar { background:#1b2327; }
.usage-row .bar > span { display: block; height: 100%; border-radius: 999px; background: var(--brand-grad); }
.donut-stat { position: relative; width: 130px; height: 130px; margin: 0 auto; }
.donut-stat .donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut-stat .donut-center .dv { font-size: 1.4rem; font-weight: 800; }
.donut-stat .donut-center .dl { font-size: .7rem; color: #8a94a0; }
.toplink-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(28,40,48,.06); font-size: .86rem; }
.toplink-row:last-child { border-bottom: 0; }
.toplink-row .tl-url { flex: 1; color: var(--brand); font-weight: 500; word-break: break-all; }
.toplink-row .tl-count { font-weight: 700; }
.toplink-row .tl-pct { color: #8a94a0; font-size: .78rem; }

/* ---- Topbar polish ------------------------------------------------ */
.topbar { background: color-mix(in srgb, var(--bs-body-bg) 82%, transparent); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); }
[data-bs-theme="dark"] body { background: #101518; }

/* ---- Responsive -------------------------------------------------- */
@media (max-width: 991.98px) { .wizard { grid-template-columns: 1fr; } .usage-row { grid-template-columns: 120px 1fr 90px; } }
@media (max-width: 1199.98px) { .topbar-search { display: none; } }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar { padding: 14px 18px; }
  .content { padding: 18px; }
  .topbar-heading h1 { font-size: 1.2rem; }
}

/* =====================================================================
   Theme v5 — clean teal (overrides the layers above)
   ===================================================================== */
:root {
  --brand: #1f9e98; --brand-600: #16857f; --brand-700: #10625e; --brand-50: #e9f6f5;
  --brand-grad: linear-gradient(135deg, #22a39c 0%, #1b8f89 100%);
  --ring: rgba(31,158,152,.28);
  --radius: 12px;
  --line: #e8ecee;
  --ink: #1c2434; --ink-2: #4b5764; --ink-3: #8a94a0;
  --surface: #ffffff; --canvas: #f6f8f9;
  --sidebar-w: 248px;
  --bs-primary: #1f9e98; --bs-primary-rgb: 31,158,152;
  --bs-link-color: #1f9e98; --bs-link-color-rgb: 31,158,152; --bs-link-hover-color: #16857f; --bs-link-hover-color-rgb: 22,133,127;
  --bs-border-color: #e8ecee;
  --bs-body-font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
[data-bs-theme="dark"] {
  --line: rgba(255,255,255,.07);
  --ink: #e8edef; --ink-2: #b4bec4; --ink-3: #87939a;
  --surface: #161d21; --canvas: #101518;
  --bs-body-bg: #161d21; --bs-body-bg-rgb: 22,29,33;
  --bs-tertiary-bg: #1c2428; --bs-tertiary-bg-rgb: 28,36,40;
  --bs-secondary-bg: #222b30;
  --bs-border-color: rgba(255,255,255,.07); --bs-border-color-translucent: rgba(255,255,255,.07);
  --bs-primary: #2bb3ab; --bs-primary-rgb: 43,179,171; --bs-link-color: #4cc7bf; --bs-link-color-rgb: 76,199,191;
}
body { background: var(--canvas); color: var(--ink); font-family: var(--bs-body-font-family); font-size: .92rem; letter-spacing: -.005em; }
[data-bs-theme="dark"] body { background: var(--canvas); color: var(--ink); }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { letter-spacing: -.02em; font-weight: 600; }
.fw-bold { font-weight: 600 !important; }
.text-muted, .text-body-secondary { color: var(--ink-3) !important; }
.text-brand { color: var(--brand) !important; }
::selection { background: rgba(31,158,152,.2); }

/* ---- Sidebar (light) ---------------------------------------------- */
.sidebar { background: var(--surface); color: var(--ink-2); border-right: 1px solid var(--line); padding: 20px 14px 14px; }
.sidebar-brand { color: var(--ink); font-weight: 800; font-size: 1.12rem; padding: 2px 10px 20px; letter-spacing: -.01em; text-transform: uppercase; }
.sidebar-brand .brand-logo { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); box-shadow: none; font-size: .95rem; }
.sidebar-nav { gap: 1px; -webkit-mask-image: none; mask-image: none; }
.sidebar-nav:hover { scrollbar-color: rgba(0,0,0,.12) transparent; }
.sidebar-nav:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); }
.sidebar-section { text-transform: none; letter-spacing: 0; font-size: .78rem; font-weight: 500; color: var(--ink-3); padding: 16px 12px 6px; }
.sidebar-section:first-child { padding-top: 0; }
.sidebar-nav .nav-link { color: var(--ink-2); padding: 9px 12px; border-radius: 8px; font-size: .86rem; font-weight: 500; gap: 12px; }
.sidebar-nav .nav-link i { font-size: 1.02rem; opacity: 1; color: var(--ink-3); }
.sidebar-nav .nav-link:hover { background: var(--canvas); color: var(--ink); }
.sidebar-nav .nav-link:hover i { color: var(--ink-2); }
.sidebar-nav .nav-link.active { background: var(--brand-50); color: var(--brand); box-shadow: none; font-weight: 600; }
.sidebar-nav .nav-link.active i { color: var(--brand); }
.sidebar-nav .nav-link.active::before { display: none; }
.sidebar-create { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 4px 2px; padding: 8px 10px; border-radius: 8px;
  border: 1px dashed #cfd8db; color: var(--brand); font-size: .8rem; font-weight: 500; transition: background .15s, border-color .15s; }
.sidebar-create:hover { background: var(--brand-50); border-color: var(--brand); color: var(--brand); }

.sidebar-plan { display: block; margin: 10px 0 0; padding: 14px; border-radius: 10px; background: #1e2629; color: #c9d1d5; border: 0; transform: none !important; }
.sidebar-plan .sp-title { color: #fff; font-weight: 600; font-size: .84rem; margin-bottom: 4px; }
.sidebar-plan .sp-text { font-size: .74rem; line-height: 1.45; margin: 0 0 10px; color: #aab5ba; }
.sidebar-plan .sp-text b { color: #5fd3cb; font-weight: 600; }
.sidebar-plan .sp-bar { height: 6px; background: rgba(255,255,255,.12); margin: 0 0 12px; }
.sidebar-plan .sp-bar > span { background: #2bb3ab; }
.sidebar-plan .sp-foot { display: flex; justify-content: space-between; align-items: center; font-size: .74rem; }
.sidebar-plan .sp-foot a { color: #fff; font-weight: 600; }
.sidebar-plan .sp-foot a:hover { color: #5fd3cb; }
.sidebar-plan .sp-foot span { color: #8d999e; }
.sidebar-foot { color: var(--ink-2); border-top: 1px solid var(--line); }
.sidebar-foot .form-check-input { background-color: #e3e8ea; border-color: #d5dcdf; }

[data-bs-theme="dark"] .sidebar { background: #12181b; }
[data-bs-theme="dark"] .sidebar-nav .nav-link:hover { background: rgba(255,255,255,.04); }
[data-bs-theme="dark"] .sidebar-nav .nav-link.active { background: rgba(43,179,171,.14); color: #5fd3cb; }
[data-bs-theme="dark"] .sidebar-nav .nav-link.active i { color: #5fd3cb; }
[data-bs-theme="dark"] .sidebar-create { border-color: rgba(255,255,255,.14); color: #5fd3cb; }
[data-bs-theme="dark"] .sidebar-plan { background: #1c2428; border: 1px solid var(--line); }
[data-bs-theme="dark"] .sidebar-foot .form-check-input { background-color: rgba(255,255,255,.12); border-color: rgba(255,255,255,.14); }

/* ---- Topbar ------------------------------------------------------- */
.topbar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 1px solid var(--line); padding: 14px 28px; gap: 14px; }
[data-bs-theme="dark"] .topbar { background: var(--surface); border-bottom-color: var(--line); }
.topbar-heading h1 { font-size: 1.3rem; font-weight: 600; letter-spacing: -.02em; }
.topbar-sub { margin: 1px 0 0; font-size: .78rem; color: var(--ink-3); }
.topbar-search { flex: 0 1 300px; max-width: 300px; margin: 0 0 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.topbar-search .search-ico { left: auto; right: 12px; }
.topbar-search-ph { font-size: .84rem; color: var(--ink-3); }
.topbar-search .kbd { display: none; }
.topbar-search:hover { border-color: #cfd8db; }
[data-bs-theme="dark"] .topbar-search { background: var(--surface); border-color: var(--line); }
.topbar-actions { margin-left: 0; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: .98rem; }
.icon-btn:hover { background: var(--canvas); color: var(--brand); }
[data-bs-theme="dark"] .icon-btn { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.icon-btn .badge-dot { min-width: 16px; height: 16px; font-size: .6rem; top: -5px; right: -5px; background: #e5484d; }
.btn-user .avatar { width: 38px; height: 38px; border-radius: 50%; background: #d9efed; color: var(--brand-700); font-weight: 600; }
[data-bs-theme="dark"] .btn-user .avatar { background: rgba(43,179,171,.18); color: #5fd3cb; }
.btn-user .u-meta { display: none !important; }
.content { padding: 24px 28px 40px; }

/* ---- Cards, tables, forms, buttons ------------------------------- */
.card, .stat-card, .kpi { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; background: var(--surface); }
[data-bs-theme="dark"] .card, [data-bs-theme="dark"] .stat-card { border-color: var(--line); }
.card-header { border-bottom: 1px solid var(--line); font-weight: 600; padding: 14px 18px; }
[data-bs-theme="dark"] .card-header { border-bottom-color: var(--line); }
.card-footer { background: transparent; border-top: 1px solid var(--line); }
.stat-card .stat-value, .kpi-value { font-weight: 700; }
.stat-icon, .kpi-ico, .ks-ico { border-radius: 10px; }

.btn { border-radius: 8px; font-weight: 500; --bs-btn-font-size: .86rem; --bs-btn-padding-y: .46rem; --bs-btn-padding-x: .9rem; }
.btn-sm { --bs-btn-font-size: .78rem; --bs-btn-padding-y: .28rem; --bs-btn-padding-x: .6rem; }
.btn-lg { --bs-btn-font-size: 1rem; --bs-btn-padding-y: .6rem; --bs-btn-padding-x: 1.2rem; }
.btn-light { background: var(--surface); color: var(--ink-2); }
.btn-light:hover { background: var(--canvas); border-color: #d5dde0; color: var(--ink); }
.stat-card .stat-icon { box-shadow: none; width: 46px; height: 46px; font-size: 1.15rem; }
.btn-primary, .btn-gradient { background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important; box-shadow: none !important; }
.btn-primary:hover, .btn-gradient:hover, .btn-primary:focus, .btn-gradient:focus { background: var(--brand-600) !important; border-color: var(--brand-600) !important; color: #fff !important; }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-light, .btn-outline-secondary { border-color: var(--line); }
.form-control, .form-select { border-radius: 8px; border-color: var(--line); font-size: .88rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--ring); border-color: var(--brand); }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background: var(--brand); }
.nav-tabs .nav-link.active { color: var(--brand); }
.page-link { color: var(--brand); }
.active > .page-link, .page-link.active { background: var(--brand); border-color: var(--brand); }
.progress-bar { background-color: var(--brand); }
.bg-primary { background-color: var(--brand) !important; }
.text-primary { color: var(--brand) !important; }
.border-primary { border-color: var(--brand) !important; }
.bg-primary-subtle { background-color: var(--brand-50) !important; }
.text-primary-emphasis { color: var(--brand-700) !important; }
[data-bs-theme="dark"] .bg-primary-subtle { background-color: rgba(43,179,171,.14) !important; }
[data-bs-theme="dark"] .text-primary-emphasis { color: #5fd3cb !important; }
.badge { font-weight: 500; border-radius: 6px; }

.table { --bs-table-bg: transparent; font-size: .86rem; }
.table > thead th { font-size: .74rem; font-weight: 500; color: var(--ink-3); text-transform: none; letter-spacing: 0; background: var(--canvas); border-bottom: 1px solid var(--line); }
[data-bs-theme="dark"] .table > thead th { background: rgba(255,255,255,.02); }
.table > :not(caption) > * > * { border-bottom-color: var(--line); }
.dropdown-menu { border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px -12px rgba(28,40,48,.22); font-size: .88rem; }
.dropdown-item.active, .dropdown-item:active { background: var(--brand); }
.modal-content { border: 1px solid var(--line); border-radius: 14px; }
.alert { border-radius: 10px; }

/* grad icon chips: soft tints instead of loud gradients */
.grad-violet { background: #e9f6f5 !important; color: #1f9e98 !important; }
.grad-pink   { background: #fdeef3 !important; color: #d6457a !important; }
.grad-green  { background: #e8f6ee !important; color: #1f9d5c !important; }
.grad-blue   { background: #eaf2fe !important; color: #2f6fe0 !important; }
.grad-orange { background: #fef3e6 !important; color: #d9822b !important; }
.grad-sky    { background: #e7f6fb !important; color: #1b8db8 !important; }
.grad-red    { background: #fdecec !important; color: #d23c41 !important; }
.grad-teal   { background: #e9f6f5 !important; color: #1f9e98 !important; }
[data-bs-theme="dark"] .grad-violet, [data-bs-theme="dark"] .grad-teal { background: rgba(43,179,171,.15) !important; color: #5fd3cb !important; }
[data-bs-theme="dark"] .grad-pink   { background: rgba(214,69,122,.15) !important; color: #f07aa5 !important; }
[data-bs-theme="dark"] .grad-green  { background: rgba(31,157,92,.15) !important; color: #4fd08e !important; }
[data-bs-theme="dark"] .grad-blue   { background: rgba(47,111,224,.15) !important; color: #7aa7f5 !important; }
[data-bs-theme="dark"] .grad-orange { background: rgba(217,130,43,.15) !important; color: #f0a860 !important; }
[data-bs-theme="dark"] .grad-sky    { background: rgba(27,141,184,.15) !important; color: #5cc0e6 !important; }
[data-bs-theme="dark"] .grad-red    { background: rgba(210,60,65,.15) !important; color: #f07a7e !important; }

.page-head h1, .page-head h2, .page-head h3 { font-weight: 600; }

@media (max-width: 991.98px) {
  .topbar { padding: 12px 16px; }
  .topbar-search { display: none; }
  .content { padding: 18px 16px 32px; }
}

/* ---- Dashboard (v5) ------------------------------------------------ */
.min-w-0 { min-width: 0; }
.db-hero { position: relative; overflow: hidden; display: flex; align-items: center; min-height: 190px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.db-hero-text { position: relative; z-index: 1; padding: 28px 30px; max-width: 560px; }
.db-hero h2 { font-size: 1.55rem; font-weight: 600; margin: 0 0 8px; }
.db-hero p { color: var(--ink-2); font-size: 1.02rem; line-height: 1.55; margin: 0 0 20px; }
.db-wave { display: inline-block; transform-origin: 70% 70%; animation: dbWave 2.2s ease-in-out 1; }
@keyframes dbWave { 0%,60%,100% { transform: rotate(0); } 10%,30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.db-swoosh { position: relative; white-space: nowrap; color: var(--ink); font-weight: 500; }
.db-swoosh svg { position: absolute; left: -2px; right: -6px; bottom: -8px; width: calc(100% + 8px); height: 10px; overflow: visible; }
.db-swoosh path { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; }
.db-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.db-cta { padding: 10px 18px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.db-btn-soft { background: var(--brand-50); color: var(--brand-700); border: 0; padding: 10px 16px; }
.db-btn-soft:hover { background: #d7efed; color: var(--brand-700); }
[data-bs-theme="dark"] .db-btn-soft { background: rgba(43,179,171,.14); color: #5fd3cb; }
.db-hero-art { position: absolute; inset: 0 0 0 38%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='103.92' viewBox='0 0 60 103.92'%3E%3Cg stroke='%23e6ebed' stroke-width='1'%3E%3Cpath d='M30 0 L60 17.32 L30 34.64 L0 17.32Z' fill='%23ffffff'/%3E%3Cpath d='M0 17.32 L30 34.64 L30 69.28 L0 51.96Z' fill='%23eef2f3'/%3E%3Cpath d='M30 34.64 L60 17.32 L60 51.96 L30 69.28Z' fill='%23e2e8ea'/%3E%3Cpath d='M60 51.96 L90 69.28 L60 86.6 L30 69.28Z' fill='%23ffffff'/%3E%3Cpath d='M30 69.28 L60 86.6 L60 121.24000000000001 L30 103.92Z' fill='%23eef2f3'/%3E%3Cpath d='M60 86.6 L90 69.28 L90 103.92 L60 121.24000000000001Z' fill='%23e2e8ea'/%3E%3Cpath d='M0 51.96 L30 69.28 L0 86.6 L-30 69.28Z' fill='%23ffffff'/%3E%3Cpath d='M-30 69.28 L0 86.6 L0 121.24000000000001 L-30 103.92Z' fill='%23eef2f3'/%3E%3Cpath d='M0 86.6 L30 69.28 L30 103.92 L0 121.24000000000001Z' fill='%23e2e8ea'/%3E%3Cpath d='M0 -51.96 L30 -34.64 L0 -17.32 L-30 -34.64Z' fill='%23ffffff'/%3E%3Cpath d='M-30 -34.64 L0 -17.32 L0 17.32 L-30 0.0Z' fill='%23eef2f3'/%3E%3Cpath d='M0 -17.32 L30 -34.64 L30 0.0 L0 17.32Z' fill='%23e2e8ea'/%3E%3Cpath d='M60 -51.96 L90 -34.64 L60 -17.32 L30 -34.64Z' fill='%23ffffff'/%3E%3Cpath d='M30 -34.64 L60 -17.32 L60 17.32 L30 0.0Z' fill='%23eef2f3'/%3E%3Cpath d='M60 -17.32 L90 -34.64 L90 0.0 L60 17.32Z' fill='%23e2e8ea'/%3E%3Cpath d='M30 103.92 L60 121.24000000000001 L30 138.56 L0 121.24000000000001Z' fill='%23ffffff'/%3E%3Cpath d='M0 121.24000000000001 L30 138.56 L30 173.2 L0 155.88Z' fill='%23eef2f3'/%3E%3Cpath d='M30 138.56 L60 121.24000000000001 L60 155.88 L30 173.2Z' fill='%23e2e8ea'/%3E%3C/g%3E%3C/svg%3E"); background-size: 60px 103.92px; background-position: right top;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 45%); mask-image: linear-gradient(90deg, transparent 0%, #000 45%); opacity: .95; }
[data-bs-theme="dark"] .db-hero-art { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='103.92' viewBox='0 0 60 103.92'%3E%3Cg stroke='%23262f34' stroke-width='1'%3E%3Cpath d='M30 0 L60 17.32 L30 34.64 L0 17.32Z' fill='%2320292e'/%3E%3Cpath d='M0 17.32 L30 34.64 L30 69.28 L0 51.96Z' fill='%231a2226'/%3E%3Cpath d='M30 34.64 L60 17.32 L60 51.96 L30 69.28Z' fill='%23151c1f'/%3E%3Cpath d='M60 51.96 L90 69.28 L60 86.6 L30 69.28Z' fill='%2320292e'/%3E%3Cpath d='M30 69.28 L60 86.6 L60 121.24000000000001 L30 103.92Z' fill='%231a2226'/%3E%3Cpath d='M60 86.6 L90 69.28 L90 103.92 L60 121.24000000000001Z' fill='%23151c1f'/%3E%3Cpath d='M0 51.96 L30 69.28 L0 86.6 L-30 69.28Z' fill='%2320292e'/%3E%3Cpath d='M-30 69.28 L0 86.6 L0 121.24000000000001 L-30 103.92Z' fill='%231a2226'/%3E%3Cpath d='M0 86.6 L30 69.28 L30 103.92 L0 121.24000000000001Z' fill='%23151c1f'/%3E%3Cpath d='M0 -51.96 L30 -34.64 L0 -17.32 L-30 -34.64Z' fill='%2320292e'/%3E%3Cpath d='M-30 -34.64 L0 -17.32 L0 17.32 L-30 0.0Z' fill='%231a2226'/%3E%3Cpath d='M0 -17.32 L30 -34.64 L30 0.0 L0 17.32Z' fill='%23151c1f'/%3E%3Cpath d='M60 -51.96 L90 -34.64 L60 -17.32 L30 -34.64Z' fill='%2320292e'/%3E%3Cpath d='M30 -34.64 L60 -17.32 L60 17.32 L30 0.0Z' fill='%231a2226'/%3E%3Cpath d='M60 -17.32 L90 -34.64 L90 0.0 L60 17.32Z' fill='%23151c1f'/%3E%3Cpath d='M30 103.92 L60 121.24000000000001 L30 138.56 L0 121.24000000000001Z' fill='%2320292e'/%3E%3Cpath d='M0 121.24000000000001 L30 138.56 L30 173.2 L0 155.88Z' fill='%231a2226'/%3E%3Cpath d='M30 138.56 L60 121.24000000000001 L60 155.88 L30 173.2Z' fill='%23151c1f'/%3E%3C/g%3E%3C/svg%3E"); }

.db-setup { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; margin-bottom: 16px; }
.db-setup-head { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; }
.db-setup-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.db-step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); font-size: .8rem; font-weight: 500; max-width: 100%; }
.db-step:hover { border-color: var(--brand); color: var(--ink); }
.db-step-n { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 6px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-size: .72rem; font-weight: 600; }
.db-step.done { color: var(--ink-3); }
.db-step.done .db-step-n { background: var(--brand); color: #fff; }
[data-bs-theme="dark"] .db-step-n { background: rgba(43,179,171,.14); }

.db-stat { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.db-stat-title { font-weight: 500; font-size: .92rem; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.db-stat-title i, .db-card-title i { color: var(--ink-3); font-size: .8rem; cursor: help; }
.db-stat-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex: 1; }
.db-stat-value { font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; display: flex; align-items: baseline; gap: 8px; }
.db-delta { font-size: .76rem; font-weight: 500; }
.db-delta.up { color: #1f9d5c; } .db-delta.down { color: #d23c41; }
.db-stat-sub { font-size: .76rem; color: var(--ink-3); margin-top: 4px; }
.db-bars { display: flex; align-items: flex-end; gap: 3px; height: 54px; width: 92px; flex: 0 0 92px; }
.db-bars span { position: relative; flex: 1; background: #e3e9eb; border-radius: 2px; min-height: 4px; }
.db-bars span.on { background: var(--brand); }
.db-bars em { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-style: normal; font-size: .58rem; font-weight: 600;
  background: #1e2629; color: #fff; padding: 1px 4px; border-radius: 3px; white-space: nowrap; }
[data-bs-theme="dark"] .db-bars span { background: #2a3439; }
[data-bs-theme="dark"] .db-bars span.on { background: #2bb3ab; }
[data-bs-theme="dark"] .db-bars em { background: #e8edef; color: #161d21; }

.db-card { display: flex; flex-direction: column; }
.db-card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 18px 12px; }
.db-card-title { font-weight: 600; font-size: .98rem; display: flex; align-items: center; gap: 6px; }
.db-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; font-size: .76rem; color: var(--ink-2); }
.db-legend span { display: inline-flex; align-items: center; gap: 6px; }
.db-legend i { width: 7px; height: 7px; border-radius: 50%; }
.db-select { width: auto; font-size: .76rem; padding-top: 4px; padding-bottom: 4px; }
.db-chart { position: relative; flex: 1; min-height: 250px; padding: 4px 14px 14px; }
.db-link { font-size: .8rem; font-weight: 500; color: var(--brand); }

.db-search { position: relative; }
.db-search input { width: 190px; padding-right: 30px; }
.db-search i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: .78rem; pointer-events: none; }
.db-table { font-size: .82rem; }
.db-table > thead th { font-size: .74rem; padding: 10px 12px; white-space: nowrap; border-top: 1px solid var(--line); }
.db-table > tbody td { padding: 11px 12px; vertical-align: middle; color: var(--ink-2); }
.db-table > thead th:first-child, .db-table > tbody td:first-child { padding-left: 18px; }
.db-table > thead th:last-child, .db-table > tbody td:last-child { padding-right: 18px; }
.db-table tbody tr { cursor: pointer; }
.db-table tbody tr:hover td { background: var(--canvas); }
.db-camp { display: flex; align-items: center; gap: 10px; max-width: 300px; }
.db-camp .badge { flex: 0 0 auto; }
.db-camp a { color: var(--ink); font-weight: 500; min-width: 0; }
.db-camp-ico { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-size: .8rem; }
[data-bs-theme="dark"] .db-camp-ico { background: rgba(43,179,171,.14); }
.db-table-foot { padding: 10px 18px; border-top: 1px solid var(--line); font-size: .8rem; margin-top: auto; }
.db-table-foot a { color: var(--brand); font-weight: 500; }

.db-health { padding: 0 18px; }
.db-safe { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.db-safe-lbl { display: block; font-size: .78rem; color: var(--ink-3); }
.db-safe-lbl i { color: var(--brand); }
.db-safe-val { display: block; font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.db-safe-side { text-align: right; font-size: .8rem; color: var(--ink-3); }
.db-safe-side b { color: var(--ink); font-weight: 600; }
.db-safe-side span { display: block; font-size: .72rem; }
.db-safe-bar { height: 6px; border-radius: 9px; background: #e8eef0; margin: 10px 0 12px; overflow: hidden; }
.db-safe-bar span { display: block; height: 100%; background: var(--brand); border-radius: 9px; }
[data-bs-theme="dark"] .db-safe-bar { background: #2a3439; }
.db-accounts { display: grid; }
.db-acc { display: flex; align-items: center; gap: 9px; font-size: .82rem; padding: 7px 0; color: var(--ink); }
.db-acc + .db-acc { border-top: 1px solid var(--line); }
.db-acc-use { color: var(--ink-3); font-size: .78rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.db-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #1f9d5c; }
.db-dot.paused { background: #d23c41; } .db-dot.off { background: #aab4b9; }
.db-gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 18px 18px; margin-top: auto; }
.db-gauge-box { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 14px 12px 12px; text-align: center; }
.db-gauge { display: block; width: 100%; max-width: 120px; margin: 0 auto; }
.db-gauge path { fill: none; stroke-width: 12; }
.db-gauge .g-track { stroke: #e6ebed; }
.db-gauge .g-fill { stroke: var(--brand); }
.db-gauge.alt .g-fill { stroke: #7fcfc9; }
[data-bs-theme="dark"] .db-gauge .g-track { stroke: #2a3439; }
.db-gauge-val { position: absolute; left: 0; right: 0; top: 46px; font-weight: 600; font-size: 1.05rem; }
.db-gauge-lbl { display: block; font-size: .74rem; color: var(--ink-3); margin-top: 8px; }

.db-empty { text-align: center; padding: 30px 18px; }
.db-empty p { font-size: .84rem; color: var(--ink-3); margin: 10px auto 14px; max-width: 36ch; }
.db-empty-ico { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 1.1rem; background: var(--brand-50); color: var(--brand); }

@media (max-width: 1199.98px) { .db-setup-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
  .db-hero-art { inset: 0 0 0 55%; opacity: .5; }
  .db-hero-text { padding: 22px 20px; }
  .db-hero p { font-size: .95rem; }
  .db-setup-steps { grid-template-columns: 1fr; }
  .db-search input { width: 130px; }
  .db-legend { margin-left: 0; order: 3; width: 100%; }
}
@media (max-width: 575.98px) {
  .topbar { gap: 8px; }
  .topbar-heading { min-width: 0; flex: 1 1 auto; }
  .topbar-heading h1 { font-size: 1.1rem; }
  .topbar-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-actions { gap: 6px; }
  .btn-user { padding: 0; }
  .btn-user.dropdown-toggle::after { display: none; }
}

/* campaign sending progress */
.cp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cp-grid > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.cp-grid b { font-size: 1.05rem; font-weight: 600; }
.cp-grid span { font-size: .72rem; color: var(--ink-3); }

/* profile dropdown: identity + plan usage */
.user-menu { width: 290px; padding: 6px; }
.user-menu .dropdown-item { border-radius: 7px; padding: 8px 10px; }
.um-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; }
.um-head .avatar { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 600;
  background: #d9efed; color: var(--brand-700); }
[data-bs-theme="dark"] .um-head .avatar { background: rgba(43,179,171,.18); color: #5fd3cb; }
.um-id { display: flex; flex-direction: column; min-width: 0; }
.um-name { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-mail { font-size: .76rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-plan { margin: 0 2px 6px; padding: 12px; border-radius: 10px; background: #1e2629; color: #c9d1d5; }
[data-bs-theme="dark"] .um-plan { background: #1c2428; border: 1px solid var(--line); }
.um-plan-name { color: #fff; font-weight: 600; font-size: .84rem; }
.um-plan-name i { color: #fbbf24; }
.um-plan-pct { font-size: .72rem; color: #8d999e; }
.um-plan-text { font-size: .76rem; margin: 6px 0 8px; color: #aab5ba; }
.um-plan-text b { color: #5fd3cb; font-weight: 600; }
.um-bar { height: 5px; border-radius: 9px; background: rgba(255,255,255,.12); overflow: hidden; margin-bottom: 10px; }
.um-bar > span { display: block; height: 100%; border-radius: 9px; background: #2bb3ab; }
.um-bar > span.hot { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.um-plan-cta { font-size: .78rem; font-weight: 600; color: #fff; }
.um-plan-cta:hover { color: #5fd3cb; }

/* ---- Campaign wizard ------------------------------------------------ */
.wz-count { font-size: .72rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.wz-count.over { color: #d9822b; font-weight: 600; }
.wz-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.tag-chip { border: 1px solid var(--line); background: var(--canvas); color: var(--brand-600); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .74rem; padding: 2px 8px; border-radius: 6px; cursor: pointer; }
.tag-chip:hover { border-color: var(--brand); background: var(--brand-50); }
[data-bs-theme="dark"] .tag-chip { color: #7fd6cf; }
.wz-sender { color: var(--ink-2); }
.wz-sender i { color: var(--brand); margin-right: 3px; }

.wz-inbox { border: 1px dashed #cfd8db; border-radius: 12px; padding: 12px 14px; background: var(--canvas); }
[data-bs-theme="dark"] .wz-inbox { border-color: rgba(255,255,255,.12); }
.wz-inbox-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 8px; }
.wz-inbox-row { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.wz-inbox-avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center; background: #d9efed; color: var(--brand-700); font-weight: 600; }
.wz-inbox-from { font-weight: 600; font-size: .86rem; }
.wz-inbox-time { font-size: .72rem; color: var(--ink-3); }
.wz-inbox-subject { font-size: .84rem; font-weight: 500; }
.wz-inbox-pre { font-size: .8rem; color: var(--ink-3); }

.wz-aud { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: linear-gradient(90deg, var(--brand-50), var(--surface) 70%); }
[data-bs-theme="dark"] .wz-aud { background: linear-gradient(90deg, rgba(43,179,171,.10), var(--surface) 70%); }
.wz-aud-main { display: flex; align-items: baseline; gap: 8px; font-size: .9rem; color: var(--ink-2); }
.wz-aud-num { font-size: 1.6rem; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.wz-aud-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--ink-2); margin-top: 6px; }
.wz-aud-cap { font-size: .8rem; color: var(--ink-2); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

.wz-side-title { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 8px; }
.wz-test { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.wz-preview-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.seg-tabs.seg-sm { padding: 3px; border-radius: 8px; }
.seg-tabs.seg-sm button { padding: 3px 10px; font-size: .8rem; }
.wz-preview-stage { background: var(--canvas); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.wz-preview-stage iframe { display: block; width: 100%; min-height: 380px; border: 0; background: #fff; border-radius: 6px; margin: 0 auto; transition: width .2s; }
.wz-preview-stage.mobile iframe { width: 375px; max-width: 100%; }
.wz-preview-stage.small-stage iframe { min-height: 320px; }

.wz-when { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wz-when-opt input { position: absolute; opacity: 0; pointer-events: none; }
.wz-when-card { display: flex; gap: 10px; align-items: flex-start; height: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; transition: .15s; }
.wz-when-card > i { font-size: 1.2rem; color: var(--ink-3); margin-top: 1px; }
.wz-when-card:hover { border-color: #b9c6ca; }
.wz-when-opt input:checked + .wz-when-card { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px var(--ring); }
.wz-when-opt input:checked + .wz-when-card > i { color: var(--brand); }
.wz-when-opt input:focus-visible + .wz-when-card { outline: 2px solid var(--brand); outline-offset: 2px; }
[data-bs-theme="dark"] .wz-when-opt input:checked + .wz-when-card { background: rgba(43,179,171,.12); }

.wz-review { border: 1px solid var(--line); border-radius: 12px; }
.wz-review-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px; }
.wz-review-row + .wz-review-row { border-top: 1px solid var(--line); }
.wz-review-row > .text-muted { grid-column: 1 / 3; }
.wz-review-row > .fw-semibold { font-size: .88rem; word-break: break-word; }
.wz-review-row .btn-link { font-size: .78rem; align-self: start; }
.wz-check { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
@media (max-width: 767.98px) { .wz-when { grid-template-columns: 1fr; } }
@media (max-width: 991.98px) {
  .wizard-steps { flex-direction: row; gap: 6px; overflow-x: auto; }
  .wstep { flex: 1 0 auto; padding: 8px 10px; gap: 8px; align-items: center; }
  .wstep .wnum { width: 28px; height: 28px; font-size: .8rem; }
  .wstep .wsub { display: none; }
  .wstep:not(.active) .wtitle { display: none; }
}

/* ---- Visual email builder ------------------------------------------ */
.wizard.wide { grid-template-columns: 1fr; }
.wizard.wide .wizard-steps { flex-direction: row; gap: 6px; overflow-x: auto; }
.wizard.wide .wstep { flex: 1 0 auto; padding: 8px 12px; gap: 10px; align-items: center; }
.wizard.wide .wstep .wnum { width: 28px; height: 28px; font-size: .8rem; }
.wizard.wide .wstep .wsub { display: none; }

.eb { position: relative; }
.eb-top { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.eb-top-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.eb-top-hint { margin-left: auto; font-size: .76rem; color: var(--ink-3); }
.eb-main { display: grid; grid-template-columns: 112px minmax(0, 1fr) 280px; gap: 12px; align-items: start; }
.eb-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 8px; }

.eb-palette { display: grid; gap: 6px; position: sticky; top: 90px; }
.eb-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink-2); font-size: .74rem; font-weight: 500; cursor: grab; transition: border-color .15s, color .15s, transform .15s; }
.eb-tile i { font-size: 1.15rem; }
.eb-tile:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.eb-tile:active { cursor: grabbing; }

.eb-canvas { background: var(--canvas); border: 1px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden; min-height: 520px; }
.eb-mail { position: relative; padding: 24px 16px; min-height: 520px; }
.eb-body { position: relative; max-width: 600px; margin: 0 auto; min-height: 120px; color: #374151; font-size: 16px; line-height: 1.5; text-align: left;
  box-shadow: 0 1px 3px rgba(16,24,40,.08); padding: 12px 0; }
.eb-body table { border-collapse: separate; }
.eb-body [data-edit] { outline: none; cursor: text; min-height: 1em; }
.eb-body [data-edit] p { margin: 0 0 12px; }
.eb-body [data-edit] p:last-child { margin-bottom: 0; }
.eb-body [data-edit] a { color: var(--eb-link); text-decoration: underline; }
.eb-body [data-edit] ul { margin: 0 0 12px; padding-left: 22px; }
.eb-body [data-edit]:focus { box-shadow: 0 0 0 2px rgba(31,158,152,.25); border-radius: 3px; }
.eb-block { position: relative; cursor: pointer; }
.eb-block::after { content: ''; position: absolute; inset: 0; border: 1px dashed transparent; pointer-events: none; transition: border-color .12s; }
.eb-block:hover::after { border-color: rgba(31,158,152,.55); }
.eb-block.selected::after { border: 2px solid var(--brand); }
.eb-block.dragging { opacity: .4; }
.eb-tag { position: absolute; top: -1px; left: -1px; font: 600 10px/1 Inter, sans-serif; background: var(--brand); color: #fff; padding: 3px 6px; border-radius: 0 0 5px 0; opacity: 0; pointer-events: none; }
.eb-tools { position: absolute; top: 4px; right: 4px; display: none; gap: 2px; background: #fff; border: 1px solid #e3e8ea; border-radius: 7px; padding: 2px; box-shadow: 0 4px 12px -4px rgba(16,24,40,.25); z-index: 2; }
.eb-tools button { width: 26px; height: 26px; border: 0; background: transparent; border-radius: 5px; color: #4b5764; font-size: .82rem; display: grid; place-items: center; }
.eb-tools button:hover { background: #eef2f3; color: var(--brand); }
.eb-tools button[data-act=del]:hover { color: #d23c41; }
.eb-tools button[data-act=drag] { cursor: grab; }
.eb-block:hover .eb-tag, .eb-block.selected .eb-tag { opacity: 1; }
.eb-block:hover .eb-tools, .eb-block.selected .eb-tools { display: flex; }
.eb-drop { position: absolute; left: 16px; right: 16px; height: 4px; border-radius: 4px; background: var(--brand); box-shadow: 0 0 0 3px rgba(31,158,152,.2); pointer-events: none; z-index: 3; }
.eb-drop[hidden] { display: none; }
.eb-img-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 140px; border: 2px dashed #cfd8db; border-radius: 8px;
  background: #f7f9fa; color: #8a94a0; font: 500 13px Inter, sans-serif; }
.eb-img-empty i { font-size: 1.6rem; }
.eb-img-empty.eb-img-sm { min-height: 80px; margin-bottom: 10px; }
.eb-hint { font: 13px Inter, sans-serif; color: #8a94a0; padding: 8px; border: 1px dashed #cfd8db; border-radius: 8px; }

.eb-empty { padding: 28px 24px; text-align: center; font-family: Inter, sans-serif; }
.eb-empty-title { font-weight: 600; font-size: 1.05rem; color: #1c2434; }
.eb-empty-sub { font-size: .84rem; color: #8a94a0; margin: 2px 0 16px; }
.eb-layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; text-align: left; }
.eb-layout { display: flex; flex-direction: column; gap: 3px; padding: 14px; border: 1px solid #e3e8ea; border-radius: 10px; background: #fff; color: #1c2434; text-align: left; transition: .15s; }
.eb-layout i { font-size: 1.3rem; color: var(--brand); margin-bottom: 4px; }
.eb-layout:hover { border-color: var(--brand); box-shadow: 0 6px 16px -10px rgba(31,158,152,.6); transform: translateY(-1px); }

.eb-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; }
.eb-panel-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: .9rem; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.eb-panel-body { padding: 12px 14px; }
.eb-field { margin-bottom: 12px; }
.eb-field .form-label { font-size: .76rem; font-weight: 500; color: var(--ink-2); margin-bottom: 4px; }
.eb-val { font-size: .72rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.eb-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.eb-seg button { border: 0; background: var(--surface); width: 38px; height: 30px; color: var(--ink-2); }
.eb-seg button + button { border-left: 1px solid var(--line); }
.eb-seg button.active { background: var(--brand-50); color: var(--brand); }
[data-bs-theme="dark"] .eb-seg button.active { background: rgba(43,179,171,.15); }
.eb-color { display: flex; align-items: center; gap: 6px; }
.eb-color input[type=color] { width: 34px; height: 30px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); flex: 0 0 34px; cursor: pointer; }
.eb-color input[type=text] { max-width: 110px; font-family: ui-monospace, Menlo, monospace; font-size: .78rem; }
.eb-thumb { display: block; max-width: 100%; max-height: 110px; border-radius: 6px; margin-bottom: 6px; border: 1px solid var(--line); }

.eb-textbar { position: absolute; z-index: 20; display: flex; align-items: center; gap: 2px; padding: 4px; background: #1e2629; border-radius: 9px; box-shadow: 0 10px 24px -8px rgba(0,0,0,.4); }
.eb-textbar[hidden] { display: none; }
.eb-textbar button { width: 30px; height: 28px; border: 0; background: transparent; color: #e4ebee; border-radius: 6px; }
.eb-textbar button:hover { background: rgba(255,255,255,.1); }
.eb-textbar button[hidden] { display: none; }
.eb-textbar select { height: 28px; border: 0; border-radius: 6px; background: rgba(255,255,255,.1); color: #e4ebee; font-size: .78rem; padding: 0 6px; }
.eb-textbar select option { color: #111; }
.eb-linkrow { display: inline-flex; gap: 4px; margin-left: 4px; }
.eb-linkrow[hidden] { display: none; }
.eb-linkrow input { height: 28px; width: 200px; border: 0; border-radius: 6px; padding: 0 8px; font-size: .8rem; }
.eb-linkrow button { width: auto; padding: 0 10px; background: var(--brand); }

.eb-layouts { position: fixed; inset: 0; z-index: 1080; background: rgba(16,22,26,.45); display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; }
.eb-layouts[hidden] { display: none; }
.eb-layouts-box { width: 100%; max-width: 760px; background: var(--surface); border-radius: 14px; padding: 18px; box-shadow: 0 30px 70px -20px rgba(0,0,0,.5); max-height: 80vh; overflow-y: auto; }
[data-bs-theme="dark"] .eb-layout { background: #1c2428; border-color: var(--line); color: var(--ink); }

.wz-testrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.wz-testrow input { max-width: 260px; }

@media (max-width: 1199.98px) {
  .eb-main { grid-template-columns: minmax(0, 1fr); }
  .eb-palette { position: static; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .eb-panel { position: static; max-height: none; }
  .eb-top-hint { display: none; }
}
/* builder polish: tools outside the email, brand sliders, stacked labels */
.eb-canvas { overflow: visible; }
.eb-mail { border-radius: 12px; padding: 24px 44px; }
.eb-tools { top: 0; right: -38px; flex-direction: column; }
.eb-field .form-label { display: block; }
.eb .form-range::-webkit-slider-thumb { background: var(--brand); }
.eb .form-range::-moz-range-thumb { background: var(--brand); }
.eb .form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--ring); }
@media (max-width: 575.98px) { .eb-mail { padding: 16px 36px 16px 8px; } }

/* ===== Connect (OAuth consent) + Integrations ===== */
.oa-apps { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 18px; }
.oa-app { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; color: #fff; box-shadow: 0 12px 24px -12px rgba(20,33,43,.5); }
.oa-app--sheet { background: #188038; }
.oa-app--brand { background: var(--brand-grad); }
.oa-link { color: var(--ink-3, #8a969f); font-size: 1.1rem; }
.oa-perms { border: 1px solid var(--line, #e6ebed); border-radius: 14px; padding: 16px 18px; margin-bottom: 20px; background: var(--bs-tertiary-bg); }
.oa-perms-title { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3, #8a969f); margin-bottom: 8px; }
.oa-perms ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.oa-perms li { display: flex; gap: 10px; font-size: .92rem; line-height: 1.45; }
.oa-perms li i { color: var(--brand); margin-top: 1px; }
.oa-perms .oa-no li i { color: #dc2626; }

.int-card { display: flex; gap: 16px; align-items: flex-start; }
.int-icon { width: 46px; height: 46px; border-radius: 13px; flex: 0 0 auto; display: grid; place-items: center; font-size: 1.25rem; color: #fff; background: #188038; }
.int-steps { counter-reset: st; list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.int-steps li { counter-increment: st; display: flex; gap: 10px; font-size: .9rem; }
.int-steps li::before { content: counter(st); width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-size: .72rem; font-weight: 700; background: var(--brand-50, #e8f6f5); color: var(--brand-700, #0f6b66); }
.token-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--bs-border-color); }
.token-row:first-child { border-top: 0; }
.token-row .tr-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; background: var(--bs-tertiary-bg); color: var(--brand); }
.token-row .tr-meta { color: var(--bs-secondary-color); font-size: .8rem; }
.token-row code { font-size: .8rem; }
.new-key { border: 1px dashed var(--brand); border-radius: 12px; padding: 14px; background: color-mix(in srgb, var(--brand) 6%, var(--bs-body-bg)); }
.new-key code { word-break: break-all; font-size: .85rem; }
.api-adv summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.api-adv summary::-webkit-details-marker { display: none; }
.api-adv summary .bi-chevron-down { transition: transform .2s; margin-left: auto; }
.api-adv[open] summary .bi-chevron-down { transform: rotate(180deg); }
/* Settings menu: keep the soft active pill (the theme's solid nav-pills rule hid its text). */
.settings-nav .nav-pills .nav-link.active { background: color-mix(in srgb, var(--brand) 12%, var(--bs-body-bg)); color: var(--brand); }

/* ===== Deliverability tab ===== */
.td-now { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dns-table code { font-size: .8rem; }
.dh-domain { border: 1px solid var(--bs-border-color); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.dh-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dh-score { font-weight: 700; font-size: .85rem; padding: 2px 10px; border-radius: 999px; background: var(--bs-tertiary-bg); }
.dh-score.good { color: #16a34a; background: #eaf7ef; } .dh-score.mid { color: #b45309; background: #fff4e0; } .dh-score.bad { color: #dc2626; background: #fdecec; }
.dh-row { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--bs-border-color); }
.dh-row:first-child { border-top: 0; }
.dh-row > i { margin-top: 2px; }
.dh-pass > i { color: #16a34a; } .dh-warn > i { color: #d97706; } .dh-fail > i { color: #dc2626; }
.dh-label { font-weight: 600; color: var(--bs-body-color); }
.dh-detail { color: var(--bs-secondary-color); word-break: break-all; }
.dh-fix { color: var(--bs-body-color); }
[data-bs-theme="dark"] .dh-score.good { background: rgba(22,163,74,.15); } [data-bs-theme="dark"] .dh-score.mid { background: rgba(217,119,6,.15); } [data-bs-theme="dark"] .dh-score.bad { background: rgba(220,38,38,.15); }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.recovery-grid code { font-size: .9rem; }
.totp-qr { background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--bs-border-color); width: 190px; height: 190px; display: grid; place-items: center; }
.pay-opt { display: flex; align-items: center; gap: 12px; border: 1px solid var(--bs-border-color); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.pay-opt:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--bs-body-bg)); }
.pay-opt span { flex: 1; } .pay-opt small { display: block; color: var(--bs-secondary-color); }
.pay-opt b { font-size: 1.05rem; }

/* ===== Admin: errors ===== */
.err-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-top: 1px solid var(--bs-border-color); }
.err-row:first-child { border-top: 0; }
.err-level { font-size: .7rem; font-weight: 700; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; flex: 0 0 auto; margin-top: 2px; }
.err-exception, .err-fatal, .err-error { background: #fdecec; color: #dc2626; }
.err-warning { background: #fff4e0; color: #b45309; }
.err-trace { font-size: .72rem; max-height: 260px; overflow: auto; background: var(--bs-tertiary-bg); padding: 10px; border-radius: 8px; margin: 6px 0 0; }
.min-w-0 { min-width: 0; }

/* ===== Support ===== */
.sup-msg { padding: 12px 14px; border-radius: 12px; background: var(--bs-tertiary-bg); margin-bottom: 10px; max-width: 86%; }
.sup-msg.sup-staff { background: color-mix(in srgb, var(--brand) 9%, var(--bs-body-bg)); margin-left: auto; }
.sup-who { font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
.sup-body { font-size: .93rem; line-height: 1.55; word-break: break-word; }
.text-uppercase::placeholder { text-transform: none; }
