/* =========================================================
   FreeTrafficBlogger UI
   - Light: Sneat-style
   - Dark: Midnight with orb
   ========================================================= */

/* ---------------------------------------------------------
   1) Fallback variables
   --------------------------------------------------------- */
:root {
  --bg: #f4f5fb;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --border: rgba(15,23,42,0.04);
  --text: #0f172a;
  --muted: #94a3b8;
  --brand: #4f46e5;
  --brand-2: #06b6d4;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15,23,42,.03);
  --shadow-hover: 0 16px 40px rgba(15,23,42,.05);
  --pad-content: 22px;
  --gap-tiles: 24px;
  --gap-section: 40px;
}

/* ---------------------------------------------------------
   2) Light theme
   --------------------------------------------------------- */
body[data-theme="light"] {
  --bg: #f4f5fb;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --border: rgba(15,23,42,0.04);
  --text: #0f172a;
  --muted: #94a3b8;
  --brand: #4f46e5;
  --brand-2: #06b6d4;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15,23,42,.03);
  --shadow-hover: 0 16px 40px rgba(15,23,42,.05);
  --pad-content: 22px;
  --gap-tiles: 24px;
  --gap-section: 40px;
}

/* ---------------------------------------------------------
   3) Dark theme
   --------------------------------------------------------- */
body[data-theme="dark"] {
  --bg: #0b0d10;
  --panel: rgba(11,13,16,0.82);
  --panel-2: rgba(17,20,24,0.9);
  --border: rgba(120,120,120,0.35);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --brand: #6366f1;
  --brand-2: #06b6d4;
  --radius: 16px;
  --shadow: 0 14px 40px rgba(0,0,0,.40);
  --shadow-hover: 0 18px 50px rgba(0,0,0,.48);
  --pad-content: 22px;
  --gap-tiles: 24px;
  --gap-section: 40px;
}

/* ---------------------------------------------------------
   4) Base
   --------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  position: relative;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------------------------------------------------------
   5) Dark orb background (only dark)
   --------------------------------------------------------- */
body[data-theme="dark"]::before {
  content: "";
  position: fixed;
  inset: -12% -12% -12% -12%;
  background: url("background.png") center/cover no-repeat;
  opacity: 0.48;
  filter: blur(6px) saturate(140%);
  z-index: 0;
  transform: translate3d(-12%, -8%, 0) scale(1.06);
  animation: orbFloat 18s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes orbFloat {
  0%   { transform: translate3d(-12%, -8%, 0) scale(1.06); opacity: 0.44; }
  50%  { transform: translate3d(8%, 6%, 0) scale(1.12); opacity: 0.52; }
  100% { transform: translate3d(-4%, 10%, 0) scale(1.08); opacity: 0.46; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-theme="dark"]::before { animation: none; }
}

/* ---------------------------------------------------------
   6) Topbar
   --------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.topbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 800;
}
.crumbs {
  color: var(--muted);
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Search */
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(148,163,184,.12);
  border: 1px solid rgba(148,163,184,.15);
  padding: 6px 12px;
  border-radius: 999px;
}
body[data-theme="dark"] .search {
  background: rgba(11,13,16,.4);
  border: 1px solid rgba(148,163,184,.12);
}
.search input {
  all: unset;
  width: 200px;
  color: inherit;
}

/* Buttons in topbar */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 38px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
  font-weight: 500;
  font-size: 0.8rem;
}
.icon-btn:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
}

/* Avatar */
.avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  height: 42px;
}
.avatar > div {
  width: 34px;
  height: 34px;
}

/* Theme toggle icons */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
body[data-theme="light"] .theme-toggle .icon-sun { display: block; }
body[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ---------------------------------------------------------
   7) Top dropdown menu
   --------------------------------------------------------- */
.top-menu { position: relative; }
.top-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 10px 10px 14px;
  display: none;
  z-index: 200;
}
.top-menu-panel.open { display: block; }
.top-menu-group + .top-menu-group {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(148,163,184,.18);
}
.top-menu-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 6px;
  padding: 0 4px;
}
.top-menu-link {
  display: block;
  padding: 6px 6px 6px 4px;
  border-radius: 10px;
  font-size: 0.86rem;
  color: var(--text);
}
.top-menu-link:hover { background: rgba(99,102,241,0.08); }
.top-menu-link.active {
  background: rgba(99,102,241,0.15);
  font-weight: 600;
}

/* ---------------------------------------------------------
   8) Layout (no sidebar)
   --------------------------------------------------------- */
.app,
.app.app-nosidebar {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
  position: relative;
  z-index: 1; /* above orb */
}

.content {
  padding: var(--pad-content);
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
   flex: 1; /* this makes the content fill the .app height */
}
.content > * + * {
  margin-top: var(--gap-section);
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.h1 {
  font-size: 22px;
  margin: 0;
}


/* ---------------------------------------------------------
   9) Cards & Panels
   --------------------------------------------------------- */
.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 36px;
  transition: transform .12s ease, box-shadow .12s ease;
  backdrop-filter: blur(8px);
}
body[data-theme="light"] .card,
body[data-theme="light"] .panel {
  backdrop-filter: none;
}
.card:hover,
.panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.grid { display: grid; gap: var(--gap-tiles); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }

/* ---------------------------------------------------------
   10) Buttons
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  color: #fff;
  background: linear-gradient(
    90deg,
    #1e1b4b,
    #4c1d95,
    #6d28d9,
    #111827
  );
  background-size: 300% 100%;
  animation: gradientShift 8s ease infinite;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
  box-shadow: 0 6px 22px rgba(109, 40, 217, 0.35);
}
.btn:active {
  transform: translateY(0);
  filter: brightness(0.95);
  box-shadow: 0 3px 10px rgba(109, 40, 217, 0.25);
}
@keyframes gradientShift {
  0% { background-position: 0 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.btn-outline {
  background: transparent;
  border: 2px solid #6d28d9;
  color: #6d28d9;
}
.btn-outline:hover {
  background: linear-gradient(90deg, #4c1d95, #6d28d9, #1e1b4b);
  color: #fff;
  border-color: transparent;
  animation: gradientShift 6s ease infinite;
}

/* ---------------------------------------------------------
   11) Basic forms/tables (structure only)
   --------------------------------------------------------- */
/* (we'll do final input styling in section 14) */
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(148,163,184,0.2);
  text-align: left;
}

/* ---------------------------------------------------------
   12) Responsive
   --------------------------------------------------------- */
@media (max-width: 1200px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .search input { width: 120px; }
  .content { padding: 16px; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .topbar-inner { padding: 0 12px; }
  .crumbs,
  .avatar,
  .search {
    display: none !important;
  }
  .top-menu-panel {
    position: fixed;
    top: 54px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
  .content { padding: 14px; }
}
/* make Menu button match avatar pill size */
.icon-btn.top-menu-trigger {
  height: 42px;
  padding: 0 16px;
  font-size: 0.95rem;
  font-weight: 200;
  border-radius: 999px;
}

/* ---------------------------------------------------------
   13) Badges
   --------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.badge-red {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #ef4444;
}
.badge-yellow {
  background: #fef9c3;
  color: #a16207;
  border: 1px solid #eab308;
}
.badge-green {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #22c55e;
}
[data-theme="dark"] .badge-red {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.4);
  color: #fca5a5;
}
[data-theme="dark"] .badge-yellow {
  background: rgba(234,179,8,0.15);
  border-color: rgba(234,179,8,0.4);
  color: #fde68a;
}
[data-theme="dark"] .badge-green {
  background: rgba(34,197,94,0.15);
  border-color: rgba(34,197,94,0.4);
  color: #86efac;
}

/* ---------------------------------------------------------
   14) GLOBAL INPUT STYLING (final, no overrides below this)
   --------------------------------------------------------- */

/* LIGHT MODE */
body[data-theme="light"] input[type="text"],
body[data-theme="light"] input[type="email"],
body[data-theme="light"] input[type="password"],
body[data-theme="light"] input[type="number"],
body[data-theme="light"] textarea,
body[data-theme="light"] select,
body[data-theme="light"] .input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #d1d5db;   /* light gray that contrasts with white panel */
  color: #111827;
  font-size: 1rem;
  box-sizing: border-box;
  transition: all 0.2s ease-in-out;
}

body[data-theme="light"] input:focus,
body[data-theme="light"] textarea:focus,
body[data-theme="light"] select:focus {
  outline: none;
  border-color: var(--brand, #4f46e5);
  background: #e5e7eb;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}

/* DARK MODE */
body[data-theme="dark"] input[type="text"],
body[data-theme="dark"] input[type="email"],
body[data-theme="dark"] input[type="password"],
body[data-theme="dark"] input[type="number"],
body[data-theme="dark"] textarea,
body[data-theme="dark"] select,
body[data-theme="dark"] .input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1e293b;
  color: #e2e8f0;
  font-size: 1rem;
  box-sizing: border-box;
  transition: all 0.2s ease-in-out;
}

body[data-theme="dark"] input:focus,
body[data-theme="dark"] textarea:focus,
body[data-theme="dark"] select:focus {
  outline: none;
  border-color: var(--brand-2, #06b6d4);
  background: #0f172a;
  box-shadow: 0 0 0 3px rgba(6,182,212,0.25);
}

/* ---------------------------------------------------------
   15) Firefox fallback for dark blur
   --------------------------------------------------------- */
@supports not (backdrop-filter: blur(8px)) {
  body[data-theme="dark"] .card,
  body[data-theme="dark"] .panel,
  body[data-theme="dark"] .topbar,
  body[data-theme="dark"] .content {
    background: #0f172a !important;
    border: 1px solid rgba(148,163,184,0.12) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.35);
  }
}
/* FINAL OVERRIDE FOR APP FORMS */
body[data-theme="light"] .app input[type="text"],
body[data-theme="light"] .app input[type="email"],
body[data-theme="light"] .app input[type="password"],
body[data-theme="light"] .app textarea,
body[data-theme="light"] .app select {
  background: #f2f2f2 !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  color: #111827 !important;
}
/* ---------------------------------------------------------
   16) Full Height Page (for editor pages like email-cta-edit.php)
   --------------------------------------------------------- */
.fullscreen-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.fullscreen-page .content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center; /* centers vertically */
  align-items: center;     /* centers horizontally */
  padding: var(--pad-content);
}
/* === Extend full-height behavior for pages === */
.app.app-nosidebar > .content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
/* ---------------------------------------------------------
   Form layout and button improvements (global)
   --------------------------------------------------------- */
.form-col {
  display: flex;
  flex-direction: column;
  gap: 10px; /* space between form groups */
  max-width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 600;
  font-size: 0.95rem;
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

/* spacing between hints, paragraphs, etc. */
.form-col p.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* make main submit buttons chunkier and more prominent */
.btn {
  padding: 14px 28px;       /* bigger touch area */
  font-size: 1rem;          /* slightly larger text */
  border-radius: 14px;      /* smoother shape */
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* optional: widen button if it's the only element in group */
.form-col .btn {
  align-self: flex-start;
}
/* ---------------------------------------------------------
   Wizard / multi-step page
   --------------------------------------------------------- */
.wizard-steps {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(148,163,184,0.08);
  border: 1px solid rgba(148,163,184,0.12);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

.wizard-step-number {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(79,70,229,0.12);
  color: var(--text);
  font-weight: 600;
  font-size: 0.7rem;
}

.wizard-step.active {
  background: rgba(99,102,241,0.15);
  color: var(--text);
  border-color: rgba(99,102,241,0.35);
}

.wizard-step.active .wizard-step-number {
  background: var(--brand);
  color: #fff;
}

.wizard-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wizard-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.wizard-actions .btn-secondary {
  background: transparent;
  border: 1px solid rgba(148,163,184,0.4);
  color: inherit;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity .15s ease;
}
.wizard-actions .btn-secondary:hover {
  opacity: .7;
}
/* ---------------------------------------------------------
   "What this does" info block
   --------------------------------------------------------- */
.wizard-info {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(79,70,229,0.06);
  border: 1px solid rgba(79,70,229,0.15);
  color: var(--text);
  line-height: 1.5;
  font-size: 0.9rem;
}

.wizard-info h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}
[data-theme="dark"] .wizard-info h3 {
  color: #ffffff;
}
[data-theme="dark"] .wizard-info {
  background: rgba(99,102,241,0.15);
  border-color: rgba(99,102,241,0.25);
}

/* Collapsible styling */
.wizard-info.is-collapsible {
  position: relative;
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;   /* vertical centering */
  align-items: flex-start;   /* left align horizontally */
  min-height: 60px;          /* even top/bottom spacing when closed */
  transition: all 0.25s ease;
  padding-left: 20px;        /* slight left inset for alignment with text */
}

.wizard-info-toggle {
  background: transparent;
  border: none;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;       /* vertical center text + arrow */
  justify-content: flex-start;
  gap: 6px;
  font-size: 1.2rem;
  padding: 8px 0;
}


.wizard-info-toggle::after {
  content: "▾";
  font-size: 0.8rem;
  opacity: 0.75;
}

.wizard-info-toggle.open::after {
  content: "▴";
}

.wizard-info-body {
  display: none;
  margin-top: 12px;
  width: 100%;
}

.wizard-info-body.open {
  display: block;
}

/* =========================================================
   Tip / Helper Blocks (collapsible)
   For: "What this does?", "Quick tip", "Why this matters"
   ========================================================= */

/* Base tip block */
.tip-block {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(79,70,229,0.06);
  border: 1px solid rgba(79,70,229,0.15);
  color: var(--text);
  line-height: 1.5;
  font-size: 0.9rem;
}

/* Headings inside tips */
.tip-block h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a; /* light mode */
}

/* Dark theme support */
[data-theme="dark"] .tip-block {
  background: rgba(99,102,241,0.15);
  border-color: rgba(99,102,241,0.25);
}
[data-theme="dark"] .tip-block h3 {
  color: #ffffff;
}

/* Collapsible variant */
.tip-block.is-collapsible {
  position: relative;
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;   /* vertically center toggle */
  align-items: flex-start;   /* left align text */
  min-height: 60px;
  transition: all 0.25s ease;
  padding-left: 20px;
}

/* The toggle line: "ⓘ What this does" */
.tip-block-toggle {
  background: transparent;
  border: none;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  font-size: 1.05rem;
  padding: 8px 0;
}

/* Arrow (closed) */
.tip-block-toggle::after {
  content: "▾";
  font-size: 0.8rem;
  opacity: 0.75;
}

/* Arrow (open) */
.tip-block-toggle.open::after {
  content: "▴";
}

/* The hidden body */
.tip-block-body {
  display: none;
  margin-top: 12px;
  width: 100%;
}

.tip-block-body.open {
  display: block;
}

/* =========================================================
   Optional: step header (for wizards)
   ========================================================= */
.tip-steps {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tip-step {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(148,163,184,0.08);
  border: 1px solid rgba(148,163,184,0.12);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

.tip-step-number {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(79,70,229,0.12);
  color: var(--text);
  font-weight: 600;
  font-size: 0.7rem;
}

.tip-step.active {
  background: rgba(99,102,241,0.15);
  color: var(--text);
  border-color: rgba(99,102,241,0.35);
}

.tip-step.active .tip-step-number {
  background: var(--brand);
  color: #fff;
}
/* ---------------------------------------------------------
   Setup "Start Here" page mobile tweaks
   --------------------------------------------------------- */

/* make whole card clickable without wrecking layout */
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.card-link .card {
  cursor: pointer;
  transition: transform 0.05s ease-out, box-shadow 0.05s ease-out;
  height: 100%;
}
.card-link .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

/* ensure base grid exists (in case page uses grid-3) */
.setup-grid,
.grid-3 {
  gap: var(--gap-tiles);
}

/* extra responsive layer just for setup page */
@media (max-width: 768px) {
  /* stack page header */
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  /* 1 column cards on phones */
  .grid-3 {
    grid-template-columns: 1fr;
  }

  /* card header (title + chip) nice inline layout */
  .card-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
  }

  /* hide empty placeholders (like the spacer div in row 3) */
  section.grid-3 > div:empty {
    display: none;
  }
}
/* ============================
   Global loading overlay
   ============================ */
.loading-overlay {
  display: none;               /* hidden by default */
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55); /* nice dark glass */
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  flex-direction: column;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
}

.loading-overlay.active {
  display: flex;
}

/* little spinner if you want */
.loading-overlay .loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
/* ---------------------------------------------------------
   Alerts / Messages
   --------------------------------------------------------- */
.alert {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.4;
  border: 1px solid transparent;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.alert-icon {
  font-size: 1.2rem;
  line-height: 1;
  margin-top: 1px;
}

/* error */
.alert-error {
  background: rgba(254, 226, 226, 0.85);
  border-color: rgba(248, 113, 113, 0.6);
  color: #7f1d1d;
}
[data-theme="dark"] .alert-error {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

/* success */
.alert-success {
  background: rgba(220, 252, 231, 0.85);
  border-color: rgba(34, 197, 94, 0.5);
  color: #14532d;
}
[data-theme="dark"] .alert-success {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
}

/* info */
.alert-info {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.25);
  color: inherit;
}
.wizard-success {
  text-align: left;
  padding: 40px var(--pad-content);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.wizard-success ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0px;
}
.wizard-success li {
  margin: 6px 0;
  font-size: 1rem;
}
.wizard-subtitle {
  margin-top: 20px;
  color: var(--text);
  font-weight: 600;
}
.emoji-intro {
  font-size: 1.25rem;
  margin-bottom: 10px;
}
.wizard-outro {
  margin-top: 25px;
  margin-bottom: 0px;
  font-size: 1.1rem;
  font-weight: 600;
}

.wizard-success + .wizard-actions {
  margin-top: 4px;
}
/* =========================================================
   Reusable page sections (for edit-* pages)
   ========================================================= */
.ftb-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 22px;
}

.ftb-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}
.ftb-section-header span,
.ftb-section-header h2,
.ftb-section-header h3 {
  font-weight: 600;
  font-size: 1rem;
}
.ftb-section-header small {
  color: var(--muted);
  font-size: .75rem;
}

/* Optional layout for forms on these pages */
.ftb-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
@media (max-width: 800px) {
  .ftb-form-grid {
    grid-template-columns: 1fr;
  }
}
/* use existing .form-group/.form-col for labels/inputs on each cell */

/* =========================================================
   Previous Promos list
   ========================================================= */
.ftb-list-head,
.ftb-list-row {
  display: grid;
  grid-template-columns: 160px 150px 1fr 110px; /* thumb | date | campaign | status */
  gap: 12px;
  align-items: center;
}
.ftb-list-head {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 6px 0 10px;
  border-bottom: 1px solid rgba(15,23,42,0.03);
  margin-bottom: 4px;
}
.ftb-list-row {
  padding: 10px 0;
  border-bottom: 1px solid rgba(15,23,42,0.02);
  font-size: .78rem;
}
.ftb-list-row:last-child {
  border-bottom: none;
}

/* mobile collapse */
@media (max-width: 900px) {
  .ftb-list-head,
  .ftb-list-row {
    grid-template-columns: 120px 1fr;
  }
}

/* thumbnail cell */
.ftb-thumb-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}
.ftb-thumb {
  width: 110px;
  height: 40px;
  background: #e2e8f0;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

/* status pills */
.ftb-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 500;
}
.ftb-status-active {
  background: rgba(34,197,94,0.1);
  color: #15803d;
}
.ftb-status-previous {
  background: rgba(148,163,184,0.16);
  color: #475569;
}

/* =========================================================
   Actions row (reuses your existing .btn)
   ========================================================= */
.ftb-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
/* =========================================================
   FTB Utility Classes
   (tiny helpers for consistent spacing, color & text)
   ========================================================= */

/* muted / subtle text */
.ftb-subtle {
  color: var(--muted);
  font-size: 0.8rem;
}

/* brand text highlight */
.ftb-brand {
  color: var(--brand);
  font-weight: 600;
}

/* small label / secondary info text */
.ftb-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* generic flex row (for aligning icons, buttons, etc.) */
.ftb-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* subtle divider line */
.ftb-divider {
  border-top: 1px solid rgba(15,23,42,0.05);
  margin: 12px 0;
}

/* small spacing helpers (for quick layout tweaks) */
.ftb-mt-sm { margin-top: 8px; }
.ftb-mt-md { margin-top: 16px; }
.ftb-mt-lg { margin-top: 28px; }

.ftb-text-center { text-align: center; }
.ftb-text-right  { text-align: right; }
/* keep promo thumbnails small inside the previous promos list */
.dash-section-body .ftb-list-head {
  display: grid;
  grid-template-columns: 120px 1fr 1fr auto;
  gap: 12px;
  align-items: center;
}

.dash-section-body .ftb-list-row {
  display: grid;
  grid-template-columns: 120px 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148,163,184,0.12);
}

.dash-section-body .ftb-list-row:last-child {
  border-bottom: none;
}

.dash-section-body img.ftb-thumb {
  width: 110px !important;
  height: 40px !important;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.dash-row.header-grid,
.dash-row.item-grid {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) 1fr 1fr auto; /* flexible desktop width */
  align-items: center;
  gap: 12px;
}

.dash-row.header-grid {
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid rgba(148,163,184,0.15);
  padding-bottom: 6px;
  margin-bottom: 6px;
}

/* Responsive for tablets & phones */
@media (max-width: 900px) {
  .dash-row.header-grid,
  .dash-row.item-grid {
    grid-template-columns: 1fr; /* stack columns vertically */
    gap: 6px;
  }
}


/* ---------------------------------------------------------
   Improve readability: bump text size & contrast in lists
   --------------------------------------------------------- */
.dash-meta {
  font-size: 1.0rem;           /* bigger text */
  line-height: 1.4;             /* better spacing */
  color: var(--text);           /* use main text color instead of muted */
}

body[data-theme="light"] .dash-meta {
  color: #1e293b;               /* darker for white panels */
}

body[data-theme="light"] .dash-row.header-grid {
  font-size: 0.85rem;           /* headers slightly smaller */
  color: #475569;               /* medium slate gray headers */
}

body[data-theme="dark"] .dash-meta {
  color: #e2e8f0;               /* lighter gray-blue for contrast in dark */
}

/* thumbnail inside Previous Promos list */
.promo-thumb {
  width: 110px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

/* fallback box when no image */
.promo-thumb-empty {
  width: 110px;
  height: 40px;
  border-radius: 10px;
  background: rgba(148,163,184,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  color: var(--muted);
}
/* force promo thumbnails to stay small inside the previous promos box */
.dash-section-body img.promo-thumb {
  width: 110px !important;
  height: 40px !important;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

/* fallback box when there's no image */
.dash-section-body .promo-thumb-empty {
  width: 110px;
  height: 40px;
  border-radius: 10px;
  background: rgba(148,163,184,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  color: var(--muted);
}
