/* Phase AV: lighter premium freight dashboard shell */
html[data-theme="light"] {
  --bg: #F8FAFC;
  --surface: #ffffff;
  --surface-2: #F2F4F7;
  --surface-3: #EAECF0;
  --border: #E2E8F0;
  --border-strong: #CAD5E2;
  --ink: #020618;
  --ink-soft: #314158;
  --muted: #475467;
  --muted-soft: #90A1B9;
  --accent: #3356EE;
  --accent-strong: #2440C4;
  --accent-soft: rgba(51, 86, 238, 0.08);
  --accent-ink: #ffffff;
  --accent-2: #3356EE;
  --accent-2-soft: rgba(51, 86, 238, 0.10);
  --shadow-md: var(--qf-shadow-md);
  --shadow-lg: var(--qf-shadow-md);
}

html[data-theme="light"] body {
  background: #ffffff;
}

html[data-theme="light"] .app-shell {
  background: transparent;
  grid-template-columns: 268px 1fr;
}

html[data-theme="light"] .sidebar {
  margin: 14px 0 14px 14px;
  height: calc(100vh - 28px);
  border: 1px solid rgba(184, 207, 245, 0.72);
  border-radius: 24px;
  background: rgb(255, 255, 255);
  box-shadow: var(--qf-shadow-md);
}

html[data-theme="light"] .sidebar .brand-block {
  margin: 0 12px 12px;
  padding: 16px 14px 18px;
  border-bottom: 1px solid rgba(184, 207, 245, 0.62);
}

html[data-theme="light"] .sidebar .brand-block .name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  min-width: 0;
}

html[data-theme="light"] .sidebar .brand-block .name::before {
  /* Business initials, computed in app.js and set via data-initials on
     #sb-tenant-name (falls back to 'QF' if the attribute is missing). Solid
     brand blue — no violet gradient (token-only, blue in both themes). */
  content: attr(data-initials);
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--accent-fill);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: -0.04em;
  box-shadow: var(--qf-shadow-md);
}

html[data-theme="light"] .sidebar .brand-block .sub {
  padding-left: 44px;
  color: #6b7280;
}

html[data-theme="light"] .sidebar a,
html[data-theme="light"] .sidebar button {
  width: calc(100% - 20px);
  margin: 3px 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border-left: 0;
  color: #596579;
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
  font-size: 13.5px;
}

html[data-theme="light"] .sidebar a:hover,
html[data-theme="light"] .sidebar button:hover {
  background: #eef7ff;
  color: #111827;
}

html[data-theme="light"] .sidebar a.active,
html[data-theme="light"] .sidebar button.active {
  /* Solid brand-blue selection (no violet gradient): blue tint fill + blue
     text + a blue ring. --accent-fill/--accent-soft stay brand blue in both
     themes even though --accent is remapped to violet in this light shell. */
  background: var(--accent-soft);
  color: var(--accent-fill);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-fill) 22%, transparent);
}

html[data-theme="light"] .sidebar .group {
  padding: 18px 22px 6px;
  color: #8a96a8;
  letter-spacing: 0.08em;
}

html[data-theme="light"] .qf-theme-toggle {
  border-radius: 14px;
  background: #f7fbff;
  border-color: rgba(184, 207, 245, 0.72);
}

html[data-theme="light"] .app-main {
  max-width: none;
  padding: 34px 42px 42px;
}

html[data-theme="light"] .app-main h1 {
  font-size: 30px;
  letter-spacing: -0.04em;
}

html[data-theme="light"] .app-main .page-sub {
  max-width: 760px;
  color: #5f6b7d;
}

html[data-theme="light"] .card,
html[data-theme="light"] .chat-panel,
html[data-theme="light"] .table,
html[data-theme="light"] .compare,
html[data-theme="light"] .price-card,
html[data-theme="light"] .feature-card {
  border-color: rgba(184, 207, 245, 0.68);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--qf-shadow-md);
  border-radius: 20px;
}

html[data-theme="light"] .btn-primary {
  background: #3b22f4;
  border-color: #3b22f4;
  color: #fff;
  box-shadow: var(--qf-shadow-lift);
}

html[data-theme="light"] .btn-primary:hover {
  background: #2917c9;
  border-color: #2917c9;
}

html[data-theme="light"] .btn-secondary,
html[data-theme="light"] .btn-ghost {
  background: #eef7ff;
  border-color: rgba(184, 207, 245, 0.78);
  color: #111827;
}

@media (max-width: 900px) {
  /* The light shell grid (268px 1fr) is declared outside a media query above,
     so it out-specifies the base mobile collapse in style.css and the content
     column never goes full-width on phones — clipping wide KPI values. Collapse
     it here (sidebar becomes the off-canvas overlay, matching dark). */
  html[data-theme="light"] .app-shell {
    grid-template-columns: 1fr;
  }
  html[data-theme="light"] .sidebar {
    margin: 0;
    height: 100vh;
    border-radius: 0 22px 22px 0;
  }
  html[data-theme="light"] .app-main {
    padding: 72px 18px 28px;
  }
}

/* ── Trial / announcement banner ──────────────────────────────────────────
   Lives INSIDE the portal top bar's center zone (#qf-trial-bar). Rendered by
   renderTrialBanner() in app.js; view logic in trial-banner.js. A compact,
   theme-aware pill: status dot + countdown headline + value sub + subscribe
   CTA + a close (×). Manually closable — the trial variant's dismissal is
   persisted in localStorage 'qf-trial-dismissed' (see app.js). No longer a
   full-width body sticky (the top bar itself is the sticky chrome). Everything
   from here to EOF sits below the last baselined line, so edits here never
   renumber the spacing/color guard baselines (per project rule). */
.qf-trial-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 4px 8px 4px 16px;
  background: var(--accent-soft);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  line-height: 1.5;
}
.qf-trial-banner--expired {
  background: var(--error-bg);
  border-color: var(--error);
}
.qf-trial-banner-msg {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}
.qf-trial-banner-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--accent);
}
.qf-trial-banner.is-urgent .qf-trial-banner-dot { background: var(--warn); }
.qf-trial-banner--expired .qf-trial-banner-dot { background: var(--error); }
.qf-trial-banner-headline {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
}
.qf-trial-banner-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.qf-trial-banner-cta.btn.btn-primary {
  flex: 0 0 auto;
  padding: 4px 12px;
  font-size: 12px;
}
.qf-trial-banner-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.qf-trial-banner-close:hover {
  color: var(--ink);
  background: var(--surface-2);
}

/* Payment-issue banner (past_due / grace): a paying tenant whose last charge
   failed. Restrained amber --warn tint — a nudge, not the garish read-only
   --error strip — because the service is STILL active while they update the
   card. Theme-aware via tokens; inherits the shared pill layout above. */
.qf-trial-banner--payment_issue {
  background: var(--warn-bg);
  border-color: var(--warn);
}
.qf-trial-banner--payment_issue .qf-trial-banner-dot { background: var(--warn); }

/* ≤900px — the announcement drops onto its own full-width row beneath the
   logo/account row (the top bar becomes a two-row flex-wrap; see app.html's
   inline top-bar styles). The value sub is dropped so the countdown headline +
   CTA + close fit one clean line, and the pill spreads to fill the row. Tokens
   + 8px ramp only. */
@media (max-width: 900px) {
  .qf-trial-banner {
    width: 100%;
    justify-content: space-between;
  }
  .qf-trial-banner-sub { display: none; }
  .qf-trial-banner-headline {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
