/* Studioflow — dark, Apple-style design system.
   Identity: warm amber -> rose gradient on near-black. */

:root {
  --bg: #0a0a0c;
  --bg-elev: #141417;
  --card: #161619;
  --card-2: #1c1c21;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f4f5;
  --text-dim: #a1a1aa;
  --text-faint: #6b6b73;

  --amber: #a78bfa;
  --rose: #f43f6e;
  --brand: linear-gradient(120deg, #c4b5fd 0%, #8b5cf6 48%, #6d28d9 100%);
  --brand-soft: linear-gradient(120deg, rgba(167,139,250,0.16), rgba(109,40,217,0.16));

  --green: #34d399;
  --amber-flag: #8b8bf5;
  --blue: #60a5fa;
  --red: #f87171;
  --gray: #71717a;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --maxw: 1140px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ---------------------------------------------------------------- Animated tech background
   A canvas-rendered particle/node network drifts behind the whole app and
   reacts to the cursor. Drawing lives in static/bg.js. The canvas is fixed
   behind everything (z-index 0; content sits at >=1). A faint radial wash
   underneath gives the nodes some warm depth. */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-color: #000;
}
/* The sculpture, slowly rotating about its centre. */
.bg-spin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(1180px, 112vmin);
  height: auto;
  transform-origin: center center;
  animation: bg-rotate 90s linear infinite;
  will-change: transform;
}
@keyframes bg-rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .bg-spin { animation: none; transform: translate(-50%, -50%); }
}
/* Edge vignette — spotlights the sculpture and sinks the corners to black. */
.bg-veil {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(72% 72% at 50% 44%, transparent 36%, rgba(0, 0, 0, 0.78) 100%);
}

/* ---------------------------------------------------------------- Liquid chrome text
   Brushed-silver gradient clipped to text, with a slow shine sweep. */
.chrome {
  background: linear-gradient(
    100deg,
    #f6f7fb 0%, #a9afc0 16%, #ffffff 32%, #8b91a4 46%,
    #e6e9f1 60%, #9aa0b2 74%, #ffffff 88%, #c2c7d4 100%
  );
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: chrome-shine 7s linear infinite;
}
@keyframes chrome-shine {
  to { background-position: 250% center; }
}
@media (prefers-reduced-motion: reduce) {
  .chrome { animation: none; }
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ---------------------------------------------------------------- Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  background: rgba(10, 10, 12, 0.66);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand .dot {
  width: 24px; height: 24px; border-radius: 8px;
  background: var(--brand);
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs><linearGradient id='g' x1='2' y1='2' x2='30' y2='30' gradientUnits='userSpaceOnUse'><stop stop-color='%23c4b5fd'/><stop offset='.5' stop-color='%238b5cf6'/><stop offset='1' stop-color='%236d28d9'/></linearGradient></defs><rect x='1.5' y='1.5' width='29' height='29' rx='9' fill='url(%23g)'/><path d='M21 11.3c-1.2-1.2-3-1.9-5-1.9-2.7 0-4.6 1.4-4.6 3.4 0 4.5 9.6 2.3 9.6 7 0 2.1-2.1 3.6-5.1 3.6-2.1 0-4-.8-5.2-2.1' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' fill='none'/></svg>");
  background-size: cover;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.4);
}
.brand .name {
  background: linear-gradient(
    100deg, #f6f7fb 0%, #a9afc0 16%, #ffffff 32%, #8b91a4 46%,
    #e6e9f1 60%, #9aa0b2 74%, #ffffff 88%, #c2c7d4 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: chrome-shine 7s linear infinite;
}
.nav-links { display: flex; gap: 4px; margin-left: 22px; flex-wrap: wrap; }
.nav-links a {
  padding: 7px 13px;
  border-radius: 9px;
  color: var(--text-dim);
  font-size: 14.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-links a.active { color: var(--text); background: rgba(255,255,255,0.08); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-agency { color: var(--text-faint); font-size: 13.5px; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--card-2);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: transform .08s ease, background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: #24242a; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(180deg, #fbfcff 0%, #d6dae4 46%, #b4bac9 54%, #eaedf4 100%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #15151b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
              inset 0 -2px 6px rgba(0, 0, 0, 0.18),
              0 8px 22px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 32%, rgba(255, 255, 255, 0.7) 48%, transparent 64%);
  transform: translateX(-130%);
  transition: transform .6s ease;
  pointer-events: none;
}
.btn-primary:hover::before { transform: translateX(130%); }
.btn-primary:hover {
  opacity: 1;
  background: linear-gradient(180deg, #ffffff 0%, #e0e4ec 46%, #c4cad8 54%, #f2f4f9 100%);
}
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,0.06); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn-danger { color: var(--red); border-color: rgba(248,113,113,0.3); }
.btn-danger:hover { background: rgba(248,113,113,0.12); }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- Cards */
.card {
  background: linear-gradient(180deg, rgba(28,28,33,0.92), rgba(18,18,22,0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 34px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.card-pad-lg { padding: 28px; }

.section { padding: 36px 0 64px; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 24px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: clamp(26px, 3.2vw, 34px);
  letter-spacing: -0.03em;
  margin: 0;
}
.page-head p { color: var(--text-dim); margin: 4px 0 0; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 700;
  color: var(--amber);
}

/* ---------------------------------------------------------------- Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute; inset: 0 0 auto auto;
  width: 120px; height: 120px;
  background: var(--brand-soft);
  filter: blur(28px);
  opacity: .6;
  pointer-events: none;
}
.stat .label { color: var(--text-dim); font-size: 13.5px; font-weight: 500; position: relative; }
.stat .value {
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 6px;
  position: relative;
}
.stat .sub { color: var(--text-faint); font-size: 12.5px; margin-top: 2px; position: relative; }

/* ---------------------------------------------------------------- Tables */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 600;
  padding: 0 14px 12px;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 14px; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(255,255,255,0.025); }
.table .muted { color: var(--text-dim); }
.row-link { cursor: pointer; }

/* ---------------------------------------------------------------- Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  text-transform: capitalize;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gray); }
.badge.active, .badge.paid, .badge.done, .badge.published { color: var(--green); border-color: rgba(52,211,153,0.3); }
.badge.active::before, .badge.paid::before, .badge.done::before, .badge.published::before { background: var(--green); }
.badge.lead, .badge.doing, .badge.scheduled { color: var(--blue); border-color: rgba(96,165,250,0.3); }
.badge.lead::before, .badge.doing::before, .badge.scheduled::before { background: var(--blue); }
.badge.paused, .badge.unpaid, .badge.planned, .badge.todo { color: var(--amber-flag); border-color: rgba(139,139,245,0.35); }
.badge.paused::before, .badge.unpaid::before, .badge.planned::before, .badge.todo::before { background: var(--amber-flag); }
.badge.churned { color: var(--red); border-color: rgba(248,113,113,0.3); }
.badge.churned::before { background: var(--red); }
.badge.overdue { color: var(--red); border-color: rgba(248,113,113,0.3); }
.badge.overdue::before { background: var(--red); }

/* ---------------------------------------------------------------- Forms */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14.5px;
  font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.16);
}
textarea { resize: vertical; min-height: 84px; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
select option { background: var(--bg-elev); }

/* ---------------------------------------------------------------- Layout helpers */
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }
.grid-detail { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.stack > * + * { margin-top: 16px; }
.flex { display: flex; align-items: center; gap: 12px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spacer { flex: 1; }
h2.card-title { font-size: 18px; letter-spacing: -0.02em; margin: 0 0 16px; }
.subtle { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-faint);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty .big { font-size: 30px; margin-bottom: 8px; }

/* ---------------------------------------------------------------- Flash */
.flashes { position: relative; z-index: 2; }
.flash {
  max-width: var(--maxw);
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
}
.flash.success { background: rgba(52,211,153,0.1); border-color: rgba(52,211,153,0.3); color: #6ee7b7; }
.flash.error { background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.3); color: #fca5a5; }

/* ---------------------------------------------------------------- Kanban */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.col { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.col-head .count { color: var(--text-faint); font-size: 13px; }
.task {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
}
.task .title { font-size: 14.5px; font-weight: 500; }
.task .meta { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; gap: 8px; }
.task .move { display: flex; gap: 5px; }
/* Status tints: doing = light blue, done = light green (requested). */
.task.status-doing { background: rgba(96,165,250,0.12); border-color: rgba(96,165,250,0.32); }
.task.status-done { background: rgba(52,211,153,0.12); border-color: rgba(52,211,153,0.32); }
.task.status-done .title { color: #b9f3da; }
.icon-btn {
  background: transparent; border: 1px solid var(--border-strong);
  color: var(--text-dim); width: 26px; height: 26px; border-radius: 7px;
  cursor: pointer; font-size: 14px; line-height: 1; display: inline-flex;
  align-items: center; justify-content: center; padding: 0;
}
.icon-btn:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.task .note-edit { width: 100%; margin-top: 9px; font-size: 13px; min-height: 50px; padding: 8px 10px; }
.task-note {
  margin-top: 9px; font-size: 13px; color: var(--text-dim);
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; white-space: pre-wrap;
}

/* Lighter, softer done/doing badges to match the requested palette. */
.badge.done { color: #6ee7b7; background: rgba(52,211,153,0.14); border-color: rgba(52,211,153,0.34); }
.badge.doing { color: #93c5fd; background: rgba(96,165,250,0.14); border-color: rgba(96,165,250,0.34); }

/* ---------------------------------------------------------------- Tab strips */
.tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px;
  padding-bottom: 2px;
}
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--card);
  color: var(--text-dim); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .08s;
}
.tab:hover { color: var(--text); background: var(--card-2); transform: translateY(-1px); }
.tab.active { color: #1a0d04; background: var(--brand); border-color: transparent; }
.tab .pill-count {
  font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: rgba(255,255,255,0.12);
}
.tab.active .pill-count { background: rgba(0,0,0,0.16); }
.tab .pill-count.warn { background: rgba(248,113,113,0.3); color: #fff; }

/* Dashboard client tab cards */
.client-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.client-tab {
  display: block; padding: 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card);
  transition: transform .12s, border-color .12s, background .12s;
}
.client-tab:hover { transform: translateY(-2px); border-color: var(--border-strong); background: var(--card-2); }
.client-tab .ct-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.client-tab .ct-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.client-tab .ct-meta { display: flex; gap: 14px; color: var(--text-faint); font-size: 12.5px; }
.client-tab .ct-meta strong { color: var(--text-dim); }

/* ---------------------------------------------------------------- Landing */
.hero { padding: 92px 0 64px; text-align: center; position: relative; }
/* Soft dark halo behind the hero copy so it reads over bright metal,
   while the molten surface stays visible toward the edges. */
.hero::before {
  content: "";
  position: absolute;
  inset: -8% 0 -10% 0;
  background: radial-gradient(50% 42% at 50% 38%, rgba(4, 4, 7, 0.66) 22%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1, .hero .lead, .hero .hero-note { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0,0,0,0.7); }
.page-head h1, .page-head p, .eyebrow { text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55); }
.hero .pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  font-size: 13.5px; color: var(--text-dim); margin-bottom: 26px;
}
.hero .pill .dot-mini { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.hero h1 {
  font-size: clamp(40px, 7vw, 78px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 0 0 22px;
  font-weight: 700;
}
.hero h1 .grad {
  background: linear-gradient(
    100deg, #ffffff 0%, #dfe4ef 16%, #ffffff 34%, #c4cad8 50%,
    #ffffff 64%, #d4d9e6 78%, #ffffff 92%, #eef1f7 100%);
  background-size: 250% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: chrome-shine 8s linear infinite;
  filter: drop-shadow(0 2px 18px rgba(220, 228, 255, 0.18));
}
.hero p.lead {
  font-size: clamp(17px, 2.2vw, 21px);
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 34px;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { color: var(--text-faint); font-size: 13.5px; margin-top: 18px; }

.mock {
  margin: 64px auto 0;
  max-width: 960px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, var(--card), var(--bg-elev));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mock-bar { display: flex; gap: 7px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.mock-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3a40; display: block; }
.mock-body { padding: 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.mock-stat { background: var(--card-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.mock-stat .l { color: var(--text-faint); font-size: 12px; }
.mock-stat .v { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; }

.features { padding: 80px 0; }
.section-title { text-align: center; margin-bottom: 50px; }
.section-title h2 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.03em; margin: 10px 0 0; }
.section-title p { color: var(--text-dim); max-width: 560px; margin: 12px auto 0; font-size: 17px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform .15s, border-color .15s;
}
.feature:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.feature .ico {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--brand-soft);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.feature .ico svg { width: 24px; height: 24px; display: block; }
.feature h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.01em; }
.feature p { color: var(--text-dim); margin: 0; font-size: 14.5px; }

.pricing { padding: 80px 0; }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 980px; margin: 0 auto; }
.price {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  position: relative;
}
.price.featured { border-color: rgba(167,139,250,0.5); box-shadow: 0 0 0 1px rgba(167,139,250,0.25), var(--shadow); }
.price .tag {
  position: absolute; top: -11px; left: 30px;
  background: var(--brand); color: #1a0d04;
  font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px;
}
.price h3 { margin: 0 0 4px; font-size: 18px; }
.price .amt { font-size: 42px; font-weight: 700; letter-spacing: -0.03em; margin: 12px 0; }
.price .amt span { font-size: 16px; color: var(--text-faint); font-weight: 500; }
.price ul { list-style: none; padding: 0; margin: 18px 0 24px; }
.price li { color: var(--text-dim); padding: 7px 0; font-size: 14.5px; display: flex; gap: 9px; }
.price li::before { content: "✓"; color: var(--green); font-weight: 700; }

.cta-band { padding: 80px 0 100px; text-align: center; }
.cta-band .card {
  background: var(--brand-soft);
  border: 1px solid var(--border-strong);
  padding: 56px 30px;
}
.cta-band h2 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.03em; margin: 0 0 14px; }
.cta-band p { color: var(--text-dim); font-size: 18px; margin: 0 0 28px; }

.footer { border-top: 1px solid var(--border); padding: 30px 0; color: var(--text-faint); font-size: 14px; }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---------------------------------------------------------------- Auth */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 32px; }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head h1 { font-size: 26px; letter-spacing: -0.02em; margin: 14px 0 6px; }
.auth-head p { color: var(--text-dim); margin: 0; font-size: 14.5px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--text-dim); font-size: 14px; }
.auth-foot a { color: var(--amber); font-weight: 600; }

.line-items { width: 100%; border-collapse: collapse; }
.line-items td { padding: 6px 6px 6px 0; }
.line-items input { padding: 9px 11px; }
.add-row { color: var(--amber); font-weight: 600; cursor: pointer; font-size: 14px; background: none; border: none; padding: 6px 0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 14.5px; }
.kv dt { color: var(--text-faint); }
.kv dd { margin: 0; text-align: right; }

.totals { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 16px; }
.totals .row { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; }

.dialog-toggle { display: none; }
.collapse { display: none; margin-top: 16px; }
.dialog-toggle:checked ~ .collapse { display: block; }

@media (max-width: 920px) {
  .stat-grid, .mock-body { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-detail { grid-template-columns: 1fr; }
  .feature-grid, .price-grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

/* ============================================================================
   LIQUID GLASS THEME — black + chrome/iridescent, Apple-style glass panels.
   Layered at the end so it overrides the base component styles above.
   ============================================================================ */
:root {
  --iris-1: #b388ff;  /* violet */
  --iris-2: #5b8cff;  /* blue   */
  --iris-3: #57e6ff;  /* cyan   */
  --iris: linear-gradient(120deg, #b388ff, #5b8cff 38%, #57e6ff 66%, #d6b8ff);
  --glass: rgba(22, 24, 33, 0.42);
  --glass-2: rgba(30, 33, 44, 0.55);
  --glass-brd: rgba(255, 255, 255, 0.14);
  --glass-hi: rgba(255, 255, 255, 0.20);
}

html, body { background: #060608; }

/* Logo tile -> liquid chrome/iris */
.brand .dot {
  background-image: none;
  background: conic-gradient(from 210deg, #cfd6e6, #8b93ad 25%, #b388ff 55%, #57e6ff 78%, #cfd6e6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 4px 16px rgba(120,140,255,0.4);
}

/* ---- Frosted glass panels --------------------------------------------- */
.card, .stat, .feature, .price, .client-tab, .col, .empty, .mock,
.auth-card .card {
  background: var(--glass) !important;
  border: 1px solid var(--glass-brd) !important;
  backdrop-filter: blur(26px) saturate(165%);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
  box-shadow: inset 0 1px 0 var(--glass-hi),
              inset 0 0 30px rgba(255,255,255,0.03),
              0 16px 50px rgba(0,0,0,0.55) !important;
}
.feature:hover, .client-tab:hover { background: var(--glass-2) !important; }

/* Inner panels that sat on --bg-elev now read as deeper glass */
.col, .task, .totals, .kv,
.client-tab, .mock-stat {
  background: rgba(255,255,255,0.04);
}
.mock-stat, .task {
  border: 1px solid var(--glass-brd);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

/* ---- Glass buttons ---------------------------------------------------- */
.btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  color: #eef0f6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22),
              0 6px 18px rgba(0,0,0,0.4);
}
.btn:hover { background: rgba(255,255,255,0.13); }
.btn-ghost { background: rgba(255,255,255,0.03); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }

/* Primary = brighter "liquid glass" pill with an iris glow */
.btn-primary {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(214,222,240,0.62));
  border: 1px solid rgba(255,255,255,0.8);
  color: #0a0b12;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95),
              inset 0 -3px 8px rgba(120,140,255,0.16),
              0 8px 28px rgba(120,140,255,0.3);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #ffffff, rgba(226,232,246,0.72));
}

/* ---- Glass inputs ----------------------------------------------------- */
input, select, textarea {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #eef0f6;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--iris-2) !important;
  box-shadow: 0 0 0 3px rgba(91,140,255,0.22) !important;
}
select option { background: #14151c; }

/* ---- Frosted nav ------------------------------------------------------ */
.nav {
  background: rgba(8,8,11,0.5);
  backdrop-filter: saturate(180%) blur(26px);
  -webkit-backdrop-filter: saturate(180%) blur(26px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* ---- Glassy badges & tabs --------------------------------------------- */
.badge {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.06);
}
.tab {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  color: var(--text-dim);
}
.tab:hover { background: rgba(255,255,255,0.1); }
.tab.active {
  background: var(--iris);
  border-color: transparent;
  color: #0a0b12;
  box-shadow: 0 6px 20px rgba(91,140,255,0.35);
}

/* ---- Accent recolouring: amber/rose -> iridescent --------------------- */
.eyebrow { color: #aeb6d6; }
.stat::after { background: radial-gradient(circle, rgba(120,140,255,0.22), transparent 70%); }
.price.featured {
  border-color: rgba(120,140,255,0.5) !important;
  box-shadow: 0 0 0 1px rgba(120,140,255,0.3), 0 16px 50px rgba(0,0,0,0.55) !important;
}
.price .tag { background: var(--iris); color: #0a0b12; }
.feature .ico {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-brd);
}
.hero .pill { background: rgba(255,255,255,0.05); backdrop-filter: blur(14px); }
.cta-band .card { background: rgba(91,140,255,0.08) !important; }
.flash { backdrop-filter: blur(16px); }
.auth-foot a, .price li::before { color: var(--iris-3); }

/* Keep functional status colours readable on glass (doing/done unchanged) */
.badge.active, .badge.paid, .badge.done, .badge.published { color: #6ee7b7; }

/* Sculpture: bold hero on marketing pages, subtle ambient glow in the app. */
.app-bg .bg-spin {
  width: min(460px, 48vmin);
  top: 28%;
  opacity: 0.4;
}
.app-bg .bg-veil {
  background: radial-gradient(58% 46% at 50% 24%, transparent 24%, rgba(0,0,0,0.9) 92%);
}

/* ============================================================================
   GLOSSY "LIQUID GLASS" — beveled chrome rim + specular shine (tactile 3D).
   Reference: glossy aqua-style buttons. Layered last to win.
   ============================================================================ */

/* --- Buttons: glass body, chrome bevel ring, top gloss highlight --------- */
.btn {
  position: relative;
  border: 2px solid transparent !important;
  border-radius: 999px !important;
  background:
    linear-gradient(180deg, rgba(58,64,78,0.55), rgba(20,22,28,0.62)) padding-box,
    linear-gradient(180deg, #f2f5fa 0%, #aab2c4 42%, #5c6478 58%, #d2d8e4 100%) border-box !important;
  color: #eef1f7;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px) saturate(170%);
  -webkit-backdrop-filter: blur(12px) saturate(170%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.55),
    inset 0 -4px 10px rgba(0,0,0,0.42),
    0 6px 18px rgba(0,0,0,0.55) !important;
  overflow: hidden;
}
.btn::before {
  content: "";
  position: absolute;
  left: 5%; right: 5%; top: 2px;
  height: 46%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0.02));
  transform: none;
  transition: none;
  pointer-events: none;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); filter: brightness(0.97); }

/* Primary = bright light-glass like the reference's main button */
.btn-primary {
  background:
    linear-gradient(180deg, rgba(247,250,255,0.95), rgba(206,214,228,0.85)) padding-box,
    linear-gradient(180deg, #ffffff 0%, #9aa2b4 52%, #cdd3df 100%) border-box !important;
  color: #0b0c12 !important;
  text-shadow: 0 1px 0 rgba(255,255,255,0.55) !important;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.95),
    inset 0 -4px 10px rgba(120,140,200,0.22),
    0 8px 24px rgba(0,0,0,0.5) !important;
}
.btn-primary::before {
  content: "";
  position: absolute;
  left: 5%; right: 5%; top: 2px;
  height: 48%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255,255,255,0.06));
  transform: none !important;
  transition: none;
  pointer-events: none;
}
.btn-primary:hover { filter: brightness(1.04); }
.btn-primary:hover::before { transform: none !important; }

/* --- Icon buttons (kanban ‹ › ×): glossy chrome chips ------------------- */
.icon-btn {
  position: relative;
  border: 1.5px solid transparent !important;
  border-radius: 8px !important;
  background:
    linear-gradient(180deg, rgba(58,64,78,0.6), rgba(20,22,28,0.66)) padding-box,
    linear-gradient(180deg, #e8ecf4, #6a7286) border-box !important;
  color: #eef1f7 !important;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.5), 0 3px 8px rgba(0,0,0,0.5);
  overflow: hidden;
}
.icon-btn::before {
  content: "";
  position: absolute; left: 2px; right: 2px; top: 1px; height: 45%;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.03));
  pointer-events: none;
}
.icon-btn:hover { filter: brightness(1.12); }

/* --- Tabs: glossy chrome pills ----------------------------------------- */
.tab {
  position: relative;
  border: 1.5px solid transparent !important;
  background:
    linear-gradient(180deg, rgba(52,58,72,0.5), rgba(20,22,28,0.55)) padding-box,
    linear-gradient(180deg, #dfe4ee, #667084) border-box !important;
  overflow: hidden;
}
.tab::before {
  content: "";
  position: absolute; left: 6%; right: 6%; top: 1px; height: 44%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.45), rgba(255,255,255,0.02));
  pointer-events: none;
}
.tab.active {
  background:
    linear-gradient(180deg, var(--iris-1), var(--iris-2)) padding-box,
    linear-gradient(180deg, #eaf0ff, #6b7fd0) border-box !important;
  color: #0a0b12;
}

/* --- Badges: subtle gloss + bright top edge ---------------------------- */
.badge {
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 2px 6px rgba(0,0,0,0.35);
  overflow: hidden;
}

/* --- Cards/islands: add a soft top sheen so they read as glass too ------ */
.card, .stat, .feature, .price, .client-tab, .mock {
  position: relative;
}
.card::after, .stat::before, .feature::after, .client-tab::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 38%;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0));
  pointer-events: none;
  z-index: 0;
}
.card > *, .stat > *, .feature > *, .client-tab > * { position: relative; z-index: 1; }

/* ============================================================================
   STAT BOXES — glossy colour-chip icon + label + value (reference match)
   ============================================================================ */
.mock-body { grid-template-columns: repeat(2, 1fr) !important; gap: 16px !important; padding: 20px !important; }
.stat, .mock-stat { display: flex !important; align-items: center; gap: 16px; }
.mock-stat { padding: 18px; }

.stat-ic, .ms-icon {
  width: 54px; height: 54px; border-radius: 15px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55),
              inset 0 -3px 8px rgba(0,0,0,0.28),
              0 5px 16px rgba(0,0,0,0.45);
}
.stat-ic::after, .ms-icon::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0));
  pointer-events: none;
}
.stat-ic svg, .ms-icon svg { width: 26px; height: 26px; position: relative; z-index: 1; color: #fff; }
.ic-violet { background: linear-gradient(155deg, #a78bfa, #6d5cf5); }
.ic-purple { background: linear-gradient(155deg, #bf8bff, #7a4dff); }
.ic-green  { background: linear-gradient(155deg, #34d399, #0ea96b); }
.ic-blue   { background: linear-gradient(155deg, #5fa8ff, #2f74f0); }

.stat-body, .ms-txt { min-width: 0; }
.stat-body .value, .mock-stat .v { margin-top: 1px; }

/* ============================================================================
   BLADE LOGO + PALETTE FEATURE ICONS + GLOSSY 3D LIQUID BOXES
   ============================================================================ */

/* Logo = the blade sculpture */
.brand .dot {
  width: 28px; height: 28px;
  background: url("hero.png") center/contain no-repeat !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Six-tools feature icons -> page palette (glossy colour chips, white glyph) */
.feature .ico {
  border: 1px solid rgba(255,255,255,0.2) !important;
  position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55),
              inset 0 -4px 10px rgba(0,0,0,0.25),
              0 6px 18px rgba(0,0,0,0.45) !important;
}
.feature .ico::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0));
  pointer-events: none;
}
.feature .ico svg { stroke: #fff !important; color: #fff; position: relative; z-index: 1; }
.feature-grid .feature:nth-child(1) .ico { background: linear-gradient(155deg,#a78bfa,#6d5cf5); }
.feature-grid .feature:nth-child(2) .ico { background: linear-gradient(155deg,#5fa8ff,#2f74f0); }
.feature-grid .feature:nth-child(3) .ico { background: linear-gradient(155deg,#bf8bff,#7a4dff); }
.feature-grid .feature:nth-child(4) .ico { background: linear-gradient(155deg,#57e6ff,#21a7d6); }
.feature-grid .feature:nth-child(5) .ico { background: linear-gradient(155deg,#34d399,#0ea96b); }
.feature-grid .feature:nth-child(6) .ico { background: linear-gradient(155deg,#ff9bd0,#c46bff); }

/* Glossy 3D liquid boxes: convex top highlight, less frost, more shine */
.stat, .mock-stat {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.045) 32%,
                    rgba(255,255,255,0.012) 60%, rgba(255,255,255,0.06) 100%) !important;
  border: 1px solid rgba(255,255,255,0.17) !important;
  backdrop-filter: blur(5px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(5px) saturate(150%) !important;
  border-radius: 20px !important;
  box-shadow:
    inset 0 1.5px 1px rgba(255,255,255,0.6),
    inset 0 -14px 28px rgba(0,0,0,0.3),
    inset 0 0 24px rgba(160,180,255,0.04),
    0 16px 40px rgba(0,0,0,0.5) !important;
  position: relative;
  overflow: hidden;
}
/* The convex glossy reflection across the top (curved bottom edge = liquid lens) */
.stat::before, .mock-stat::before {
  content: "" !important;
  position: absolute !important;
  left: 0; right: 0; top: 0;
  height: 56% !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0.015)) !important;
  border-radius: 20px 20px 60% 60% / 20px 20px 30px 30px !important;
  pointer-events: none;
  z-index: 0 !important;
}
.stat > *, .mock-stat > * { position: relative; z-index: 1; }
.stat:hover, .mock-stat:hover { box-shadow:
    inset 0 1.5px 1px rgba(255,255,255,0.7),
    inset 0 -14px 28px rgba(0,0,0,0.3),
    0 18px 46px rgba(0,0,0,0.55) !important; }

/* Cards a touch glossier / less frosty too */
.card {
  backdrop-filter: blur(9px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(9px) saturate(150%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22),
              inset 0 -10px 26px rgba(0,0,0,0.22),
              0 16px 44px rgba(0,0,0,0.5) !important;
}

/* ============================================================================
   TRANSPARENT BUTTONS · MONOCHROME GLASS CHIPS · 4-UP PRICING
   ============================================================================ */

/* Pricing: four tiers (trial + three immediate purchases) */
.price-grid-4 {
  grid-template-columns: repeat(4, 1fr) !important;
  max-width: 1120px !important;
  gap: 14px !important;
}
.price-grid-4 .price { padding: 26px 22px; }
@media (max-width: 920px) { .price-grid-4 { grid-template-columns: 1fr 1fr !important; } }

/* Buttons: transparent glass fill (blade shows through), chrome rim + shine */
.btn {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.015)) padding-box,
    linear-gradient(180deg, #f2f5fa, #aab2c4 42%, #5c6478 58%, #d2d8e4) border-box !important;
  color: #eef1f7 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.55);
}
.btn:hover { background:
    linear-gradient(180deg, rgba(255,255,255,0.13), rgba(255,255,255,0.04)) padding-box,
    linear-gradient(180deg, #ffffff, #b6bece 42%, #6a7286 58%, #e2e7f0) border-box !important; }
.btn-primary {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.05)) padding-box,
    linear-gradient(180deg, #ffffff, #aeb6c8 52%, #dfe3ec) border-box !important;
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6) !important;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.6),
    inset 0 -4px 10px rgba(0,0,0,0.3),
    0 8px 24px rgba(0,0,0,0.45) !important;
}
.btn-primary::before { background: linear-gradient(180deg, rgba(255,255,255,0.42), rgba(255,255,255,0.02)) !important; }
.btn-primary:hover { background:
    linear-gradient(180deg, rgba(255,255,255,0.26), rgba(255,255,255,0.08)) padding-box,
    linear-gradient(180deg, #ffffff, #bcc3d2 52%, #e8ecf3) border-box !important; }

/* All the little logo chips -> black & white liquid glass (white glyphs) */
.ms-icon, .stat-ic, .feature .ico,
.ic-violet, .ic-purple, .ic-green, .ic-blue,
.feature-grid .feature:nth-child(1) .ico,
.feature-grid .feature:nth-child(2) .ico,
.feature-grid .feature:nth-child(3) .ico,
.feature-grid .feature:nth-child(4) .ico,
.feature-grid .feature:nth-child(5) .ico,
.feature-grid .feature:nth-child(6) .ico {
  background: linear-gradient(160deg, rgba(255,255,255,0.28), rgba(255,255,255,0.05) 52%, rgba(255,255,255,0.14)) !important;
  border: 1px solid rgba(255,255,255,0.30) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    inset 0 -3px 8px rgba(0,0,0,0.32),
    0 5px 16px rgba(0,0,0,0.45) !important;
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
}
.ms-icon svg, .stat-ic svg, .feature .ico svg { stroke: #fff !important; color: #fff !important; }

/* Make buttons clearly TRANSPARENT glass (soft rim, minimal gloss) */
.btn {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015)) padding-box,
    linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.38)) border-box !important;
  color: #f2f4f9 !important;
}
.btn::before { background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.01)) !important; height: 42% !important; }
.btn:hover { background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04)) padding-box,
    linear-gradient(180deg, rgba(255,255,255,0.62), rgba(255,255,255,0.16) 50%, rgba(255,255,255,0.46)) border-box !important; }
.btn-primary {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.15), rgba(255,255,255,0.04)) padding-box,
    linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.28) 50%, rgba(255,255,255,0.6)) border-box !important;
  color: #ffffff !important;
}
.btn-primary::before { background: linear-gradient(180deg, rgba(255,255,255,0.3), rgba(255,255,255,0.02)) !important; }
.btn-primary:hover { background:
    linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.07)) padding-box,
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.7)) border-box !important; }

/* ============================================================================
   PIXEL STORM CANVAS + DARK LIQUID-GLASS BUTTONS (no silver/white)
   ============================================================================ */
.bg-storm {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* All buttons -> dark translucent liquid glass, no chrome/silver fill */
.btn, .btn-primary, .btn-ghost {
  border: 1px solid rgba(255,255,255,0.16) !important;
  background: rgba(255,255,255,0.055) !important;
  color: #eef1f7 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.55) !important;
  backdrop-filter: blur(16px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(160%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22),
              inset 0 -6px 16px rgba(0,0,0,0.32),
              0 6px 20px rgba(0,0,0,0.5) !important;
}
.btn::before {
  background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0)) !important;
  height: 44% !important;
}
.btn:hover { background: rgba(255,255,255,0.11) !important; }

/* Primary = same glass with a faint iridescent tint so it still reads as CTA */
.btn-primary {
  background: linear-gradient(180deg, rgba(140,150,255,0.22), rgba(120,130,235,0.10)) !important;
  border-color: rgba(160,175,255,0.42) !important;
  color: #ffffff !important;
}
.btn-primary::before {
  background: linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0)) !important;
  transform: none !important;
}
.btn-primary:hover {
  background: linear-gradient(180deg, rgba(150,160,255,0.3), rgba(130,140,240,0.14)) !important;
}

/* Inline button icons + empty-state glyphs (custom, replacing emojis) */
.btn .bi { width: 18px; height: 18px; flex: 0 0 auto; }
.empty .big { line-height: 1; }
.empty .big .bi-lg { width: 38px; height: 38px; opacity: 0.55; }

/* ============================================================================
   BUTTONS -> clean dark frosted pill (like the hero pill) + full-screen blade
   ============================================================================ */
.btn, .btn-primary, .btn-ghost {
  border: 1px solid rgba(255,255,255,0.14) !important;
  background: rgba(20, 21, 26, 0.55) !important;
  color: #e9ebf1 !important;
  text-shadow: none !important;
  backdrop-filter: blur(16px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(135%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 16px rgba(0,0,0,0.42) !important;
}
.btn::before, .btn-primary::before { display: none !important; content: none !important; }
.btn:hover, .btn-ghost:hover { background: rgba(34, 36, 44, 0.62) !important; }
.btn-primary {
  background: rgba(30, 32, 40, 0.6) !important;
  border-color: rgba(255,255,255,0.22) !important;
  color: #ffffff !important;
}
.btn-primary:hover { background: rgba(42, 44, 54, 0.66) !important; }

/* Blade fills the whole screen */
.bg-spin {
  width: min(1700px, 138vmin) !important; top: 50% !important;
  /* Pop above the pixel storm: richer colour + a soft glow halo. */
  filter: saturate(1.25) contrast(1.08)
          drop-shadow(0 0 50px rgba(120,140,255,0.32)) !important;
}

/* ============================================================================
   LANDING PRODUCT DEMO — looping tour of the real CRM views
   ============================================================================ */
.mock-url { margin-left: 12px; font-size: 12.5px; color: var(--text-faint); }
.demo { padding: 14px 16px 18px; }
.demo-tabs { display: flex; gap: 6px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.demo-tab {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-dim);
  font-size: 13px; font-weight: 600;
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  font-family: var(--font);
  transition: background .2s, color .2s, border-color .2s;
}
.demo-tab:hover { color: var(--text); }
.demo-tab.active { background: rgba(255,255,255,0.13); color: #fff; border-color: rgba(255,255,255,0.26); }
.demo-prog { margin-left: auto; width: 56px; height: 3px; border-radius: 99px; background: rgba(255,255,255,0.1); overflow: hidden; }
.demo-prog-bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a78bfa, #5b8cff); }

.demo-stage { position: relative; min-height: 272px; }
.demo-panel {
  position: absolute; inset: 0;
  opacity: 0; transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease;
  pointer-events: none;
}
.demo-panel.active { opacity: 1; transform: none; pointer-events: auto; }

.demo-table { width: 100%; }
.demo-table th { padding: 0 12px 10px; }
.demo-table td { padding: 10px 12px; font-size: 13.5px; }
.demo-board { gap: 10px; }
.demo-board .col { padding: 11px; }
.demo-board .task { padding: 9px 11px; margin-bottom: 8px; }
.demo-board .task .title { font-size: 13px; }
@media (max-width: 720px) { .demo-stage { min-height: 320px; } }

/* "in one place" -> identical chrome treatment as the Studioflow wordmark */
.hero h1 .grad {
  background: linear-gradient(
    100deg, #f6f7fb 0%, #a9afc0 16%, #ffffff 32%, #8b91a4 46%,
    #e6e9f1 60%, #9aa0b2 74%, #ffffff 88%, #c2c7d4 100%) !important;
  background-size: 250% auto !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  animation: chrome-shine 7s linear infinite !important;
  filter: none !important;
}

/* "in one place" -> bright FLOWING chrome (no dark stops that read as black) */
.hero h1 .grad {
  background: linear-gradient(
    100deg,
    #ffffff 0%, #d6dcec 11%, #ffffff 24%, #c8d0e6 37%, #ffffff 50%,
    #cdd4ea 63%, #ffffff 76%, #dde3f2 88%, #ffffff 100%) !important;
  background-size: 220% auto !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  animation: chrome-shine 5s linear infinite !important;
  filter: drop-shadow(0 1px 10px rgba(190, 205, 255, 0.35)) !important;
}

/* Pop the hero copy off the bright blade + brighter flowing chrome */
.hero::before {
  background: radial-gradient(56% 48% at 50% 36%, rgba(3,3,6,0.86) 32%, transparent 76%) !important;
}
.hero h1 .grad {
  background: linear-gradient(
    100deg,
    #ffffff 0%, #eaeef7 13%, #ffffff 27%, #dfe5f1 41%, #ffffff 55%,
    #e6ebf5 69%, #ffffff 83%, #f0f3fa 100%) !important;
  background-size: 220% auto !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  animation: chrome-shine 5s linear infinite !important;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.7)) !important;
}

/* Bright silver base + sweeping white glare = flowing chrome that never reads dark */
.hero h1 .grad {
  background: linear-gradient(
    100deg,
    #e9edf6 0%, #ffffff 18%, #eef2f9 32%, #e6ebf5 50%,
    #ffffff 68%, #eef2f9 82%, #e9edf6 100%) !important;
  background-size: 260% auto !important;
  animation: chrome-shine 4.5s linear infinite !important;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.7)) !important;
}

/* Fix: use background-image (shorthand reset the text clip) for the chrome */
.hero h1 .grad {
  background-image: linear-gradient(
    100deg,
    #e9edf6 0%, #ffffff 18%, #eef2f9 32%, #e6ebf5 50%,
    #ffffff 68%, #eef2f9 82%, #e9edf6 100%) !important;
  background-size: 260% auto !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  animation: chrome-shine 4.5s linear infinite !important;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.6)) !important;
}

/* Tabs -> dark liquid glass to match the buttons (drop the old chrome look) */
.tab {
  background: rgba(255,255,255,0.055) !important;
  border: 1px solid rgba(255,255,255,0.16) !important;
  color: #eef1f7 !important;
  backdrop-filter: blur(16px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(160%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 4px 14px rgba(0,0,0,0.4) !important;
}
.tab::before { display: none !important; content: none !important; }
.tab:hover { background: rgba(255,255,255,0.11) !important; }
.tab.active {
  background: linear-gradient(180deg, rgba(140,150,255,0.24), rgba(120,130,235,0.10)) !important;
  border-color: rgba(160,175,255,0.45) !important;
  color: #ffffff !important;
}

/* Dashboard stat grid flexes to fit 5 tiles responsively */
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)) !important; }

/* Contextual revenue summary on the Clients page */
.summary-pill {
  display: inline-flex; align-items: baseline; gap: 12px;
  padding: 10px 18px; border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
}
.summary-pill .summary-label { color: var(--text-dim); font-size: 13px; font-weight: 600; }
.summary-pill .summary-value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }

/* Fit 5 stat tiles cleanly — smaller value + icon so figures don't clip */
.stat .value { font-size: clamp(20px, 2.3vw, 27px) !important; }
.stat .stat-ic { width: 46px; height: 46px; border-radius: 13px; }
.stat .stat-ic svg { width: 22px; height: 22px; }
.stat { gap: 13px; padding: 18px; }

/* Inline status select in the clients table (editable status pill) */
.row-status {
  width: auto !important;
  padding: 5px 11px !important;
  font-size: 12.5px !important;
  font-weight: 600;
  border-radius: 999px !important;
  cursor: pointer;
  text-transform: capitalize;
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.16) !important;
}
.row-status.status-active  { color:#6ee7b7; border-color: rgba(52,211,153,0.34) !important; }
.row-status.status-lead    { color:#93c5fd; border-color: rgba(96,165,250,0.34) !important; }
.row-status.status-paused  { color:#c9c9ff; border-color: rgba(251,191,36,0.34) !important; }
.row-status.status-churned { color:#fca5a5; border-color: rgba(248,113,113,0.34) !important; }
.row-status option { background:#14151c; color:#eef1f7; }

/* ============================================================================
   THEME TOGGLE + CHAT + CAROUSEL + LIGHT THEME
   ============================================================================ */
.theme-toggle {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.05);
  color: #eef1f7; cursor: pointer; font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  backdrop-filter: blur(14px);
}
.theme-toggle:hover { background: rgba(255,255,255,0.11); }
.theme-toggle .th-moon { display: none; }

/* --- Chat --- */
.chat-log { display: flex; flex-direction: column; gap: 12px; max-height: 54vh; overflow-y: auto; padding: 4px 2px 12px; }
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-bubble { max-width: 80%; padding: 11px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; }
.chat-msg.user .chat-bubble { background: linear-gradient(180deg, rgba(140,150,255,0.3), rgba(120,130,235,0.16)); border: 1px solid rgba(160,175,255,0.4); border-bottom-right-radius: 5px; }
.chat-msg.assistant .chat-bubble { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); border-bottom-left-radius: 5px; }
.chat-input { display: flex; gap: 10px; margin-top: 14px; }
.chat-input input { flex: 1; }

/* --- Carousel slides --- */
.carousel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.slide-card {
  aspect-ratio: 4 / 5; border-radius: 18px; padding: 20px;
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, rgba(140,120,255,0.18), rgba(90,130,255,0.10));
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 10px 30px rgba(0,0,0,0.4);
}
.slide-num { position: absolute; top: 12px; right: 14px; font-size: 12px; color: var(--text-faint); font-weight: 700; }
.slide-headline { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.slide-body { font-size: 13.5px; color: var(--text-dim); line-height: 1.45; }

/* ============================================================================
   LIGHT THEME — html[data-theme="light"]
   ============================================================================ */
html[data-theme="light"], html[data-theme="light"] body { background: #eceef4 !important; color: #1a1c24; }
html[data-theme="light"] .bg-fx { background: #eceef4 !important; }
html[data-theme="light"] .bg-spin {
  opacity: 0.55 !important;
  /* On white the chrome needs contrast + a dark halo to read. */
  filter: saturate(1.3) contrast(1.18)
          drop-shadow(0 0 46px rgba(60,70,140,0.28)) !important;
}
html[data-theme="light"] .bg-storm { opacity: 0 !important; }
html[data-theme="light"] .bg-veil { background: radial-gradient(82% 72% at 50% 40%, transparent 28%, rgba(236,238,244,0.7) 100%) !important; }

html[data-theme="light"] .nav { background: rgba(255,255,255,0.72) !important; border-bottom: 1px solid rgba(0,0,0,0.08) !important; }
html[data-theme="light"] .nav-links a { color: #41475a; }
html[data-theme="light"] .nav-links a:hover, html[data-theme="light"] .nav-links a.active { color: #0c0e14; background: rgba(0,0,0,0.05); }
html[data-theme="light"] .nav-agency { color: #6b7180; }
html[data-theme="light"] .brand .name { background: none !important; -webkit-text-fill-color: #14161e !important; color: #14161e !important; }
html[data-theme="light"] .theme-toggle { color: #1a1c24; background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.14); }
html[data-theme="light"] .theme-toggle .th-sun { display: none; }
html[data-theme="light"] .theme-toggle .th-moon { display: inline; }

html[data-theme="light"] .card, html[data-theme="light"] .stat, html[data-theme="light"] .feature,
html[data-theme="light"] .price, html[data-theme="light"] .client-tab, html[data-theme="light"] .col,
html[data-theme="light"] .empty, html[data-theme="light"] .mock, html[data-theme="light"] .summary-pill,
html[data-theme="light"] .chat-bubble.assistant, html[data-theme="light"] .task,
html[data-theme="light"] .auth-card .card {
  background: rgba(255,255,255,0.82) !important;
  border-color: rgba(0,0,0,0.08) !important;
  color: #1a1c24;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 10px 28px rgba(40,55,100,0.08) !important;
}
html[data-theme="light"] h1, html[data-theme="light"] h2, html[data-theme="light"] h3,
html[data-theme="light"] .card-title, html[data-theme="light"] strong,
html[data-theme="light"] .value, html[data-theme="light"] .stat .value,
html[data-theme="light"] .page-head h1, html[data-theme="light"] .v, html[data-theme="light"] .slide-headline {
  color: #14161e;
}
html[data-theme="light"] .subtle, html[data-theme="light"] .muted, html[data-theme="light"] .faint,
html[data-theme="light"] .label, html[data-theme="light"] .sub, html[data-theme="light"] .page-head p,
html[data-theme="light"] .l, html[data-theme="light"] .slide-body, html[data-theme="light"] .nav-agency {
  color: #5b6273 !important;
}
html[data-theme="light"] .table th { color: #7a8092; border-color: rgba(0,0,0,0.08); }
html[data-theme="light"] .table td { border-color: rgba(0,0,0,0.07); }
html[data-theme="light"] .table tbody tr:hover { background: rgba(0,0,0,0.025); }
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] textarea {
  background: rgba(255,255,255,0.92) !important; border-color: rgba(0,0,0,0.14) !important; color: #1a1c24;
}
html[data-theme="light"] select option { background: #ffffff; color: #1a1c24; }
html[data-theme="light"] .btn, html[data-theme="light"] .btn-ghost, html[data-theme="light"] .tab {
  background: rgba(255,255,255,0.85) !important; border: 1px solid rgba(0,0,0,0.12) !important;
  color: #1a1c24 !important; text-shadow: none !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 3px 10px rgba(40,55,100,0.1) !important;
}
html[data-theme="light"] .btn:hover, html[data-theme="light"] .tab:hover { background: rgba(255,255,255,0.95) !important; }
html[data-theme="light"] .btn-primary, html[data-theme="light"] .tab.active {
  background: linear-gradient(180deg, #7c8cff, #5b6ef0) !important;
  border-color: rgba(91,110,240,0.5) !important; color: #ffffff !important;
}
html[data-theme="light"] .eyebrow { color: #6b5bd6; }
html[data-theme="light"] .empty { border-style: dashed; border-color: rgba(0,0,0,0.14) !important; }
html[data-theme="light"] .slide-card { background: linear-gradient(150deg, rgba(124,140,255,0.16), rgba(91,140,255,0.08)); border-color: rgba(0,0,0,0.08); }

/* ============================================================================
   LEFT VERTICAL SIDEBAR — app nav as a fixed column (logged-in pages).
   Below 921px it falls back to the horizontal top bar.
   ============================================================================ */
/* Shared nav-icon + footer-link styling (rail and mobile bar). */
.nav .ic { width: 19px; height: 19px; flex: 0 0 auto; }
.nav-links a { display: inline-flex; align-items: center; gap: 9px; }
.navfoot { display: inline-flex; align-items: center; gap: 9px; padding: 8px 12px;
  border-radius: 10px; color: var(--text-dim); font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s; }
.navfoot:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.navfoot.active { background: rgba(255,255,255,0.08); color: var(--text); }

:root { --sb-w: 74px; --sb-expanded: 252px; }   /* collapsed rail / hover-expanded */

@media (min-width: 921px) {
  .has-sidebar { padding-left: var(--sb-w); }

  /* Collapsed icon rail that expands on hover (content stays put; nav overlays). */
  .has-sidebar .nav {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sb-w);
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,0.08);
    overflow-x: hidden; overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 60;
    background: rgba(9,9,12,0.92);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    transition: width .22s cubic-bezier(.4,0,.2,1), box-shadow .22s;
  }
  .has-sidebar .nav:hover {
    width: var(--sb-expanded);
    box-shadow: 22px 0 60px rgba(0,0,0,0.5);
  }
  .has-sidebar .nav-inner {
    flex-direction: column; align-items: stretch;
    height: 100%; max-width: none; margin: 0;
    padding: 16px 12px; gap: 3px;
  }

  /* Labels collapse to nothing, reveal on hover. */
  .has-sidebar .nav .lbl,
  .has-sidebar .brand .name,
  .has-sidebar .nav-agency {
    max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap;
    transition: max-width .22s cubic-bezier(.4,0,.2,1), opacity .16s;
  }
  .has-sidebar .nav:hover .lbl,
  .has-sidebar .nav:hover .brand .name,
  .has-sidebar .nav:hover .nav-agency { max-width: 180px; opacity: 1; }

  .has-sidebar .brand { justify-content: center; gap: 12px; margin: 4px 0 16px; font-size: 20px; }
  .has-sidebar .nav:hover .brand { justify-content: flex-start; padding-left: 10px; }

  .has-sidebar .nav-links { flex-direction: column; gap: 3px; width: 100%; margin: 0; }
  .has-sidebar .nav-links a, .has-sidebar .navfoot {
    justify-content: center; gap: 13px; width: 100%;
    padding: 11px; border-radius: 11px; font-size: 14.5px;
  }
  .has-sidebar .nav:hover .nav-links a,
  .has-sidebar .nav:hover .navfoot { justify-content: flex-start; padding-left: 15px; }
  .has-sidebar .nav .ic { width: 21px; height: 21px; }
  .has-sidebar .nav-links a.active {
    background: var(--iris); color: #0a0b12; font-weight: 600;
    box-shadow: 0 6px 18px rgba(91,140,255,0.3);
  }

  .has-sidebar .nav-right {
    margin-top: auto; flex-direction: column; align-items: stretch;
    gap: 3px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.07);
  }
  .has-sidebar .nav-agency {
    order: -1; padding: 2px 12px 8px; font-size: 12.5px; font-weight: 600; color: var(--text-dim);
  }
  .has-sidebar .theme-toggle { align-self: center; margin-top: 4px; }
  .has-sidebar .nav:hover .theme-toggle { align-self: flex-start; margin-left: 6px; }

  /* Sculpture glow follows the offset content area, not the full viewport. */
  .has-sidebar.app-bg .bg-spin { left: calc(50% + (var(--sb-w) / 2)); }
}

html[data-theme="light"] .has-sidebar .nav {
  background: rgba(255,255,255,0.95);
  border-right-color: rgba(0,0,0,0.08);
}

/* Mobile: keep links reachable as a wrapping top bar instead of hiding them. */
@media (max-width: 920px) {
  .has-sidebar .nav-links { display: flex; }
}

/* ============================================================================
   DAY MODE FIXES — keep every glyph, logo chip and hero element legible on the
   light background (icons were white-on-white; hero chrome read as invisible).
   Appended last so it wins over the dark liquid-glass overrides above.
   ============================================================================ */

/* Logo / stat chips: solid indigo tile with white glyphs (was frosted-white).
   The .feature-grid .feature selectors carry extra specificity so they beat the
   dark-mode `.feature-grid .feature:nth-child(n) .ico` rule (0,4,0). */
html[data-theme="light"] .ms-icon,
html[data-theme="light"] .stat-ic,
html[data-theme="light"] .feature-grid .feature .ico,
html[data-theme="light"] .ic-violet,
html[data-theme="light"] .ic-purple,
html[data-theme="light"] .ic-green,
html[data-theme="light"] .ic-blue {
  background: linear-gradient(160deg, #8a93ff, #5b6ef0) !important;
  border: 1px solid rgba(91,110,240,0.45) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55),
              0 6px 16px rgba(91,110,240,0.26) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html[data-theme="light"] .ms-icon svg,
html[data-theme="light"] .stat-ic svg,
html[data-theme="light"] .feature-grid .feature .ico svg,
html[data-theme="light"] .feature-grid .feature .ico svg * {
  stroke: #fff !important; color: #fff !important;
}

/* Brand wordmark: solid dark (inverted from the chrome gradient) for daytime. */
html[data-theme="light"] .brand .name {
  background: none !important;
  -webkit-text-fill-color: #14161e !important;
  color: #14161e !important;
  animation: none !important;
}

/* Hero: dark headline, no heavy dark shadows, light vignette. */
html[data-theme="light"] .hero h1 { color: #14161e; }
html[data-theme="light"] .hero h1,
html[data-theme="light"] .hero .lead,
html[data-theme="light"] .hero .hero-note,
html[data-theme="light"] .eyebrow,
html[data-theme="light"] .page-head h1,
html[data-theme="light"] .page-head p { text-shadow: none !important; }
html[data-theme="light"] .hero .lead { color: #41475a !important; }
html[data-theme="light"] .hero .hero-note { color: #6b7180 !important; }
html[data-theme="light"] .hero .pill {
  background: rgba(255,255,255,0.72) !important;
  border-color: rgba(0,0,0,0.1) !important;
  color: #41475a !important;
}
html[data-theme="light"] .hero::before {
  background: radial-gradient(56% 48% at 50% 36%, rgba(255,255,255,0.72) 30%, transparent 78%) !important;
}

/* Hero "in one place" chrome -> flowing indigo so it pops on white. */
html[data-theme="light"] .hero h1 .grad {
  background: none !important;
  background-image: linear-gradient(
    100deg, #7c3aed 0%, #5b6ef0 24%, #4f46e5 50%,
    #5b6ef0 76%, #7c3aed 100%) !important;
  background-size: 220% auto !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  filter: none !important;
  animation: chrome-shine 5s linear infinite !important;
}

/* ============================================================================
   FLATTEN — drop the glossy "shiny bubble" treatment on filter tabs + status
   selects, and the heavy floating drop-shadow on stat tiles (per request).
   Appended last so it wins.
   ============================================================================ */

/* Filter tabs: flat pills — no chrome bevel ring, no top sheen. */
.tab {
  border: 1px solid var(--glass-brd) !important;
  background: rgba(255,255,255,0.06) !important;
  overflow: visible !important;
  box-shadow: none !important;
}
.tab::before { display: none !important; }
.tab:hover { background: rgba(255,255,255,0.12) !important; transform: none !important; }
.tab.active {
  background: var(--iris) !important;
  border-color: transparent !important;
  color: #0a0b12 !important;
  box-shadow: none !important;
}
html[data-theme="light"] .tab {
  background: rgba(0,0,0,0.04) !important;
  border-color: rgba(0,0,0,0.12) !important;
}
html[data-theme="light"] .tab.active {
  background: linear-gradient(180deg,#7c8cff,#5b6ef0) !important;
  color: #fff !important;
}

/* Status selects: flat pill — no native/glossy chrome, slim custom caret. */
.row-status {
  -webkit-appearance: none !important;
  appearance: none !important;
  background: rgba(255,255,255,0.06) !important;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%239aa0b2' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 9px center !important;
  padding-right: 24px !important;
  box-shadow: none !important;
}
html[data-theme="light"] .row-status {
  background-color: rgba(0,0,0,0.04) !important;
  border-color: rgba(0,0,0,0.14) !important;
}

/* Stat / mock-stat tiles: kill the floating drop shadow + glossy bubble sheen. */
.stat, .mock-stat {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16) !important;
}
.stat::before, .mock-stat::before { display: none !important; }
.stat:hover, .mock-stat:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,0.16) !important; }
html[data-theme="light"] .stat, html[data-theme="light"] .mock-stat {
  box-shadow: none !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
}

/* ============================================================================
   DE-GLOSS ALL FORM CONTROLS — no native/chrome "bubble" on any select / input
   / textarea anywhere in the CRM. Flat fields + a slim custom caret on selects.
   ============================================================================ */
select, input, textarea, option {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-image: none !important;
  box-shadow: none !important;
  border-radius: 10px !important;
  font-family: inherit !important;   /* fix browser-default serif on <option> lists */
}
select {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 9 6'%3E%3Cpath d='M1 1l3.5 3.5L8 1' stroke='%239aa0b2' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 30px !important;
}
/* The pill-shaped inline status select keeps its rounded shape + tighter caret. */
.row-status { border-radius: 999px !important; background-position: right 9px center !important; padding-right: 24px !important; }
html[data-theme="light"] select {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 9 6'%3E%3Cpath d='M1 1l3.5 3.5L8 1' stroke='%236b7180' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}

/* ---- Big month calendar grid ------------------------------------------ */
.cal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.cal-title { margin: 0; font-size: 20px; letter-spacing: -0.02em; min-width: 170px; text-align: center; }
.cal-nav {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--glass-brd); color: var(--text); font-size: 20px; line-height: 1;
}
.cal-nav:hover { background: rgba(255,255,255,0.08); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; padding-bottom: 4px; }
.cal-cell {
  min-height: 104px; border: 1px solid var(--glass-brd); border-radius: 10px;
  padding: 6px; background: rgba(255,255,255,0.02); overflow: hidden;
  display: flex; flex-direction: column; gap: 4px;
}
.cal-cell.out { opacity: 0.4; }
.cal-cell.today { border-color: var(--iris-2); box-shadow: inset 0 0 0 1px var(--iris-2); }
.cal-daynum { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.cal-cell.today .cal-daynum { color: var(--iris-2); }
.cal-chip {
  font-size: 11.5px; line-height: 1.25; padding: 3px 7px; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 3px solid var(--chip-color, #888); background: rgba(255,255,255,0.06); cursor: default;
}
.cal-chip.planned   { --chip-color: #8b8bf5; }
.cal-chip.scheduled { --chip-color: #5b8cff; }
.cal-chip.published { --chip-color: #34d399; }
.cal-chip.is-reel   { border-left-style: dashed; }
.cal-legend { display: flex; gap: 16px; margin-top: 14px; font-size: 12px; color: var(--text-dim); }
.cal-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .lg::before { content: ""; width: 9px; height: 9px; border-radius: 50%; }
.cal-legend .lg.planned::before   { background: #8b8bf5; }
.cal-legend .lg.scheduled::before { background: #5b8cff; }
.cal-legend .lg.published::before { background: #34d399; }
html[data-theme="light"] .cal-cell { background: rgba(0,0,0,0.015); border-color: rgba(0,0,0,0.08); }
html[data-theme="light"] .cal-chip { background: rgba(0,0,0,0.04); }
@media (max-width: 720px) {
  .cal-cell { min-height: 64px; }
  .cal-chip-name { display: none; }
  .cal-chip { padding: 4px; }
}

/* ---- Per-month reel slots (project detail) ---------------------------- */
.reel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.reel-slot {
  border: 1px solid var(--glass-brd);
  border-left: 3px solid var(--stage-color, rgba(255,255,255,0.2));
  border-radius: 14px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  display: flex; flex-direction: column; gap: 4px;
}
.reel-slot.filled { background: rgba(52,211,153,0.06); }
.reel-head { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.reel-num {
  width: 24px; height: 24px; flex: 0 0 auto; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; color: #fff;
  background: linear-gradient(160deg, #8a93ff, #5b6ef0);
}
.reel-name { font-weight: 600; font-size: 14px; }
.editor-note { font-size: 13px; background: rgba(251,191,36,0.1); border-left: 3px solid #c9c9ff; border-radius: 6px; padding: 7px 10px; line-height: 1.4; }
html[data-theme="light"] .editor-note { background: rgba(251,191,36,0.14); }
.reel-stage-dot { width: 10px; height: 10px; border-radius: 50%; margin-left: auto; background: var(--stage-color, #888); }
.reel-lbl { font-size: 11px; color: var(--text-faint); margin-top: 7px; text-transform: uppercase; letter-spacing: .04em; }
.reel-row { display: flex; gap: 10px; }
.reel-slot input, .reel-slot textarea, .reel-slot select { width: 100%; font-size: 13px; padding: 7px 10px !important; }
.reel-slot textarea { resize: vertical; min-height: 42px; }
.reel-stage-sel { font-weight: 600; }

/* Notion-style coloured options + the closed select shown as a coloured tag.
   JS sets data-val on each .reel-stage-sel/.reel-posted-sel; we tint to match. */
option.opt-not-started, option.opt-not-posted       { color: #9aa0b2; }
option.opt-script                                    { color: #8b8bf5; }
option.opt-filmed                                    { color: #ec6ea0; }
option.opt-edits-in-progress, option.opt-scheduled   { color: #c9c9ff; }
option.opt-edited                                    { color: #a78bfa; }
option.opt-done                                      { color: #5b8cff; }
option.opt-approved, option.opt-posted               { color: #34d399; }
option.opt-needs-refilm                              { color: #f87171; }
option.opt-waiting-on-client                         { color: #9aa0b2; }

.reel-stage-sel, .reel-posted-sel {
  border-color: var(--tag-color, var(--glass-brd)) !important;
  color: var(--tag-color, var(--text)) !important;
  background-color: color-mix(in srgb, var(--tag-color, #888) 14%, transparent) !important;
  font-weight: 600;
}
html[data-theme="light"] .reel-slot { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.08); }
html[data-theme="light"] .reel-slot.filled { background: rgba(52,211,153,0.08); }

/* Stage accent colours (match the Notion Reels stages). */
.stage-not-started      { --stage-color: #8b91a4; }
.stage-script           { --stage-color: #8b8bf5; }
.stage-filmed           { --stage-color: #ec6ea0; }
.stage-edits-in-progress{ --stage-color: #c9c9ff; }
.stage-edited           { --stage-color: #a78bfa; }
.stage-done             { --stage-color: #5b8cff; }
.stage-approved         { --stage-color: #34d399; }
.stage-needs-refilm     { --stage-color: #f87171; }
.stage-waiting-on-client{ --stage-color: #9aa0b2; }

/* ============================================================================
   POLISHED CRM BACKGROUND — smooth deep-charcoal with soft ambient glows
   (original violet/iris palette, Zentra-style depth). Logged-in app pages only;
   the marketing front page is intentionally left untouched.
   ============================================================================ */
.app-bg {
  background:
    radial-gradient(58% 48% at 84% -6%, rgba(150,130,230,0.13), transparent 60%),
    radial-gradient(52% 48% at -6% 106%, rgba(90,140,255,0.09), transparent 55%),
    radial-gradient(130% 100% at 50% 42%, #0d0d13 0%, #09090e 56%, #050507 100%)
    !important;
}

/* The chrome blade becomes faint, blurred ambient light — no hard "blocky" shape. */
.app-bg .bg-fx { background-color: transparent !important; }
.app-bg .bg-spin {
  opacity: 0.10 !important;
  filter: blur(3px) saturate(120%) brightness(1.05);
  width: min(640px, 62vmin) !important;
}
.app-bg .bg-veil {
  background: radial-gradient(100% 88% at 50% -16%, transparent 46%, rgba(0,0,0,0.5) 100%) !important;
}

/* Kill the "blocky" feel: finer borders, gentler radius + a soft single lift shadow. */
.app-bg .card, .app-bg .stat, .app-bg .mock-stat, .app-bg .feature, .app-bg .col,
.app-bg .reel-slot, .app-bg .cal-cell, .app-bg .summary-pill,
.app-bg .empty, .app-bg .client-tab, .app-bg .price, .app-bg .auth-card .card {
  border: 1px solid rgba(255,255,255,0.065) !important;
  border-radius: 16px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 12px 34px rgba(0,0,0,0.4) !important;
}
.app-bg .table { border-radius: 16px !important; }

/* Day mode: a smooth light canvas instead of flat grey. */
html[data-theme="light"] .app-bg {
  background:
    radial-gradient(58% 48% at 84% -6%, rgba(150,130,230,0.10), transparent 60%),
    radial-gradient(130% 100% at 50% 45%, #f4f5f9 0%, #ecedf3 62%, #e6e8ef 100%)
    !important;
}
html[data-theme="light"] .app-bg .card, html[data-theme="light"] .app-bg .stat,
html[data-theme="light"] .app-bg .col, html[data-theme="light"] .app-bg .reel-slot,
html[data-theme="light"] .app-bg .cal-cell, html[data-theme="light"] .app-bg .summary-pill {
  border-color: rgba(0,0,0,0.07) !important;
  box-shadow: 0 10px 28px rgba(40,55,100,0.07) !important;
}
/* let the smooth light gradient show (the bg layer + blade otherwise cover it) */
html[data-theme="light"] .app-bg .bg-fx { background: transparent !important; }
html[data-theme="light"] .app-bg .bg-spin { opacity: 0.10 !important; }

/* ============================================================================
   LANDING SCROLL FX — reveal-on-scroll, parallax layers, product-mock reveal.
   Driven by static/scroll.js. Respects reduced-motion.
   ============================================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1);
}
[data-reveal].in { opacity: 1; transform: none; }

.mock-wrap { will-change: transform; }

/* The product mockup sits tilted on a 3D plane, then rises flat + scales up
   as you scroll into it (JS drives --mock-rx / --mock-sc). */
.hero .mock {
  transform: perspective(1700px) rotateX(var(--mock-rx, 14deg)) scale(var(--mock-sc, 0.9));
  transform-origin: center top;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hero .mock { transform: none !important; }
}

/* Lenis smooth scroll (marketing pages) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* ============================================================================
   ZENTRA SKIN — emerald-glass CRM look for the logged-in app.
   Reference: the Zentra finance dashboard (dark, flat, emerald accents, clean
   KPI cards). Scoped to `body.app-bg` so the marketing site keeps its iris /
   liquid-chrome identity untouched. Appended last so it wins by source order.

   Most of this is one move: the whole app is driven by the --iris accent
   tokens, so remapping them to emerald recolours the active nav item, tabs,
   focus rings, the brand chip and more in a single stroke. Everything below is
   the targeted polish on top (flat canvas, softer cards, KPI sparklines, an
   emerald hero stat, a persistent labelled sidebar).
   ============================================================================ */
body.app-bg {
  --iris-1: #34d399;
  --iris-2: #10b981;
  --iris-3: #6ee7b7;
  --iris:   linear-gradient(120deg, #34d399 0%, #10b981 55%, #059669 100%);
  --green:  #34d399;
  --brand:  linear-gradient(120deg, #34d399 0%, #10b981 55%, #059669 100%);
  --brand-soft: linear-gradient(120deg, rgba(52,211,153,0.16), rgba(16,185,129,0.16));
}

/* --- Flat near-black canvas: drop the rotating sculpture, keep one soft
       emerald wash at the top like the reference ------------------------- */
body.app-bg .bg-fx   { background: #07090b; }
body.app-bg .bg-spin { display: none; }
body.app-bg .bg-storm { opacity: 0.28; }
body.app-bg .bg-veil {
  background:
    radial-gradient(58% 42% at 50% -6%, rgba(16,185,129,0.16), transparent 62%),
    radial-gradient(120% 90% at 50% 50%, transparent 38%, rgba(0,0,0,0.86) 100%);
}

/* --- Cards: calmer, flatter glass than the chrome marketing cards ------- */
body.app-bg .card,
body.app-bg .stat {
  background: linear-gradient(180deg, rgba(20,24,27,0.78), rgba(12,15,17,0.82)) !important;
  border: 1px solid rgba(255,255,255,0.065) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04),
              0 18px 48px rgba(0,0,0,0.5) !important;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}
/* Tone down the bright top sheen — Zentra cards read matte, not glossy. */
body.app-bg .card::after,
body.app-bg .stat::before { opacity: 0.4; }
body.app-bg .card:hover { border-color: rgba(52,211,153,0.18) !important; }

/* --- Accent recolouring for the bits with hard-coded blue glows --------- */
body.app-bg .eyebrow { color: #34d399 !important; }
body.app-bg .brand .dot {
  background: conic-gradient(from 210deg, #6ee7b7, #10b981 40%, #34d399 72%, #6ee7b7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 4px 16px rgba(16,185,129,0.45);
}
body.app-bg input:focus,
body.app-bg select:focus,
body.app-bg textarea:focus {
  border-color: #34d399 !important;
  box-shadow: 0 0 0 3px rgba(52,211,153,0.22) !important;
}
body.app-bg .tab.active { box-shadow: 0 6px 20px rgba(16,185,129,0.32); }

/* --- Primary button = solid emerald pill (the reference's "New payment") - */
body.app-bg .btn-primary {
  background:
    linear-gradient(180deg, #34d399, #10b981) padding-box,
    linear-gradient(180deg, #6ee7b7, #059669) border-box !important;
  color: #04150e !important;
  text-shadow: none !important;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.42),
              0 8px 22px rgba(16,185,129,0.4) !important;
}
body.app-bg .btn-primary::before {
  background: linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0.04)) !important;
}
body.app-bg .btn-primary:hover { filter: brightness(1.05); }

/* --- KPI stat cards: clean vertical Zentra cards (no icon tile) --------- */
body.app-bg .stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(222px, 1fr));
  gap: 16px;
}
/* Override the night-theme flex-row + icon layout: lead with the metric. */
body.app-bg .stat {
  display: block !important;
  position: relative;
  padding: 20px 20px 0 !important;
  min-height: 162px;
  overflow: hidden;
}
body.app-bg .stat .stat-ic { display: none !important; }
body.app-bg .stat .stat-body { display: block; }
body.app-bg .stat .label {
  font-size: 13.5px; font-weight: 500; color: var(--text-dim);
  position: relative; z-index: 2;
}
body.app-bg .stat .value {
  font-size: clamp(23px, 2.3vw, 29px);
  line-height: 1.05; letter-spacing: -0.03em;
  margin: 12px 0 3px; white-space: nowrap;
  position: relative; z-index: 2;
}
body.app-bg .stat .sub {
  font-size: 12px; color: var(--text-faint);
  position: relative; z-index: 2;
}
body.app-bg .stat::after {
  background: radial-gradient(circle, rgba(16,185,129,0.28), transparent 70%) !important;
}
/* Area sparkline anchored to the bottom of the card. */
body.app-bg .stat-spark {
  display: block;
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 50px; overflow: visible; z-index: 1;
}
body.app-bg .stat-spark .line {
  fill: none; stroke: #34d399; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 3px 7px rgba(52,211,153,0.5));
}
body.app-bg .stat-spark .area { fill: rgba(52,211,153,0.14); stroke: none; }

/* --- Featured hero stat: filled emerald card (the "Available Balance") --- */
body.app-bg .stat.stat-hero {
  background: linear-gradient(150deg, #10503d 0%, #064e3b 50%, #022c22 100%) !important;
  border-color: rgba(52,211,153,0.38) !important;
  box-shadow: inset 0 1px 0 rgba(167,243,208,0.18),
              0 18px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(52,211,153,0.12) !important;
}
body.app-bg .stat.stat-hero .label,
body.app-bg .stat.stat-hero .sub { color: rgba(209,250,229,0.85) !important; }
body.app-bg .stat.stat-hero .value { color: #ecfdf5 !important; }
body.app-bg .stat.stat-hero::after {
  background: radial-gradient(circle, rgba(110,231,183,0.4), transparent 70%) !important;
  opacity: 1;
}
body.app-bg .stat.stat-hero .stat-spark .line { stroke: #a7f3d0; }
body.app-bg .stat.stat-hero .stat-spark .area { fill: rgba(167,243,208,0.18); }

/* --- Persistent, labelled sidebar (the reference's left rail) ----------- */
@media (min-width: 921px) {
  body.app-bg { --sb-w: 236px; --sb-expanded: 236px; }

  body.app-bg .nav .lbl,
  body.app-bg .brand .name,
  body.app-bg .nav-agency { max-width: 180px !important; opacity: 1 !important; }

  body.app-bg .brand { justify-content: flex-start !important; padding-left: 10px; }
  body.app-bg .nav-links a,
  body.app-bg .navfoot { justify-content: flex-start !important; padding-left: 15px !important; }
  body.app-bg .nav-links a.active {
    box-shadow: 0 6px 18px rgba(16,185,129,0.32) !important;
  }
  body.app-bg .theme-toggle { align-self: flex-start !important; margin-left: 6px; }
}

/* --- Flat pills, badges & buttons (match the Zentra reference) ---------
   The night theme dresses every pill and button in brushed-chrome with a
   bright top gloss. The reference is the opposite: flat dark-glass pills with
   a thin hairline border and no shine. Strip the gloss inside the CRM. */

/* Status pills / "x To Go" bubbles: kill the glossy white top highlight. */
body.app-bg .badge {
  box-shadow: none !important;
  background: rgba(255,255,255,0.05) !important;
  border-width: 1px;
  font-weight: 500;
}
body.app-bg .badge::after { display: none !important; }   /* any gloss layer */
body.app-bg .badge.active, body.app-bg .badge.paid,
body.app-bg .badge.done, body.app-bg .badge.published {
  background: rgba(52,211,153,0.12) !important; border-color: rgba(52,211,153,0.32) !important;
}
body.app-bg .badge.lead, body.app-bg .badge.doing,
body.app-bg .badge.scheduled {
  background: rgba(96,165,250,0.12) !important; border-color: rgba(96,165,250,0.3) !important;
}

/* Secondary buttons: flat dark-glass pills, no chrome bevel, no top gloss. */
body.app-bg .btn:not(.btn-primary) {
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,0.045) !important;
  color: #e9efee !important;
  text-shadow: none !important;
  box-shadow: none !important;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
body.app-bg .btn:not(.btn-primary)::before { display: none !important; }
body.app-bg .btn:not(.btn-primary):hover {
  background: rgba(255,255,255,0.09) !important;
  border-color: rgba(52,211,153,0.3) !important;
  filter: none; transform: translateY(-1px);
}

/* Icon chips (kanban ‹ › ×) and filter tabs: same flat treatment. */
body.app-bg .icon-btn {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  box-shadow: none !important;
}
body.app-bg .icon-btn::before { display: none !important; }
body.app-bg .tab {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  box-shadow: none !important;
}
body.app-bg .tab::before { display: none !important; }
body.app-bg .tab.active {
  background: var(--iris) !important;
  border-color: transparent !important;
  color: #04150e !important;
  box-shadow: 0 6px 18px rgba(16,185,129,0.3) !important;
}

/* Project / feature cards: same calm matte glass, softer top sheen. */
body.app-bg .feature {
  background: linear-gradient(180deg, rgba(20,24,27,0.78), rgba(12,15,17,0.82)) !important;
  border: 1px solid rgba(255,255,255,0.065) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 18px 48px rgba(0,0,0,0.5) !important;
}
body.app-bg .feature::after { opacity: 0.4; }
body.app-bg .feature:hover { border-color: rgba(52,211,153,0.18) !important; }

/* ============================================================================
   LIQUID GLASS 2026 — Apple-minimal reskin layer (appended last, wins cascade).
   Frosted translucent surfaces with a specular top edge, hairline dividers,
   soft depth on hover. Keeps the night-mode emerald identity; adds the liquid.
   ========================================================================= */
:root {
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.095);
  --glass-stroke: rgba(255, 255, 255, 0.12);
  --glass-spec: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --hairline: rgba(255, 255, 255, 0.07);
}
html[data-theme="light"] {
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-stroke: rgba(0, 0, 0, 0.09);
  --glass-spec: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --hairline: rgba(0, 0, 0, 0.07);
}

/* --- Buttons: liquid glass pills ------------------------------------------ */
body.app-bg .btn:not(.btn-primary) {
  background: var(--glass) !important;
  border: 1px solid var(--glass-stroke) !important;
  box-shadow: var(--glass-spec), 0 4px 16px rgba(0, 0, 0, 0.22) !important;
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  transition: transform .18s cubic-bezier(.2,.7,.2,1), background .18s,
              border-color .18s, box-shadow .18s;
}
body.app-bg .btn:not(.btn-primary):hover {
  background: var(--glass-strong) !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
  box-shadow: var(--glass-spec), 0 10px 28px rgba(0, 0, 0, 0.3) !important;
  transform: translateY(-1px);
}
body.app-bg .btn:active { transform: translateY(0) scale(0.985); }
body.app-bg .btn-primary {
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3),
              0 6px 22px rgba(16, 185, 129, 0.28) !important;
}
body.app-bg .btn-primary:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38),
              0 12px 30px rgba(16, 185, 129, 0.4) !important;
  transform: translateY(-1px);
}

/* --- Cards & surfaces: one frosted family ---------------------------------- */
body.app-bg .card, body.app-bg .stat, body.app-bg .reel-slot,
body.app-bg .client-tab, body.app-bg .pipe-chip, body.app-bg .saved-card,
body.app-bg .studio-chat, body.app-bg .sched-pop {
  background: var(--glass);
  border-color: var(--glass-stroke);
  backdrop-filter: blur(26px) saturate(1.35);
  -webkit-backdrop-filter: blur(26px) saturate(1.35);
  box-shadow: var(--glass-spec), 0 12px 36px rgba(0, 0, 0, 0.24);
}
body.app-bg .client-tab:hover, body.app-bg .stat:hover,
body.app-bg .saved-card:hover {
  background: var(--glass-strong);
  transform: translateY(-2px);
  transition: transform .2s cubic-bezier(.2,.7,.2,1), background .2s;
}

/* --- Nav: heavier frost, hairline edge -------------------------------------- */
body.app-bg .nav {
  background: rgba(10, 10, 14, 0.5);
  backdrop-filter: blur(32px) saturate(1.6);
  -webkit-backdrop-filter: blur(32px) saturate(1.6);
  border-color: var(--hairline);
}
html[data-theme="light"] body.app-bg .nav { background: rgba(255, 255, 255, 0.62) !important; }

/* --- Inputs: frosted wells --------------------------------------------------- */
body.app-bg input, body.app-bg select, body.app-bg textarea {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--glass-stroke);
  border-radius: 12px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
/* Checkboxes/radios must NOT get the frosted-well treatment — it hid the
   check and made them look unclickable. Native box + green accent instead. */
body.app-bg input[type="checkbox"],
body.app-bg input[type="radio"] {
  -webkit-appearance: auto !important;
  appearance: auto !important;
  accent-color: #10b981;
  width: 17px !important; height: 17px !important;
  min-width: 17px; flex: 0 0 auto;
  border: none !important; border-radius: 4px;
  background: none !important; box-shadow: none !important;
  cursor: pointer; margin: 0;
}
body.app-bg input:focus, body.app-bg select:focus, body.app-bg textarea:focus {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.13), var(--glass-spec);
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}
html[data-theme="light"] body.app-bg input,
html[data-theme="light"] body.app-bg select,
html[data-theme="light"] body.app-bg textarea { background: rgba(255, 255, 255, 0.78); }

/* --- Tables: hairlines only --------------------------------------------------- */
body.app-bg .table th { border-bottom: 1px solid var(--hairline); }
body.app-bg .table td { border-bottom: 1px solid var(--hairline); }
body.app-bg .table tr:last-child td { border-bottom: none; }
body.app-bg .table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }

/* --- Flash toasts: floating glass --------------------------------------------- */
body.app-bg .flash {
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--glass-stroke);
  box-shadow: var(--glass-spec), 0 14px 40px rgba(0, 0, 0, 0.35);
}

/* --- Type polish ----------------------------------------------------------------- */
body.app-bg h1 { letter-spacing: -0.03em; font-weight: 650; }
body.app-bg .card-title { letter-spacing: -0.015em; }

/* Light mode: the v1 matte-dark card rule above has no theme guard, so undo
   it here — light glass cards on the light canvas. */
html[data-theme="light"] body.app-bg .card,
html[data-theme="light"] body.app-bg .stat,
html[data-theme="light"] body.app-bg .reel-slot,
html[data-theme="light"] body.app-bg .client-tab,
html[data-theme="light"] body.app-bg .pipe-chip,
html[data-theme="light"] body.app-bg .saved-card,
html[data-theme="light"] body.app-bg .studio-chat,
html[data-theme="light"] body.app-bg .feature {
  background: rgba(255, 255, 255, 0.65) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
              0 12px 32px rgba(20, 24, 40, 0.1) !important;
}
html[data-theme="light"] body.app-bg .btn:not(.btn-primary) {
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: #1a1c24 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 14px rgba(20, 24, 40, 0.08) !important;
}
html[data-theme="light"] body.app-bg input,
html[data-theme="light"] body.app-bg select,
html[data-theme="light"] body.app-bg textarea {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.11);
  color: #1a1c24;
}

/* Accessibility: honor reduced transparency */
@media (prefers-reduced-transparency: reduce) {
  body.app-bg .btn, body.app-bg .card, body.app-bg .stat, body.app-bg .nav,
  body.app-bg .flash, body.app-bg .studio-chat {
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  }
}

/* ============================================================================
   ZENTRA PASS — emerald fintech dark-glass look (ref: dribbble @sogasoux).
   Green-tinted near-black panels, emerald + periwinkle accents, halftone
   texture on bars, big numbers with dimmed cents, pill chips everywhere.
   ========================================================================= */
:root {
  --zen-green: #34d399;
  --zen-green-deep: #10b981;
  --zen-violet: #8b8bf5;
  --zen-panel: rgba(15, 20, 18, 0.82);
  --zen-panel-2: rgba(11, 15, 13, 0.86);
}

/* Panels pick up a whisper of green so the whole app reads Zentra. */
body.app-bg .card, body.app-bg .stat, body.app-bg .reel-slot,
body.app-bg .client-tab, body.app-bg .pipe-chip, body.app-bg .saved-card,
body.app-bg .studio-chat, body.app-bg .sched-pop {
  background: linear-gradient(180deg, var(--zen-panel), var(--zen-panel-2)) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 20px;
}
body.app-bg .card:hover, body.app-bg .client-tab:hover,
body.app-bg .saved-card:hover { border-color: rgba(52, 211, 153, 0.28) !important; }

/* Hero stat: the emerald "Net Cash Flow" tile. */
body.app-bg .stat-hero {
  background:
    radial-gradient(130% 120% at 85% -20%, rgba(52, 211, 153, 0.34), transparent 55%),
    linear-gradient(180deg, rgba(16, 34, 27, 0.92), rgba(10, 20, 16, 0.94)) !important;
  border-color: rgba(52, 211, 153, 0.3) !important;
}

/* Big numbers: bright dollars, dimmed cents, tabular digits. */
body.app-bg .value, body.app-bg .rev-bar strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}
.cents { color: var(--text-faint); font-weight: 600; }
body.app-bg .stat-hero .value { color: #eafff6; }
body.app-bg .stat-hero .cents { color: rgba(234, 255, 246, 0.4); }

/* Halftone 3D bars — the signature Zentra chart texture. */
body.app-bg .rev-bar .tr {
  height: 14px;
  background:
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.4px) 0 0 / 6px 6px,
    rgba(255, 255, 255, 0.04);
}
body.app-bg .rev-bar .tr i {
  background:
    radial-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1.4px) 0 0 / 6px 6px,
    linear-gradient(180deg, #6ee7b7, #10b981) !important;
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.35);
}
body.app-bg .pipe-chip {
  background:
    radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1.4px) 0 0 / 7px 7px,
    linear-gradient(180deg, var(--zen-panel), var(--zen-panel-2)) !important;
}
body.app-bg .pipe-chip .n { color: var(--zen-green); font-variant-numeric: tabular-nums; }

/* Periwinkle secondary accent (Zentra pairs emerald with soft violet). */
body.app-bg .badge.scheduled, body.app-bg .badge.doing {
  background: rgba(139, 139, 245, 0.14) !important;
  border-color: rgba(139, 139, 245, 0.38) !important;
  color: #c7c7ff !important;
}
body.app-bg .cal-chip.scheduled { border-color: rgba(139, 139, 245, 0.4); }

/* Trend/status pills read as rounded chips with a dot, Zentra-style. */
body.app-bg .badge {
  border-radius: 999px !important;
  font-weight: 650;
  letter-spacing: 0.01em;
}

/* --- Liquid dock nav: glass pills that magnify toward the cursor ----------
   The scale itself is driven by the dock script in base.html (distance-based,
   like the macOS Dock); CSS supplies the springy transition + glass hover. */
body.app-bg.has-sidebar .nav-links a {
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.028);
  transition: background .18s ease, box-shadow .18s ease;
}
/* Clean floating hover — brighten + soft lift, no border and no transform,
   so nothing ever pokes past the rail edge. */
body.app-bg.has-sidebar .nav-links a:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12),
              0 6px 18px rgba(0, 0, 0, 0.28);
}
@media (prefers-reduced-motion: reduce) {
  body.app-bg.has-sidebar .nav-links a { transition: none; transform: none !important; }
}

/* Floating rail: no dividing line, no solid slab — the pills float on the
   background. The frosted backdrop only fades in while the rail is expanded
   (hovered) so labels stay readable over content. */
body.app-bg.has-sidebar .nav {
  border-right: none !important;
  background: transparent !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: width .22s cubic-bezier(.4,0,.2,1), background .22s, box-shadow .22s;
}
body.app-bg.has-sidebar .nav:hover {
  background: rgba(9, 11, 10, 0.82) !important;
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
}
body.app-bg.has-sidebar .nav-right { border-top: none !important; }
html[data-theme="light"] body.app-bg.has-sidebar .nav { border-right: none !important; background: transparent !important; }
html[data-theme="light"] body.app-bg.has-sidebar .nav:hover { background: rgba(255,255,255,0.9) !important; }

/* Hover keeps the label bright white; the active tile stays the filled
   emerald pill with dark text (the dock layer was clobbering its background). */
body.app-bg.has-sidebar .nav-links a:hover:not(.active) { color: #fff; }
body.app-bg.has-sidebar .nav-links a:hover:not(.active) .ic { color: #fff; }
body.app-bg.has-sidebar .nav-links a.active {
  background: var(--iris) !important;
  color: #04150e !important;
  border-color: transparent !important;
}
html[data-theme="light"] body.app-bg.has-sidebar .nav-links a:hover:not(.active) { color: #0c0e14; }

/* --- Token pill -------------------------------------------------------------- */
.token-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 650;
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.08);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform .2s, background .2s;
}
.token-pill:hover { transform: translateY(-1px); background: rgba(52, 211, 153, 0.14); }
.token-pill .ic { width: 13px; height: 13px; }
.token-pill.empty {
  color: #fda4af;
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
}
html[data-theme="light"] .token-pill { color: #047857; }

/* Third streak: a thin bright beam low in the frame — extra depth. */
.bg-wave .wave-c { animation: wave-drift-a 64s ease-in-out infinite alternate-reverse; }
@media (prefers-reduced-motion: reduce) { .bg-wave .wave-c { animation: none; } }

/* Small inline icons inside buttons / chips */
.bi { width: 16px; height: 16px; flex: 0 0 auto; }
.chip-ic { width: 12px; height: 12px; vertical-align: -1.5px; display: inline-block; }
.sc-sched { color: var(--zen-violet); font-weight: 600; }

/* Light theme: keep the Zentra tint airy, not muddy. */
html[data-theme="light"] body.app-bg .card,
html[data-theme="light"] body.app-bg .stat,
html[data-theme="light"] body.app-bg .reel-slot,
html[data-theme="light"] body.app-bg .client-tab,
html[data-theme="light"] body.app-bg .pipe-chip,
html[data-theme="light"] body.app-bg .saved-card,
html[data-theme="light"] body.app-bg .studio-chat {
  background: rgba(255, 255, 255, 0.68) !important;
  border: 1px solid rgba(10, 40, 30, 0.1) !important;
}
html[data-theme="light"] body.app-bg .stat-hero {
  background:
    radial-gradient(130% 120% at 85% -20%, rgba(52, 211, 153, 0.25), transparent 55%),
    rgba(255, 255, 255, 0.8) !important;
}
html[data-theme="light"] body.app-bg .stat-hero .value { color: #06281c; }
html[data-theme="light"] body.app-bg .stat-hero .cents { color: rgba(6, 40, 28, 0.4); }

/* ============================================================================
   LIQUID SILK WAVE — a whisper of flowing highlight behind the app.
   Fixed behind content, blurred ribbons drifting VERY slowly. Minimal on
   purpose: it should read as depth, not decoration.
   ========================================================================= */
.bg-wave {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: screen;
}
.bg-wave svg { width: 100%; height: 100%; display: block; }
.bg-wave .wave-a { animation: wave-drift-a 46s ease-in-out infinite alternate; }
.bg-wave .wave-b { animation: wave-drift-b 58s ease-in-out infinite alternate; }
@keyframes wave-drift-a {
  from { transform: translate3d(-30px, 12px, 0); }
  to   { transform: translate3d(40px, -16px, 0); }
}
@keyframes wave-drift-b {
  from { transform: translate3d(30px, -10px, 0); }
  to   { transform: translate3d(-44px, 14px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .bg-wave .wave-a, .bg-wave .wave-b { animation: none; }
}
html[data-theme="light"] .bg-wave { opacity: 0.16; mix-blend-mode: multiply; }

/* ============================================================================
   LIQUID GLASS BUTTONS — every control, one family (Zentra pills).
   Translucent fill + blur, hairline border, specular top sheen (::after),
   soft drop, hover lift. Covers primary, secondary, icon chips, widget
   tools, tray chips, theme toggle and tabs.
   ========================================================================= */
body.app-bg .btn,
body.app-bg .icon-btn,
body.app-bg .wtool,
body.app-bg .tray-chip,
body.app-bg .theme-toggle {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
body.app-bg .btn::after,
body.app-bg .icon-btn::after,
body.app-bg .wtool::after,
body.app-bg .tray-chip::after,
body.app-bg .theme-toggle::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02) 42%,
                    transparent 60%),
    radial-gradient(90% 60% at 50% 118%, rgba(255, 255, 255, 0.06), transparent 65%);
  pointer-events: none;
}
body.app-bg .icon-btn,
body.app-bg .wtool,
body.app-bg .theme-toggle {
  background: rgba(255, 255, 255, 0.055) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16),
              0 4px 14px rgba(0, 0, 0, 0.25) !important;
  transition: transform .18s cubic-bezier(.2,.7,.2,1), background .18s,
              border-color .18s;
}
body.app-bg .icon-btn:hover,
body.app-bg .wtool:hover,
body.app-bg .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(52, 211, 153, 0.32) !important;
  transform: translateY(-1px);
}
body.app-bg .tray-chip {
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
/* Primary keeps its emerald fill but gains the same liquid sheen. */
body.app-bg .btn-primary::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.05) 45%,
                    transparent 62%),
    radial-gradient(90% 70% at 50% 120%, rgba(255, 255, 255, 0.12), transparent 65%);
}
/* Month/filter tabs read as small glass pills too. */
body.app-bg .tab {
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09) !important;
}
html[data-theme="light"] body.app-bg .btn::after,
html[data-theme="light"] body.app-bg .icon-btn::after,
html[data-theme="light"] body.app-bg .wtool::after,
html[data-theme="light"] body.app-bg .tray-chip::after,
html[data-theme="light"] body.app-bg .theme-toggle::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9),
                              rgba(255, 255, 255, 0.2) 45%, transparent 62%);
}
html[data-theme="light"] body.app-bg .icon-btn,
html[data-theme="light"] body.app-bg .wtool,
html[data-theme="light"] body.app-bg .theme-toggle {
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

/* ============================================================================
   Access-model UI: left-aligned sidebar footer, day/night labelled toggle,
   support-impersonation banner. (2026-07)
   ========================================================================= */
@media (min-width: 921px) {
  /* Footer block pushed hard to the left, matching the top nav pills. */
  body.app-bg .nav-agency {
    text-align: left !important; padding-left: 15px !important; align-self: stretch;
  }
  body.app-bg .nav-right .token-pill { align-self: flex-start; margin-left: 3px; }
}

/* The day/night toggle is now a labelled footer row, styled like a nav link. */
.navfoot-btn {
  width: 100%; background: none; border: none; cursor: pointer;
  font: inherit; color: var(--text-dim); text-align: left;
}
.navfoot-btn:hover { color: var(--text); }
.navfoot-btn .th-moon { display: none; }
html[data-theme="light"] .navfoot-btn .th-sun { display: none; }
html[data-theme="light"] .navfoot-btn .th-moon { display: inline-flex; }

/* Support-mode (impersonation) banner. */
.imp-banner {
  position: sticky; top: 0; z-index: 70;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 18px; font-size: 13.5px; font-weight: 600;
  color: #fde68a; background: rgba(180, 120, 20, 0.22);
  border-bottom: 1px solid rgba(251, 191, 36, 0.4);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
.imp-banner strong { color: #fff; }
@media (min-width: 921px) { body.has-sidebar .imp-banner { padding-left: calc(var(--sb-w, 236px) + 18px); } }

/* ============================================================================
   Page-transition progress bar + content fade. (2026-07)
   ========================================================================= */
.page-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2.5px; z-index: 300;
  transform: scaleX(0); transform-origin: left center;
  background: linear-gradient(90deg, #34d399, #8b5cf6);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
  opacity: 0; pointer-events: none;
  transition: transform .12s linear, opacity .2s;
}
.page-progress.go { opacity: 1; }
.page-progress.done { transition: transform .18s ease, opacity .26s ease .1s; opacity: 0; }

/* Fresh content eases in on load (skipped for reduced-motion). */
@media (prefers-reduced-motion: no-preference) {
  .app-bg .wrap.section, .app-bg .studio, .app-bg .board { animation: pagefade .34s cubic-bezier(.2,.7,.2,1) both; }
}
@keyframes pagefade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Make the footer's push-to-left decisive across all states. */
@media (min-width: 921px) {
  body.app-bg .nav-right { align-items: flex-start !important; }
  body.app-bg .nav-right > * { width: 100%; }
  body.app-bg .nav-right .token-pill { width: auto; }
  body.app-bg .nav-agency { width: 100%; text-align: left !important; padding-left: 15px !important; }
}

/* ---- Reel pipeline: Cards / Table view toggle -------------------------- */
.seg {
  display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
}
.seg button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: var(--text-faint);
  font-size: 12.5px; font-weight: 600; padding: 6px 13px; border-radius: 9px;
  cursor: pointer; transition: background .16s ease, color .16s ease;
}
.seg button:hover { color: var(--text); }
.seg button.active {
  background: rgba(255,255,255,0.10); color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 4px 12px rgba(0,0,0,0.25);
}
.seg .bi { width: 14px; height: 14px; }
html[data-theme="light"] .seg { background: rgba(0,0,0,0.045); border-color: rgba(0,0,0,0.08); }
html[data-theme="light"] .seg button.active { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.10); }

.reel-scroll { overflow-x: auto; }

/* Column layout shared by the header row and each reel row in table mode. */
.reel-thead { display: none; }
.reel-grid.view-table .reel-thead,
.reel-grid.view-table .reel-slot {
  display: grid;
  grid-template-columns: 148px 148px 1.2fr 1.2fr 1.55fr 118px 138px 1.2fr;
  gap: 10px; align-items: center;
}
.reel-grid.view-table {
  display: block; min-width: 1160px;
  border: 1px solid var(--glass-brd); border-radius: 14px; overflow: hidden;
}
.reel-grid.view-table .reel-thead {
  padding: 9px 12px;
  font-size: 11px; font-weight: 600; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .05em;
  background: rgba(255,255,255,0.035);
  border-bottom: 1px solid var(--glass-brd);
}
.reel-grid.view-table .reel-slot {
  padding: 8px 12px; border-radius: 0;
  border: 0; border-bottom: 1px solid var(--glass-brd);
  border-left: 3px solid var(--stage-color, rgba(255,255,255,0.2));
  background: transparent !important;
  box-shadow: none !important; backdrop-filter: none !important;
}
.reel-grid.view-table .reel-slot:last-child { border-bottom: 0; }
.reel-grid.view-table .reel-slot:hover { background: rgba(255,255,255,0.03) !important; }
.reel-grid.view-table .reel-slot.filled { background: rgba(52,211,153,0.05) !important; }
.reel-grid.view-table .reel-lbl { display: none; }
.reel-grid.view-table .reel-head { margin-bottom: 0; min-width: 0; }
.reel-grid.view-table .reel-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel-grid.view-table .reel-row,
.reel-grid.view-table .reel-row > div { display: contents; }
.reel-grid.view-table .reel-slot textarea {
  min-height: 36px; height: 36px; resize: none; line-height: 1.35;
}
html[data-theme="light"] .reel-grid.view-table .reel-thead { background: rgba(0,0,0,0.03); }
html[data-theme="light"] .reel-grid.view-table .reel-slot:hover { background: rgba(0,0,0,0.025) !important; }
html[data-theme="light"] .reel-grid.view-table .reel-slot.filled { background: rgba(52,211,153,0.07) !important; }

/* ---- Date picker popover (Shopify-style, datepicker.js) ---------------- */
input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
@media (pointer: fine) { input[type="date"] { cursor: pointer; } }
.sf-dp {
  position: absolute; z-index: 320; width: 258px; padding: 12px;
  border-radius: 14px; border: 1px solid var(--glass-brd);
  background: rgba(21,23,30,0.94);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 44px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.07);
  animation: pagefade .16s ease both;
}
.sf-dp-head { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.sf-dp-nav {
  width: 26px; height: 26px; flex: 0 0 auto; border-radius: 8px; border: 0;
  cursor: pointer; background: rgba(255,255,255,0.06); color: var(--text);
  font-size: 15px; line-height: 1; transition: background .14s ease;
}
.sf-dp-nav:hover { background: rgba(255,255,255,0.13); }
.sf-dp-head select {
  flex: 1; min-width: 0; width: auto; padding: 4px 6px !important;
  font-size: 12.5px; font-weight: 600; color: var(--text);
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-brd);
  border-radius: 8px;
}
.sf-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.sf-dp-dow {
  text-align: center; font-size: 10.5px; font-weight: 600;
  color: var(--text-faint); padding: 3px 0 5px;
}
.sf-dp-day {
  height: 28px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text); font-size: 12.5px; cursor: pointer;
  transition: background .12s ease;
}
.sf-dp-day:hover { background: rgba(255,255,255,0.10); }
.sf-dp-day.today { box-shadow: inset 0 0 0 1px rgba(52,211,153,0.55); }
.sf-dp-day.sel { background: #10b981; color: #06251b; font-weight: 700; }
.sf-dp-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.sf-dp-lnk {
  border: 0; background: transparent; color: var(--text-faint);
  font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 6px;
}
.sf-dp-lnk:hover { color: var(--text); }
html[data-theme="light"] .sf-dp {
  background: rgba(255,255,255,0.97);
  box-shadow: 0 18px 44px rgba(0,0,0,0.16), inset 0 1px 0 rgba(255,255,255,0.6);
}
html[data-theme="light"] .sf-dp-nav { background: rgba(0,0,0,0.05); }
html[data-theme="light"] .sf-dp-nav:hover { background: rgba(0,0,0,0.10); }
html[data-theme="light"] .sf-dp-day:hover { background: rgba(0,0,0,0.06); }
html[data-theme="light"] .sf-dp-head select { background: #fff; }
