/* Dabangg-inspired palette: cool mist canvas, white surfaces, teal actions,
   and restrained pastel status accents. Loaded last so every page shares one system. */
:root {
  --canvas: #eef8fa !important;
  --sidebar: #ffffff !important;
  --white: #ffffff !important;
  --ink: #273047 !important;
  --ink-deep: #1e2740 !important;
  --muted: #7c879b !important;
  --soft: #f7f9fd !important;
  --line: #e4e9f2 !important;
  --mimosa: #ffd56b !important;
  --mimosa-soft: #fff4d7 !important;
  --teal-soft: #bfeeda !important;
  --green: #1c807b !important;
  --green-2: #16736e !important;
  --green-soft: #d7f0ec !important;
  --lime: #a6e8c1 !important;
  --paper: #eef8fa !important;
  --paper-deep: #dceff3 !important;
  --surface: #ffffff !important;
  --surface-soft: #f7f9fd !important;
  --evergreen: #1c807b !important;
  --moss: #697492 !important;
  --ochre: #ffba73 !important;
  --clay: #ff9d91 !important;
  --shadow: 0 20px 55px rgba(70, 91, 139, .12) !important;
}

/* Shared CRM surfaces */
body:not(.landing-page):not(.auth-page):not(.owner-admin-page) {
  color: var(--ink) !important;
  background: var(--canvas) !important;
}
.app-shell {
  background: var(--canvas) !important;
  border-color: #fff !important;
  box-shadow: var(--shadow) !important;
}
.sidebar,
.app-shell > .sidebar {
  color: var(--ink) !important;
  background: #fff !important;
  border-right: 1px solid var(--line) !important;
}
.brand,
.nav-item { color: var(--ink) !important; }
.brand-mark { color: #fff !important; background: var(--green) !important; }
.brand-mark svg { stroke: #fff !important; }
.nav-label { color: #9aa5b8 !important; }
.nav-item { color: #7b879b !important; }
.nav-item:hover { color: var(--green) !important; background: var(--green-soft) !important; }
.nav-item.active { color: var(--green) !important; background: var(--green-soft) !important; }
.nav-item.active::before { background: var(--green) !important; }
.nav-item b { color: #fff !important; background: var(--green) !important; }
.sidebar-footer, .profile-card { border-color: var(--line) !important; }
.profile-card { background: #f7f9fd !important; }
.profile-card strong { color: var(--ink) !important; }
.profile-card span { color: var(--muted) !important; }
.avatar { color: #fff !important; background: var(--green) !important; }
.main { background: #f9fbfd !important; }
.topbar { border-color: var(--line) !important; background: transparent !important; }
.search, .icon-button { color: var(--ink) !important; background: #fff !important; border-color: var(--line) !important; }
.search input { color: var(--ink) !important; }
.search kbd { color: var(--muted) !important; background: var(--soft) !important; border-color: var(--line) !important; }
.icon-button:hover, .round-button:hover { color: #fff !important; background: var(--green) !important; }
.icon-button i { border-color: #fff !important; background: var(--clay) !important; }
.page-heading h1, .settings-heading h1 { color: var(--ink) !important; }
.eyebrow, .nav-label { color: var(--moss) !important; }
.page-heading > div > p:last-child, .settings-heading > div > p:last-child { color: var(--muted) !important; }
.primary-button, .dark-button, .doc-button.primary { color: #fff !important; background: var(--green) !important; }
.primary-button:hover, .dark-button:hover, .doc-button.primary:hover { background: var(--green-2) !important; }
.activity-card, .event-focus-card { color: #fff !important; background: linear-gradient(135deg, #176f69, #2aa7a0) !important; }
.metric-card, .panel, .next-event-card, .settings-panel, .settings-nav, .editor-card, .control-card, .template-rail { background: #fff !important; border-color: var(--line) !important; }
.metric-card:first-child { color: #fff !important; background: linear-gradient(135deg, #176f69, #2aa7a0) !important; }
.metric-card:nth-child(2) { background: #f0efff !important; }
.metric-card:nth-child(3) { background: #e5f8ef !important; }
.metric-card:nth-child(4) { background: #fff5dc !important; }
.metric-card .metric-icon, .action-icon { color: var(--green) !important; background: var(--green-soft) !important; }
.metric-card:first-child .metric-icon { color: var(--green) !important; background: #fff !important; }
.metric-card small, .metric-card em { color: var(--muted) !important; }
.metric-card:first-child small, .metric-card:first-child em { color: rgba(255,255,255,.78) !important; }
.event-filters, .range-switcher, .document-switcher, .studio-tabs { background: #f7f9fd !important; border-color: var(--line) !important; }
.event-filters button, .range-switcher button, .document-switcher a, .studio-tabs button { color: var(--muted) !important; }
.event-filters button.active, .range-switcher button.active, .document-switcher a.active, .studio-tabs button.active { color: #fff !important; background: var(--green) !important; }
.date-tile { color: var(--green) !important; background: var(--green-soft) !important; }
.event-tag.wedding, .status.confirmed { color: #3b9b6c !important; background: #e4f8ed !important; }
.event-tag.portrait, .status.pending { color: #9b6a21 !important; background: #fff2d4 !important; }
.event-tag.corporate { color: #1c807b !important; background: #d7f0ec !important; }
.team-stack span { color: var(--green) !important; background: #e2f7ec !important; }
.action-icon.clay { color: #cb6b54 !important; background: #fff0eb !important; }
.action-icon.ochre { color: #a87916 !important; background: #fff5dc !important; }
.settings-status { color: #398e67 !important; background: #e4f8ed !important; }
.settings-panel input, .settings-panel textarea, .settings-panel select, .editor-grid input, .editor-grid select, .editor-grid textarea, .editor-item, .event-function, .timeline-editor input, .deliverable-editor label, .addon-grid label, .quote-image-grid label, .control-body input[type=text], .control-body input:not([type]), .control-body textarea, .control-body select { color: var(--ink) !important; border-color: var(--line) !important; background: var(--soft) !important; }
.settings-panel input:focus, .settings-panel textarea:focus, .settings-panel select:focus, .editor-grid input:focus, .editor-grid textarea:focus, .editor-grid select:focus { border-color: var(--green) !important; box-shadow: 0 0 0 3px rgba(28,128,123,.13) !important; }
.document-app, .brand-studio { background: var(--canvas) !important; }
.document-topbar, .studio-topbar { background: rgba(255,255,255,.9) !important; border-color: var(--line) !important; }
.paper-stage, .studio-preview { background: #dceff3 !important; }
.document-paper, .full-document { color: var(--ink) !important; background: #fff !important; }
.paper-logo, .doc-logo, .studio-logo { background: var(--green) !important; }
.paper-accent, .doc-rule { background: var(--green) !important; }
.doc-title, .doc-section h3, .doc-total strong { color: var(--green) !important; }
.toast, .usage-toast { color: #fff !important; background: var(--green) !important; }

/* Shared document header alignment across quotation, contract, invoice and saved views. */
.document-topbar {
  grid-template-columns: 240px minmax(0, 1fr) max-content !important;
  min-height: 72px;
  padding-inline: 32px !important;
  gap: 18px !important;
}
.document-topbar .document-brand { min-width: 0; }
.document-topbar .document-switcher {
  justify-self: center;
  width: max-content;
  max-width: 100%;
  margin: 0;
}
.document-topbar .document-actions {
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
}
.document-topbar .doc-button { white-space: nowrap; }
@media (max-width: 1260px) {
  .document-topbar { grid-template-columns: 210px minmax(0, 1fr) max-content !important; padding-inline: 22px !important; }
  .document-topbar .document-switcher a { padding-inline: 10px; }
}
@media (max-width: 1050px) {
  .document-topbar { grid-template-columns: minmax(0, 1fr) max-content !important; }
  .document-topbar .document-switcher { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
}
@media (max-width: 650px) {
  .document-topbar { padding-inline: 14px !important; }
  .document-topbar .document-brand > span:last-child { display: none; }
  .document-topbar .document-switcher { width: 100%; overflow-x: auto; justify-content: flex-start; }
  .document-topbar .document-actions .doc-button:not(.primary) { display: none; }
}

/* Owner console */
body.owner-admin-page { color: var(--ink) !important; background: var(--canvas) !important; }
.owner-shell { background: #fff !important; }
.owner-sidebar { color: var(--ink) !important; background: #fff !important; border-right: 1px solid var(--line) !important; }
.owner-brand { color: var(--ink) !important; }
.owner-brand-mark { color: #fff !important; background: var(--green) !important; }
.owner-label { color: #9aa5b8 !important; }
.owner-nav a { color: #7b879b !important; }
.owner-nav a.active, .owner-nav a:hover { color: var(--green) !important; background: var(--green-soft) !important; }
.owner-side-footer { color: var(--muted) !important; border-color: var(--line) !important; }
.owner-main { background: #f9fbfd !important; }
.owner-topbar { border-color: var(--line) !important; }
.owner-topbar small, .owner-heading p, .owner-card > p, .owner-metric span, .owner-metric small, .owner-list-row small, .owner-table th, .owner-empty, .owner-hint { color: var(--muted) !important; }
.owner-heading h1, .owner-card h2, .owner-metric strong { color: var(--ink) !important; }
.owner-button, .owner-exit { color: var(--green) !important; border-color: var(--line) !important; background: #fff !important; }
.owner-button.primary, .owner-tabs button.active { color: #fff !important; border-color: var(--green) !important; background: var(--green) !important; }
.owner-tabs, .owner-card, .owner-metric, .owner-table-wrap { border-color: var(--line) !important; background: #fff !important; }
.owner-tabs button { color: var(--muted) !important; }
.owner-avatar, .owner-pill { color: #3b9b6c !important; background: #e4f8ed !important; }
.owner-pill.paused { color: #9b6a21 !important; background: #fff2d4 !important; }
.owner-form input, .owner-form select, .owner-table select, .owner-table button { color: var(--ink) !important; border-color: var(--line) !important; background: var(--soft) !important; }

/* Public landing page */
body.landing-page { color: #273047 !important; background: #eef8fa !important; }
.landing-page .landing-nav, .landing-page .landing-hero, .landing-page .logo-strip, .landing-page .landing-footer { color: #273047 !important; }
.landing-page .landing-links, .landing-page .landing-actions, .landing-page .hero-lede, .landing-page .section-intro > p:last-child, .landing-page .feature-copy > p:not(.landing-kicker), .landing-page .landing-footer { color: #7c879b !important; }
.landing-page .landing-kicker { color: #697492 !important; }
.landing-page .logo-glyph { border-color: #1c807b !important; color: #1c807b !important; }
.landing-page .landing-links a:hover, .landing-page .landing-actions > a:first-child:hover { color: #1c807b !important; }
.landing-page .landing-button-dark { color: #fff !important; background: #1c807b !important; }
.landing-page .landing-button-dark:hover { color: #fff !important; background: #16736e !important; }
.landing-page .landing-button-light { color: #273047 !important; background: #fff !important; border-color: #e4e9f2 !important; }
.landing-page .hero-copy h1, .landing-page .section-intro h2, .landing-page .feature-copy h2, .landing-page .final-cta h2 { color: #273047 !important; }
.landing-page .hero-copy h1 em, .landing-page .section-intro h2 em, .landing-page .feature-copy h2 em { color: #1c807b !important; }
.landing-page .dashboard-frame { border-color: #e4e9f2 !important; background: #fff !important; box-shadow: 0 30px 75px rgba(28,76,61,.14) !important; }
.landing-page .preview-sidebar { color: #7c879b !important; background: #f7f9fd !important; border-color: #e4e9f2 !important; }
.landing-page .preview-brand, .landing-page .preview-heading h2, .landing-page .team-line b { color: #273047 !important; }
.landing-page .preview-active { color: #1c807b !important; background: #d7f0ec !important; }
.landing-page .preview-main, .landing-page .preview-card, .landing-page .ui-panel, .landing-page .calendar-panel, .landing-page .price-card { background: #fff !important; border-color: #e4e9f2 !important; }
.landing-page .preview-card-dark, .landing-page .quote-panel { color: #fff !important; background: linear-gradient(135deg,#176f69,#2aa7a0) !important; border-color: transparent !important; }
.landing-page .preview-card-dark small, .landing-page .preview-card-dark > span { color: rgba(255,255,255,.75) !important; }
.landing-page .mini-bars i, .landing-page .mini-calendar b { background: #ff9d91 !important; }
.landing-page .status-pill { color: #3b9b6c !important; background: #e4f8ed !important; }
.landing-page .logo-strip { border-color: #e4e9f2 !important; }
.landing-page .workflow-rail, .landing-page .workflow-step, .landing-page .faq-list, .landing-page details { border-color: #e4e9f2 !important; }
.landing-page .workflow-step:before { border-color: #eef8fa !important; background: #bfeeda !important; }
.landing-page .workflow-step.active:before { background: #1c807b !important; }
.landing-page .lead-dot { background: #ff9d91 !important; }
.landing-page .lead-dot.teal { background: #70d9ad !important; }
.landing-page .lead-dot.plum { background: #2aa7a0 !important; }
.landing-page .contract-panel { background: #e5f8ef !important; }
.landing-page .invoice-panel { background: #fff2df !important; }
.landing-page .calendar-story { color: #fff !important; background: #273047 !important; }
.landing-page .calendar-story .section-intro h2 { color: #fff !important; }
.landing-page .calendar-story .section-intro > p:last-child { color: #c9d2e7 !important; }
.landing-page .calendar-panel { color: #273047 !important; }
.landing-page .calendar-dates > b { background: #1c807b !important; }
.landing-page .price-card.recommended { color: #fff !important; background: #1c807b !important; border-color: #1c807b !important; }
.landing-page .price-card.recommended > span, .landing-page .price-card.recommended ul { color: #d7f0ec !important; }
.landing-page .price-card.recommended .price-link { border-color: rgba(255,255,255,.28) !important; }
.landing-page .final-cta { color: #fff !important; background: #1c807b !important; }
.landing-page .final-cta h2, .landing-page .final-cta .landing-kicker { color: #fff !important; }

/* Auth / onboarding */
body.auth-page, body[data-auth-page] { color: #273047 !important; background: #eef8fa !important; }
.auth-art { color: #fff !important; background: linear-gradient(145deg,#176f69,#2aa7a0) !important; }
.auth-art-copy p { color: #e1e2ff !important; }
.auth-art-copy h1 { color: #fff !important; }
.auth-art-copy h1 em { color: #ffd56b !important; }
.auth-art-foot, .auth-card > p, .auth-meta, .auth-footer { color: #7c879b !important; }
.auth-form-side, .auth-card { background: #fff !important; }
.auth-card h1, .auth-meta a, .auth-footer a { color: #273047 !important; }
.auth-field { color: #697492 !important; }
.auth-field input, .auth-field select, .auth-field textarea, .auth-google { color: #273047 !important; border-color: #e4e9f2 !important; background: #f7f9fd !important; }
.auth-primary { color: #fff !important; background: #1c807b !important; }
.auth-primary:hover { background: #16736e !important; }
.auth-divider, .auth-error { color: #9aa5b8 !important; }
.auth-divider:before, .auth-divider:after { background: #e4e9f2 !important; }
.setup-step { background: #e4e9f2 !important; }
.setup-step.active { background: #1c807b !important; }
.setup-note { color: #697492 !important; border-color: #1c807b !important; background: #d7f0ec !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* Theme switch */
.theme-toggle {
  min-height: 38px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
  transition: transform 180ms ease, background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}
.app-shell, .sidebar, .main, .topbar, .document-app, .document-topbar, .owner-main, .owner-sidebar,
.panel, .metric-card, .next-event-card, .settings-panel, .editor-card, .control-card, .owner-card,
.auth-form-side, .auth-card {
  transition: background-color 260ms ease, color 220ms ease, border-color 220ms ease, box-shadow 260ms ease;
}
.theme-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle:hover { color: #fff; background: var(--green); border-color: var(--green); }
.theme-toggle.is-pressing { transform: scale(.96); }
.document-actions .theme-toggle, .studio-actions .theme-toggle, .owner-actions .theme-toggle { order: -1; }
.auth-card .theme-toggle { margin: 0 0 24px auto; }
.search-empty { margin: 0; padding: 24px 12px; color: var(--muted); font-size: 11px; text-align: center; }

html[data-theme="dark"] {
  --canvas: #101522 !important;
  --sidebar: #171d2c !important;
  --white: #1a2132 !important;
  --ink: #edf1ff !important;
  --ink-deep: #ffffff !important;
  --muted: #9aa6be !important;
  --soft: #20283a !important;
  --line: #303a50 !important;
  --mimosa: #ffcf70 !important;
  --mimosa-soft: #403923 !important;
  --teal-soft: #8ddcb8 !important;
  --green: #43c1b6 !important;
  --green-2: #2aa7a0 !important;
  --green-soft: #292743 !important;
  --lime: #b9f1ce !important;
  --paper: #101522 !important;
  --paper-deep: #20283a !important;
  --surface: #1a2132 !important;
  --surface-soft: #20283a !important;
  --evergreen: #43c1b6 !important;
  --moss: #aab4ca !important;
  --ochre: #ffbd7c !important;
  --clay: #ff9d91 !important;
  --shadow: 0 24px 60px rgba(0,0,0,.28) !important;
  color-scheme: dark;
}

html[data-theme="dark"] body:not(.landing-page):not(.auth-page):not(.owner-admin-page),
html[data-theme="dark"] .main,
html[data-theme="dark"] .owner-main { color: var(--ink) !important; background: #121827 !important; }
html[data-theme="dark"] .app-shell { background: #101522 !important; border-color: #20283a !important; box-shadow: var(--shadow) !important; }
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .app-shell > .sidebar,
html[data-theme="dark"] .owner-sidebar { color: var(--ink) !important; background: #171d2c !important; border-color: var(--line) !important; }
html[data-theme="dark"] .brand,
html[data-theme="dark"] .nav-item,
html[data-theme="dark"] .owner-brand { color: var(--ink) !important; }
html[data-theme="dark"] .nav-item { color: #aab4ca !important; }
html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .nav-item.active,
html[data-theme="dark"] .owner-nav a.active,
html[data-theme="dark"] .owner-nav a:hover { color: #fff !important; background: #292743 !important; }
html[data-theme="dark"] .nav-item.active::before { background: var(--green) !important; }
html[data-theme="dark"] .nav-label,
html[data-theme="dark"] .owner-label { color: #7f8ca7 !important; }
html[data-theme="dark"] .profile-card { background: #20283a !important; border-color: var(--line) !important; }
html[data-theme="dark"] .profile-card strong { color: #fff !important; }
html[data-theme="dark"] .profile-card span { color: #9aa6be !important; }
html[data-theme="dark"] .sidebar-footer,
html[data-theme="dark"] .owner-side-footer { border-color: var(--line) !important; }
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .owner-topbar,
html[data-theme="dark"] .document-topbar,
html[data-theme="dark"] .studio-topbar { background: rgba(18,24,39,.9) !important; border-color: var(--line) !important; }
html[data-theme="dark"] .search,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .doc-button,
html[data-theme="dark"] .back-button,
html[data-theme="dark"] .owner-button,
html[data-theme="dark"] .owner-exit { color: var(--ink) !important; background: #20283a !important; border-color: var(--line) !important; }
html[data-theme="dark"] .search input { color: var(--ink) !important; }
html[data-theme="dark"] .search kbd { color: var(--muted) !important; background: #293247 !important; border-color: var(--line) !important; }
html[data-theme="dark"] .icon-button:hover,
html[data-theme="dark"] .round-button:hover,
html[data-theme="dark"] .theme-toggle:hover { color: #fff !important; background: var(--green) !important; }
html[data-theme="dark"] .page-heading h1,
html[data-theme="dark"] .settings-heading h1,
html[data-theme="dark"] .document-heading h1,
html[data-theme="dark"] .studio-heading h1,
html[data-theme="dark"] .owner-heading h1,
html[data-theme="dark"] .owner-card h2,
html[data-theme="dark"] .owner-metric strong { color: #fff !important; }
html[data-theme="dark"] .page-heading > div > p:last-child,
html[data-theme="dark"] .settings-heading > div > p:last-child,
html[data-theme="dark"] .document-heading p,
html[data-theme="dark"] .owner-heading p,
html[data-theme="dark"] .owner-card > p { color: var(--muted) !important; }
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .next-event-card,
html[data-theme="dark"] .settings-panel,
html[data-theme="dark"] .settings-nav,
html[data-theme="dark"] .editor-card,
html[data-theme="dark"] .control-card,
html[data-theme="dark"] .template-rail,
html[data-theme="dark"] .owner-tabs,
html[data-theme="dark"] .owner-card,
html[data-theme="dark"] .owner-metric,
html[data-theme="dark"] .owner-table-wrap { color: var(--ink) !important; background: #1a2132 !important; border-color: var(--line) !important; }
html[data-theme="dark"] .metric-card:first-child,
html[data-theme="dark"] .activity-card,
html[data-theme="dark"] .event-focus-card { color: #fff !important; background: linear-gradient(135deg,#1c807b,#2aa7a0) !important; }
html[data-theme="dark"] .metric-card:nth-child(2) { background: #292743 !important; }
html[data-theme="dark"] .metric-card:nth-child(3) { background: #203b36 !important; }
html[data-theme="dark"] .metric-card:nth-child(4) { background: #403923 !important; }
html[data-theme="dark"] .metric-card small,
html[data-theme="dark"] .metric-card em,
html[data-theme="dark"] .owner-metric span,
html[data-theme="dark"] .owner-metric small,
html[data-theme="dark"] .owner-list-row small { color: var(--muted) !important; }
html[data-theme="dark"] .metric-card:first-child small,
html[data-theme="dark"] .metric-card:first-child em { color: rgba(255,255,255,.8) !important; }
html[data-theme="dark"] .event-filters,
html[data-theme="dark"] .range-switcher,
html[data-theme="dark"] .document-switcher,
html[data-theme="dark"] .studio-tabs { background: #20283a !important; border-color: var(--line) !important; }
html[data-theme="dark"] .date-tile { color: #8bd9cb !important; background: #292743 !important; }
html[data-theme="dark"] .event-details,
html[data-theme="dark"] .action-list a:hover { background: #20283a !important; }
html[data-theme="dark"] .settings-panel input,
html[data-theme="dark"] .settings-panel textarea,
html[data-theme="dark"] .settings-panel select,
html[data-theme="dark"] .editor-grid input,
html[data-theme="dark"] .editor-grid select,
html[data-theme="dark"] .editor-grid textarea,
html[data-theme="dark"] .editor-item,
html[data-theme="dark"] .event-function,
html[data-theme="dark"] .timeline-editor input,
html[data-theme="dark"] .deliverable-editor label,
html[data-theme="dark"] .addon-grid label,
html[data-theme="dark"] .quote-image-grid label,
html[data-theme="dark"] .control-body input[type=text],
html[data-theme="dark"] .control-body input:not([type]),
html[data-theme="dark"] .control-body textarea,
html[data-theme="dark"] .control-body select,
html[data-theme="dark"] .owner-form input,
html[data-theme="dark"] .owner-form select,
html[data-theme="dark"] .owner-table select,
html[data-theme="dark"] .owner-table button { color: var(--ink) !important; background: #20283a !important; border-color: var(--line) !important; }
html[data-theme="dark"] .document-app,
html[data-theme="dark"] .brand-studio { background: #101522 !important; }
html[data-theme="dark"] .paper-stage,
html[data-theme="dark"] .studio-preview { background: #20283a !important; }
html[data-theme="dark"] .document-paper,
html[data-theme="dark"] .full-document { color: #273047 !important; background: #f8f9fc !important; }
html[data-theme="dark"] .branding-strip { background: #1c807b !important; }
html[data-theme="dark"] .usage-rail { color: var(--ink) !important; background: #1a2132 !important; border-color: var(--line) !important; }
html[data-theme="dark"] .usage-meter { background: #20283a !important; border-color: var(--line) !important; }
html[data-theme="dark"] .owner-tabs button { color: var(--muted) !important; }
html[data-theme="dark"] .owner-tabs button.active { color: #fff !important; background: var(--green) !important; }
html[data-theme="dark"] body[data-auth-page] { color: var(--ink) !important; background: #101522 !important; }
html[data-theme="dark"] body[data-auth-page] .auth-form-side,
html[data-theme="dark"] body[data-auth-page] .auth-card { color: var(--ink) !important; background: #1a2132 !important; }
html[data-theme="dark"] body[data-auth-page] .auth-card h1,
html[data-theme="dark"] body[data-auth-page] .auth-meta a,
html[data-theme="dark"] body[data-auth-page] .auth-footer a { color: #fff !important; }
html[data-theme="dark"] body[data-auth-page] .auth-card > p,
html[data-theme="dark"] body[data-auth-page] .auth-meta,
html[data-theme="dark"] body[data-auth-page] .auth-footer { color: var(--muted) !important; }
html[data-theme="dark"] body[data-auth-page] .auth-field input,
html[data-theme="dark"] body[data-auth-page] .auth-field select,
html[data-theme="dark"] body[data-auth-page] .auth-field textarea,
html[data-theme="dark"] body[data-auth-page] .auth-google { color: var(--ink) !important; background: #20283a !important; border-color: var(--line) !important; }

/* Page-specific translucent cards need explicit dark materials. */
html[data-theme="dark"] .quote-card,
html[data-theme="dark"] .quote-card-header,
html[data-theme="dark"] .quotation-page .quote-card,
html[data-theme="dark"] .quotation-page .event-card,
html[data-theme="dark"] .quotation-page .deliverables-card,
html[data-theme="dark"] .quotation-page .terms-card,
html[data-theme="dark"] .quotation-page .quote-preview { color: var(--ink) !important; background: #1a2132 !important; border-color: var(--line) !important; }
html[data-theme="dark"] .quotation-page .quote-card h2,
html[data-theme="dark"] .quotation-page .quote-card-header h2 { color: #fff !important; }
html[data-theme="dark"] .quotation-page .quote-card p,
html[data-theme="dark"] .quotation-page .quote-card label { color: var(--muted) !important; }
html[data-theme="dark"] .quotation-page .quote-preview .preview-toolbar { color: var(--ink) !important; background: #20283a !important; border-color: var(--line) !important; }

html[data-theme="dark"] .crew-form-card,
html[data-theme="dark"] .crew-list-card,
html[data-theme="dark"] .crew-row,
html[data-theme="dark"] .project-summary > article,
html[data-theme="dark"] .project-list-panel,
html[data-theme="dark"] .project-row,
html[data-theme="dark"] .calendar-summary article,
html[data-theme="dark"] .year-calendar,
html[data-theme="dark"] .calendar-month,
html[data-theme="dark"] .calendar-project,
html[data-theme="dark"] .financial-controls,
html[data-theme="dark"] .financial-years-card,
html[data-theme="dark"] .costing-summary article,
html[data-theme="dark"] .financial-year,
html[data-theme="dark"] .assignment-card,
html[data-theme="dark"] .event-details-card,
html[data-theme="dark"] .assignment-side,
html[data-theme="dark"] .financial-card,
html[data-theme="dark"] .assignment-total,
html[data-theme="dark"] .date-strip { color: var(--ink) !important; background: #1a2132 !important; border-color: var(--line) !important; }
html[data-theme="dark"] .crew-form-card h2,
html[data-theme="dark"] .crew-list-head h2,
html[data-theme="dark"] .projects-heading h1,
html[data-theme="dark"] .project-list-head h2,
html[data-theme="dark"] .calendar-heading h1,
html[data-theme="dark"] .year-calendar-head h2,
html[data-theme="dark"] .costing-heading h1,
html[data-theme="dark"] .costing-table-head h2,
html[data-theme="dark"] .assignment-card h2,
html[data-theme="dark"] .financial-card h2 { color: #fff !important; }
html[data-theme="dark"] .crew-form-grid input,
html[data-theme="dark"] .crew-form-grid select,
html[data-theme="dark"] .project-form-grid input,
html[data-theme="dark"] .project-form-grid select,
html[data-theme="dark"] .financial-year-picker select,
html[data-theme="dark"] .event-details-card input,
html[data-theme="dark"] .financial-card input { color: var(--ink) !important; background: #20283a !important; border-color: var(--line) !important; }
html[data-theme="dark"] .project-row:hover,
html[data-theme="dark"] .project-row.active,
html[data-theme="dark"] .calendar-project:hover { color: #fff !important; background: #292743 !important; }
html[data-theme="dark"] .project-detail,
html[data-theme="dark"] .calendar-detail,
html[data-theme="dark"] .project-summary > a,
html[data-theme="dark"] .costing-summary .profit-card,
html[data-theme="dark"] .assignment-total { color: #fff !important; background: linear-gradient(145deg,#173d31,#1c807b) !important; border-color: #2aa7a0 !important; }
html[data-theme="dark"] .project-detail h2,
html[data-theme="dark"] .calendar-detail h2,
html[data-theme="dark"] .project-detail dd,
html[data-theme="dark"] .calendar-detail dd { color: #fff !important; }
html[data-theme="dark"] .project-detail time span,
html[data-theme="dark"] .detail-location,
html[data-theme="dark"] .calendar-detail time,
html[data-theme="dark"] .calendar-detail > span { color: #c6cce0 !important; }
html[data-theme="dark"] .project-list-head > span,
html[data-theme="dark"] .calendar-summary article,
html[data-theme="dark"] .year-calendar-head > span,
html[data-theme="dark"] .financial-year-trigger,
html[data-theme="dark"] .financial-year-trigger small { color: var(--muted) !important; }
html[data-theme="dark"] .project-row time,
html[data-theme="dark"] .project-detail time strong,
html[data-theme="dark"] .calendar-project time,
html[data-theme="dark"] .financial-year-plus { color: #8bd9cb !important; background: #292743 !important; border-color: #2aa7a0 !important; }
html[data-theme="dark"] .access-plan-card,
html[data-theme="dark"] .access-summary-compact,
html[data-theme="dark"] .invite-panel,
html[data-theme="dark"] .permission-card,
html[data-theme="dark"] .plan-card,
html[data-theme="dark"] .member-row,
html[data-theme="dark"] .workflow-card,
html[data-theme="dark"] .workflow-aside-card,
html[data-theme="dark"] .role-review-row,
html[data-theme="dark"] .member-card,
html[data-theme="dark"] .roster-panel,
html[data-theme="dark"] .team-summary,
html[data-theme="dark"] .team-summary-focus,
html[data-theme="dark"] .team-workspace,
html[data-theme="dark"] .event-card,
html[data-theme="dark"] .event-summary,
html[data-theme="dark"] .role-row,
html[data-theme="dark"] .role-person-row,
html[data-theme="dark"] .event-total-row,
html[data-theme="dark"] .calendar-day,
html[data-theme="dark"] .calendar-disclaimer,
html[data-theme="dark"] .deliverable-row,
html[data-theme="dark"] .event-row,
html[data-theme="dark"] .timeline-row,
html[data-theme="dark"] .quote-save-row { color: var(--ink) !important; background: #1a2132 !important; border-color: var(--line) !important; }
html[data-theme="dark"] .plan-card,
html[data-theme="dark"] .workflow-card-heading,
html[data-theme="dark"] .event-card-header { border-color: var(--line) !important; }
html[data-theme="dark"] .calendar-day:hover,
html[data-theme="dark"] .calendar-day.is-selected,
html[data-theme="dark"] .role-row:hover,
html[data-theme="dark"] .member-row:hover { background: #292743 !important; }

@media (max-width: 600px) {
  .theme-toggle { width: 38px; padding: 0; }
  .theme-toggle span { display: none; }
}

/* Secondary surfaces: keep every workspace view coherent in dark mode. */
html[data-theme="dark"] .settings-nav button.active {
  color: #f5f7ff !important;
  background: #292743 !important;
  border-color: #45406f !important;
}
html[data-theme="dark"] .settings-nav button.active span:first-child,
html[data-theme="dark"] .settings-nav button span:first-child { color: #9b91ff !important; }
html[data-theme="dark"] .invite-panel,
html[data-theme="dark"] .permission-card,
html[data-theme="dark"] .permission-grid > div,
html[data-theme="dark"] .integration-config,
html[data-theme="dark"] .workflow-card,
html[data-theme="dark"] .workflow-aside-note,
html[data-theme="dark"] .editor-card,
html[data-theme="dark"] .editor-event,
html[data-theme="dark"] .editor-totals div,
html[data-theme="dark"] .costing-summary article,
html[data-theme="dark"] .financial-years-card,
html[data-theme="dark"] .financial-chart,
html[data-theme="dark"] .financial-ledger,
html[data-theme="dark"] .financial-project-table,
html[data-theme="dark"] .member-card,
html[data-theme="dark"] .assignment-progress,
html[data-theme="dark"] .role-row,
html[data-theme="dark"] .event-context {
  color: #edf1ff !important;
  background: #1a2132 !important;
  border-color: #303a50 !important;
}
html[data-theme="dark"] .permission-grid > div { background: #20283a !important; }
html[data-theme="dark"] .integration-grid article {
  color: #edf1ff !important;
  background: #1a2132 !important;
  border-color: #303a50 !important;
}
html[data-theme="dark"] .integration-grid article button.connected {
  color: #b9f1ce !important;
  background: #203b36 !important;
  border-color: #3b6f5a !important;
}
html[data-theme="dark"] .invite-fields input,
html[data-theme="dark"] .invite-fields select,
html[data-theme="dark"] .integration-config input,
html[data-theme="dark"] .integration-config select,
html[data-theme="dark"] .workflow-grid input,
html[data-theme="dark"] .workflow-grid select,
html[data-theme="dark"] .workflow-grid textarea,
html[data-theme="dark"] .editor-grid input,
html[data-theme="dark"] .editor-grid select,
html[data-theme="dark"] .editor-grid textarea,
html[data-theme="dark"] .event-title-fields input,
html[data-theme="dark"] .role-row input,
html[data-theme="dark"] .role-row select,
html[data-theme="dark"] .financial-year-picker select {
  color: #edf1ff !important;
  background: #20283a !important;
  border-color: #3a465f !important;
}
html[data-theme="dark"] .workflow-grid label,
html[data-theme="dark"] .field,
html[data-theme="dark"] .event-title-fields label,
html[data-theme="dark"] .role-row label,
html[data-theme="dark"] .integration-config label { color: #aab4ca !important; }
html[data-theme="dark"] .switch i {
  background: #303a50 !important;
  border-color: #45516a !important;
}
html[data-theme="dark"] .switch i::after { background: #edf1ff !important; }
html[data-theme="dark"] .switch input:checked + i { background: #2aa7a0 !important; }
html[data-theme="dark"] .costing-summary .profit-card {
  color: #f5f7ff !important;
  background: linear-gradient(145deg, #302b70, #403a89) !important;
}
html[data-theme="dark"] .costing-summary .profit-card strong { color: #f5f7ff !important; }
html[data-theme="dark"] .financial-chart,
html[data-theme="dark"] .financial-ledger { background: #20283a !important; }
html[data-theme="dark"] .financial-project-table th { color: #aab4ca !important; background: #20283a !important; }
html[data-theme="dark"] .financial-project-table td { color: #edf1ff !important; background: #1a2132 !important; border-color: #303a50 !important; }
html[data-theme="dark"] .financial-year-trigger:hover { background: #20283a !important; }
html[data-theme="dark"] .event-context { background: #203b36 !important; border-color: #3b6f5a !important; }
html[data-theme="dark"] .event-context small { color: #aab4ca !important; }
html[data-theme="dark"] .assignment-progress { background: #203b36 !important; }
html[data-theme="dark"] .role-row.is-open { background: #20283a !important; border-color: #45406f !important; }
html[data-theme="dark"] .member-card:hover,
html[data-theme="dark"] .member-card.active { background: #292743 !important; border-color: #2aa7a0 !important; }
html[data-theme="dark"] .crew-form-card,
html[data-theme="dark"] .crew-list-card,
html[data-theme="dark"] .crew-row,
html[data-theme="dark"] .project-form-card,
html[data-theme="dark"] .project-list-card,
html[data-theme="dark"] .event-details-card,
html[data-theme="dark"] .financial-card,
html[data-theme="dark"] .financial-controls {
  color: #edf1ff !important;
  background: #1a2132 !important;
  border-color: #303a50 !important;
}
html[data-theme="dark"] .crew-row { background: #20283a !important; }
html[data-theme="dark"] .crew-avatar { color: #edf1ff !important; background: #292743 !important; }
/* Controls that are authored in page modules (and therefore miss the base button rule). */
html[data-theme="dark"] .costing-privacy-toggle,
html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .dialog-actions .secondary-button,
html[data-theme="dark"] .editor-actions .secondary-button,
html[data-theme="dark"] .add-date-button {
  color: #8bd9cb !important;
  background: #20283a !important;
  border-color: #4a5570 !important;
}
html[data-theme="dark"] .costing-privacy-toggle:hover,
html[data-theme="dark"] .secondary-button:hover,
html[data-theme="dark"] .dialog-actions .secondary-button:hover,
html[data-theme="dark"] .editor-actions .secondary-button:hover,
html[data-theme="dark"] .add-date-button:hover {
  color: #fff !important;
  background: #292743 !important;
  border-color: #2aa7a0 !important;
}
html[data-theme="dark"] .costing-privacy-toggle.revealed {
  color: #fff !important;
  background: #1c807b !important;
  border-color: #43c1b6 !important;
}
html[data-theme="dark"] .notification-type,
html[data-theme="dark"] .assignment-state.ready,
html[data-theme="dark"] .project-status.ready {
  color: #b9f1ce !important;
  background: #203b36 !important;
}
html[data-theme="dark"] .assignment-state.attention,
html[data-theme="dark"] .project-status.attention {
  color: #f6d18d !important;
  background: #403923 !important;
}
html[data-theme="dark"] .calendar-day.assigned {
  color: #8bd9cb !important;
  background: #292743 !important;
}
html[data-theme="dark"] .calendar-day.assigned:hover { background: #3a356c !important; }
html[data-theme="dark"] .calendar-project time,
html[data-theme="dark"] .project-row time { box-shadow: inset 0 0 0 1px #4a5570; }
html[data-theme="dark"] .notification-popover {
  color: #edf1ff !important;
  background: #1a2132 !important;
  border-color: #303a50 !important;
  box-shadow: 0 18px 45px rgba(0,0,0,.32) !important;
}
html[data-theme="dark"] .notification-item:hover { background: #20283a !important; }
html[data-theme="dark"] .notification-head button { color: #8bd9cb !important; }
html[data-theme="dark"] .settings-status { color: #b9f1ce !important; background: #203b36 !important; }
html[data-theme="dark"] .event-tag.wedding,
html[data-theme="dark"] .event-tag.pre-wedding,
html[data-theme="dark"] .event-tag.engagement,
html[data-theme="dark"] .event-tag.corporate,
html[data-theme="dark"] .event-tag.portrait,
html[data-theme="dark"] .event-tag.maternity,
html[data-theme="dark"] .event-tag.roka,
html[data-theme="dark"] .event-tag.reception,
html[data-theme="dark"] .event-tag.custom {
  color: #8bd9cb !important;
  background: #292743 !important;
}
html[data-theme="dark"] .assignment-filter,
html[data-theme="dark"] .role-filter { background: #20283a !important; border-color: #3a465f !important; }
html[data-theme="dark"] .assignment-filter button.active,
html[data-theme="dark"] .role-filter button.active { color: #fff !important; background: #1c807b !important; }
html[data-theme="dark"] .assignment-row:hover,
html[data-theme="dark"] .assignment-row.active { background: #292743 !important; }
html[data-theme="dark"] .assignment-detail-head button { color: #aab4ca !important; background: #20283a !important; }
html[data-theme="dark"] .assign-role-button { color: #8bd9cb !important; border-color: #2aa7a0 !important; }
html[data-theme="dark"] .role-assignment.empty i { color: #f6d18d !important; background: #403923 !important; }
html[data-theme="dark"] .role-assignment.empty b { color: #f6d18d !important; }

/* Saved document workspaces: page-local cards and filters must use the dark
   workspace material instead of their light-mode paper defaults. */
html[data-theme="dark"] .saved-quotations-page .saved-filters,
html[data-theme="dark"] .saved-contracts-page .saved-filters,
html[data-theme="dark"] .saved-invoices-page .saved-filters {
  color: var(--ink) !important;
  background: #1a2132 !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .saved-quotations-page .saved-filter,
html[data-theme="dark"] .saved-contracts-page .saved-filter,
html[data-theme="dark"] .saved-invoices-page .saved-filter,
html[data-theme="dark"] .saved-quotations-page .saved-action,
html[data-theme="dark"] .saved-contracts-page .saved-action,
html[data-theme="dark"] .saved-invoices-page .saved-action {
  color: #8bd9cb !important;
  background: #20283a !important;
  border-color: #4a5570 !important;
}
html[data-theme="dark"] .saved-quotations-page .saved-filter:hover,
html[data-theme="dark"] .saved-quotations-page .saved-filter.active,
html[data-theme="dark"] .saved-contracts-page .saved-filter:hover,
html[data-theme="dark"] .saved-contracts-page .saved-filter.active,
html[data-theme="dark"] .saved-invoices-page .saved-filter:hover,
html[data-theme="dark"] .saved-invoices-page .saved-filter.active {
  color: #fff !important;
  background: var(--green) !important;
  border-color: var(--green) !important;
}
html[data-theme="dark"] .saved-quotations-page .saved-quote-card,
html[data-theme="dark"] .saved-quotations-page .saved-empty,
html[data-theme="dark"] .saved-contracts-page .saved-card,
html[data-theme="dark"] .saved-invoices-page .saved-card {
  color: var(--ink) !important;
  background: #1a2132 !important;
  border-color: var(--line) !important;
  box-shadow: 0 12px 34px rgba(0,0,0,.18) !important;
}
html[data-theme="dark"] .saved-quotations-page .saved-quote-card h2,
html[data-theme="dark"] .saved-quotations-page .saved-empty h2,
html[data-theme="dark"] .saved-contracts-page .saved-card h2,
html[data-theme="dark"] .saved-invoices-page .saved-card h2 {
  color: #fff !important;
}
html[data-theme="dark"] .saved-quotations-page .saved-quote-card p,
html[data-theme="dark"] .saved-quotations-page .saved-date,
html[data-theme="dark"] .saved-quotations-page .saved-byline,
html[data-theme="dark"] .saved-quotations-page .saved-empty p,
html[data-theme="dark"] .saved-contracts-page .saved-card p,
html[data-theme="dark"] .saved-contracts-page .saved-date,
html[data-theme="dark"] .saved-contracts-page .saved-byline,
html[data-theme="dark"] .saved-invoices-page .saved-card p,
html[data-theme="dark"] .saved-invoices-page .saved-date,
html[data-theme="dark"] .saved-invoices-page .saved-byline {
  color: var(--muted) !important;
}
html[data-theme="dark"] .saved-quotations-page .saved-action.primary,
html[data-theme="dark"] .saved-contracts-page .saved-action.primary,
html[data-theme="dark"] .saved-invoices-page .saved-action.primary {
  color: #fff !important;
  background: var(--green) !important;
  border-color: var(--green) !important;
}
html[data-theme="dark"] .saved-quotations-page .saved-status,
html[data-theme="dark"] .saved-contracts-page .saved-status,
html[data-theme="dark"] .saved-invoices-page .saved-status {
  color: #b9f1ce !important;
  background: #203b36 !important;
}
html[data-theme="dark"] .saved-quotations-page .saved-status:not(.sent) {
  color: #f6d18d !important;
  background: #403923 !important;
}

/* Remaining workspace modules with light-only declarations. These selectors
   deliberately exclude the landing page and the client-facing paper preview. */
html[data-theme="dark"] .events-list-panel,
html[data-theme="dark"] .event-detail-card,
html[data-theme="dark"] .event-summary-card,
html[data-theme="dark"] .generator-card,
html[data-theme="dark"] .inquiry-panel,
html[data-theme="dark"] .quotation-style-card,
html[data-theme="dark"] .danger-zone,
html[data-theme="dark"] .settings-panel .integration-config {
  color: var(--ink) !important;
  background: #1a2132 !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .event-card,
html[data-theme="dark"] .inquiry-chips span,
html[data-theme="dark"] .generator-card button,
html[data-theme="dark"] .inquiry-panel button:not(.extract-inquiry-button),
html[data-theme="dark"] .quotation-style-card.is-selected {
  color: var(--ink) !important;
  background: #20283a !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] .event-card:hover,
html[data-theme="dark"] .event-card.active,
html[data-theme="dark"] .generator-card:hover,
html[data-theme="dark"] .quotation-style-card:hover,
html[data-theme="dark"] .quotation-style-card.is-selected {
  background: #292743 !important;
  border-color: #2aa7a0 !important;
}
html[data-theme="dark"] .event-summary-card > strong,
html[data-theme="dark"] .event-detail-card h2,
html[data-theme="dark"] .generator-card h2,
html[data-theme="dark"] .inquiry-result-head strong,
html[data-theme="dark"] .quotation-style-card strong {
  color: #fff !important;
}
html[data-theme="dark"] .event-summary-card > p,
html[data-theme="dark"] .event-card-copy small,
html[data-theme="dark"] .event-card-copy em,
html[data-theme="dark"] .event-detail-card > p,
html[data-theme="dark"] .generator-card p,
html[data-theme="dark"] .inquiry-result-head span,
html[data-theme="dark"] .inquiry-error {
  color: var(--muted) !important;
}
html[data-theme="dark"] .calendar-mini li:nth-child(2),
html[data-theme="dark"] .calendar-mini li:nth-child(3),
html[data-theme="dark"] .calendar-mini li:nth-child(4) {
  color: #8bd9cb !important;
  background: #292743 !important;
}
html[data-theme="dark"] .detail-progress { background: #203b36 !important; }
html[data-theme="dark"] .detail-progress > span { background: #303a50 !important; }
html[data-theme="dark"] .detail-actions a { color: #8bd9cb !important; background: #20283a !important; border-color: #4a5570 !important; }
html[data-theme="dark"] .danger-zone { background: #302329 !important; border-color: #754d58 !important; }
html[data-theme="dark"] .usage-meter.is-blocked {
  color: var(--ink) !important;
  background: #302329 !important;
  border-color: #754d58 !important;
}
html[data-theme="dark"] .usage-meter.is-blocked .usage-meter-top strong {
  color: #f6d18d !important;
}
html[data-theme="dark"] .usage-toast {
  color: #f6d18d !important;
  background: #302329 !important;
  border-color: #754d58 !important;
  box-shadow: 0 18px 45px rgba(0,0,0,.32) !important;
}
