/* ============================================================================
   SmarterEventing — Light theme (token-gedreven)
   ============================================================================
   Alle kleuren komen uit theme_tokens.css (var(--se-*)). Dit bestand bevat
   uitsluitend structurele overrides die legacy dark-first markup naar het
   lichte thema mappen. Kleuren hier NOOIT hardcoden: pas theme_tokens.css aan.
   Werkt samen met kleurprofielen via html[data-color-profile].
   No dark-mode selectors are defined in this file. */
html.theme-light,
html.theme-light body {
  color-scheme: light;
  background: var(--se-page) !important;
  color: var(--se-text) !important;
}

html.theme-light body::before,
html.theme-light body::after { display: none !important; }

html.theme-light body,
html.theme-light body main,
html.theme-light body .content,
html.theme-light body .planning-layout {
  background: var(--se-page) !important;
  color: var(--se-text) !important;
}

html.theme-light body header,
html.theme-light body nav,
html.theme-light body .company-nav,
html.theme-light body .nav-header,
html.theme-light body .nav-sidebar,
html.theme-light body .toolbar,
html.theme-light body .calendar-toolbar,
html.theme-light body .planner-toolbar {
  background: var(--se-surface-2) !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
}

html.theme-light body .card,
html.theme-light body .panel,
html.theme-light body .modal-content,
html.theme-light body .modal-card,
html.theme-light body .profile-card,
html.theme-light body .module-card,
html.theme-light body .stat-card,
html.theme-light body .table-wrap,
html.theme-light body .table-container,
html.theme-light body .planner-panel,
html.theme-light body .planner-menu-section,
html.theme-light body .resource-section,
html.theme-light body .timeline-item-card,
html.theme-light body .timeline-time,
html.theme-light body .timeline-dropzone,
html.theme-light body .fc {
  background: var(--se-surface) !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
  box-shadow: var(--se-shadow-md) !important;
  background-image: none !important;
}

html.theme-light body h1,
html.theme-light body h2,
html.theme-light body h3,
html.theme-light body h4,
html.theme-light body h5,
html.theme-light body strong,
html.theme-light body .company-brand,
html.theme-light body .hero-title,
html.theme-light body .value,
html.theme-light body .timeline-item-title,
html.theme-light body .timeline-time strong {
  color: var(--se-text) !important;
}

html.theme-light body p,
html.theme-light body label,
html.theme-light body .mut,
html.theme-light body .muted,
html.theme-light body .small,
html.theme-light body .sub,
html.theme-light body .company-name,
html.theme-light body .hero-text,
html.theme-light body .resource-meta,
html.theme-light body .timeline-item-meta,
html.theme-light body .timeline-time span,
html.theme-light body .profile-form-grid label span {
  color: var(--se-text-muted) !important;
}

html.theme-light body input,
html.theme-light body select,
html.theme-light body textarea,
html.theme-light body .list-cell-input,
html.theme-light body .list-cell-select,
html.theme-light body .project-picker select {
  color-scheme: light;
  background: var(--se-input) !important;
  color: var(--se-text) !important;
  border: 1px solid var(--se-border) !important;
  box-shadow: none !important;
}

html.theme-light body input::placeholder,
html.theme-light body textarea::placeholder {
  color: var(--se-text-muted) !important;
  opacity: 1;
}

html.theme-light body input:focus,
html.theme-light body select:focus,
html.theme-light body textarea:focus,
html.theme-light body button:focus,
html.theme-light body a:focus {
  outline: 2px solid var(--se-accent) !important;
  outline-offset: 2px;
  border-color: var(--se-accent) !important;
}

html.theme-light body input[type="date"],
html.theme-light body input[type="time"],
html.theme-light body input[type="datetime-local"] {
  color: var(--se-text) !important;
  color-scheme: light;
}
html.theme-light body input[type="date"]::-webkit-calendar-picker-indicator,
html.theme-light body input[type="time"]::-webkit-calendar-picker-indicator,
html.theme-light body input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: .7;
}
html.theme-light body option { background: var(--se-surface); color: var(--se-text); }

html.theme-light body button,
html.theme-light body .btn,
html.theme-light body .link-btn,
html.theme-light body .company-nav-btn {
  background: var(--se-surface) !important;
  color: var(--se-text) !important;
  border: 1px solid var(--se-border) !important;
  box-shadow: none !important;
  background-image: none !important;
}
html.theme-light body button:hover,
html.theme-light body .btn:hover,
html.theme-light body .company-nav-btn:hover {
  background: var(--se-hover) !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body button.primary,
html.theme-light body .primary,
html.theme-light body .primary-action,
html.theme-light body .btn-primary,
html.theme-light body .theme-toggle button.active,
html.theme-light body .company-nav-btn.active {
  background: var(--se-primary) !important;
  color: var(--se-text-inverse) !important;
  border-color: var(--se-primary) !important;
}
html.theme-light body button.primary:hover,
html.theme-light body .primary:hover,
html.theme-light body .primary-action:hover,
html.theme-light body .btn-primary:hover {
  background: var(--se-primary-hover) !important;
  color: var(--se-text-inverse) !important;
  border-color: var(--se-primary-hover) !important;
}
html.theme-light body a,
html.theme-light body .breadcrumb-link { color: var(--se-primary) !important; }
html.theme-light body a:hover { color: var(--se-primary-hover) !important; }

html.theme-light body table th {
  background: var(--se-surface-2) !important;
  color: var(--se-text-muted) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body table td,
html.theme-light body table tr {
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body table tr:hover td { background: var(--se-hover) !important; }

html.theme-light body .hero-panel,
html.theme-light body .hero,
html.theme-light body .hero-card {
  background: var(--se-surface-2) !important;
  border-color: var(--se-border) !important;
  background-image: none !important;
}
html.theme-light body .hero-panel *,
html.theme-light body .hero *,
html.theme-light body .hero-card * { color: var(--se-text) !important; }

/* Homepage-specific surfaces override the legacy admin wow dashboard skin. */
html.theme-light body.admin-wow#index .home-hero,
html.theme-light body.admin-wow#index .home-section,
html.theme-light body.admin-wow#index .crm-stats,
html.theme-light body.admin-wow#index .home-focus-card,
html.theme-light body.admin-wow#index .home-weather-widget,
html.theme-light body.admin-wow#index .home-agenda-widget,
html.theme-light body.admin-wow#index .home-info-widget,
html.theme-light body.admin-wow#index .home-module-grid .card {
  background: var(--se-surface) !important;
  background-image: none !important;
  border-color: var(--se-border) !important;
  box-shadow: var(--se-shadow-md) !important;
  color: var(--se-text) !important;
}
html.theme-light body.admin-wow#index .home-hero::before,
html.theme-light body.admin-wow#index .home-hero::after,
html.theme-light body.admin-wow#index .home-section::before,
html.theme-light body.admin-wow#index .home-section::after,
html.theme-light body.admin-wow#index .crm-stats::before,
html.theme-light body.admin-wow#index .crm-stats::after,
html.theme-light body.admin-wow#index .home-focus-card::before,
html.theme-light body.admin-wow#index .home-focus-card::after,
html.theme-light body.admin-wow#index .home-weather-widget::before,
html.theme-light body.admin-wow#index .home-info-widget::before {
  display: none !important;
}
html.theme-light body.admin-wow#index .home-title-row h2,
html.theme-light body.admin-wow#index .home-title-row p,
html.theme-light body.admin-wow#index .home-section-head h3,
html.theme-light body.admin-wow#index .home-section-head p,
html.theme-light body.admin-wow#index .home-info-value,
html.theme-light body.admin-wow#index .home-info-kicker,
html.theme-light body.admin-wow#index .home-info-sub,
html.theme-light body.admin-wow#index .home-agenda-kicker,
html.theme-light body.admin-wow#index .home-agenda-date,
html.theme-light body.admin-wow#index .home-agenda-title,
html.theme-light body.admin-wow#index .home-agenda-sub,
html.theme-light body.admin-wow#index .home-focus-value,
html.theme-light body.admin-wow#index .home-focus-label,
html.theme-light body.admin-wow#index .home-focus-note,
html.theme-light body.admin-wow#index .home-module-grid .card h3,
html.theme-light body.admin-wow#index .home-module-grid .card p,
html.theme-light body.admin-wow#index .crm-stats h3 {
  color: var(--se-text) !important;
}
html.theme-light body.admin-wow#index .home-title-row p,
html.theme-light body.admin-wow#index .home-section-head p,
html.theme-light body.admin-wow#index .home-info-sub,
html.theme-light body.admin-wow#index .home-agenda-sub,
html.theme-light body.admin-wow#index .home-focus-note,
html.theme-light body.admin-wow#index .home-module-grid .card p {
  color: var(--se-text-muted) !important;
}
html.theme-light body.admin-wow#index .home-search-btn,
html.theme-light body.admin-wow#index .home-hero-btn,
html.theme-light body.admin-wow#index .home-action-dock .quick-action-btn {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border: 1px solid var(--se-border) !important;
  box-shadow: none !important;
}
html.theme-light body.admin-wow#index .home-hero-btn.primary,
html.theme-light body.admin-wow#index .home-action-dock .quick-action-btn:first-child {
  background: var(--se-primary) !important;
  color: var(--se-text-inverse) !important;
  border-color: var(--se-primary) !important;
}
html.theme-light body.admin-wow#index .home-search-btn:hover,
html.theme-light body.admin-wow#index .home-hero-btn:hover,
html.theme-light body.admin-wow#index .home-action-dock .quick-action-btn:hover {
  background: var(--se-hover) !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body.admin-wow#index .home-hero-btn.primary:hover,
html.theme-light body.admin-wow#index .home-action-dock .quick-action-btn:first-child:hover {
  background: var(--se-primary-hover) !important;
  color: var(--se-text-inverse) !important;
  border-color: var(--se-primary-hover) !important;
}
html.theme-light body.admin-wow#index .home-weather-slot,
html.theme-light body.admin-wow#index .home-weather-empty,
html.theme-light body.admin-wow#index .home-agenda-item,
html.theme-light body.admin-wow#index .home-badge,
html.theme-light body.admin-wow#index .home-focus-icon,
html.theme-light body.admin-wow#index .home-module-grid .card .icon {
  background: var(--se-surface-2) !important;
  background-image: none !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body.admin-wow#index .home-weather-slot-label,
html.theme-light body.admin-wow#index .home-weather-slot-temp,
html.theme-light body.admin-wow#index .home-weather-slot-time,
html.theme-light body.admin-wow#index .home-weather-slot-extra,
html.theme-light body.admin-wow#index .home-weather-empty-title,
html.theme-light body.admin-wow#index .home-weather-empty-text,
html.theme-light body.admin-wow#index .home-agenda-time,
html.theme-light body.admin-wow#index .home-agenda-meta,
html.theme-light body.admin-wow#index .home-badge {
  color: var(--se-text-2) !important;
}
html.theme-light body.admin-wow#index .home-agenda-time,
html.theme-light body.admin-wow#index .stat-number {
  color: var(--se-accent) !important;
}

/* Shared navigation: no dark dropdowns or low-contrast text in light mode. */
html.theme-light {
  --nav-bg: var(--se-surface-2);
  --nav-border: var(--se-border);
  --nav-hover: var(--se-hover);
  --nav-active: var(--se-text);
  --nav-text: var(--se-text);
  --nav-muted: var(--se-text-2);
}
html.theme-light body .nav-header {
  background: var(--se-surface-2) !important;
  border-bottom-color: var(--se-border) !important;
  box-shadow: var(--se-shadow-md) !important;
}
html.theme-light body .nav-logo,
html.theme-light body .nav-link,
html.theme-light body .nav-user-btn,
html.theme-light body .nav-action-btn,
html.theme-light body .nav-mobile-btn {
  color: var(--se-text-2) !important;
  background: transparent !important;
  border-color: var(--se-border) !important;
}
html.theme-light body .nav-logo:hover,
html.theme-light body .nav-link:hover,
html.theme-light body .nav-user-btn:hover,
html.theme-light body .nav-action-btn:hover,
html.theme-light body .nav-mobile-btn:hover {
  background: var(--se-hover) !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body .nav-link.active,
html.theme-light body .nav-dropdown.open > .nav-link {
  background: var(--se-accent-soft) !important;
  color: var(--se-text) !important;
  border-color: var(--se-accent-border),  !important;
}

html.theme-light body.admin-wow .nav-header .nav-link.active,
html.theme-light body.admin-wow .nav-header .nav-dropdown.open > .nav-link {
  color: var(--se-text) !important;
}

html.theme-light body .nav-link.active > *,
html.theme-light body .nav-dropdown.open > .nav-link > * {
  color: var(--se-text) !important;
}
html.theme-light body .nav-dropdown-menu,
html.theme-light body .nav-user-dropdown,
html.theme-light body .quick-actions-menu,
html.theme-light body .context-menu {
  background: var(--se-surface) !important;
  background-image: none !important;
  border-color: var(--se-border) !important;
  box-shadow: var(--se-shadow-md) !important;
}
html.theme-light body .nav-dropdown-section,
html.theme-light body .nav-user-info .role {
  color: var(--se-text-muted) !important;
}
html.theme-light body .nav-dropdown-section:not(:first-child),
html.theme-light body .nav-user-info {
  border-color: var(--se-border) !important;
}
html.theme-light body .nav-dropdown-item,
html.theme-light body .nav-user-dropdown-item,
html.theme-light body .quick-action-item,
html.theme-light body .context-menu-item {
  color: var(--se-text-2) !important;
  background: transparent !important;
}
html.theme-light body .nav-dropdown-item:hover,
html.theme-light body .nav-dropdown-item.active,
html.theme-light body .nav-user-dropdown-item:hover,
html.theme-light body .quick-action-item:hover,
html.theme-light body .context-menu-item:hover {
  background: var(--se-hover) !important;
  color: var(--se-text) !important;
}
html.theme-light body .nav-dropdown-item.active { color: var(--se-text) !important; }
html.theme-light body .nav-user-info .name { color: var(--se-text) !important; }
html.theme-light body .nav-dropdown-item .badge {
  background: var(--se-accent-soft) !important;
  color: var(--se-text) !important;
}
html.theme-light body .quick-actions-btn {
  background: var(--se-primary) !important;
  background-image: none !important;
  color: var(--se-text-inverse) !important;
  box-shadow: var(--se-shadow-md) !important;
}
html.theme-light body .nav-link.dummy,
html.theme-light body .nav-dropdown-item.dummy,
html.theme-light body .nav-mobile-item.dummy { color: var(--se-text-disabled) !important; }
html.theme-light body .nav-mobile-drawer {
  background: var(--se-surface) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body .nav-mobile-section { color: var(--se-text-muted) !important; }
html.theme-light body .nav-mobile-section:not(:first-child) { border-color: var(--se-border) !important; }
html.theme-light body .nav-mobile-item { color: var(--se-text-2) !important; }
html.theme-light body .nav-mobile-item:hover,
html.theme-light body .nav-mobile-item.active { background: var(--se-accent-soft) !important; color: var(--se-text) !important; }
html.theme-light body .context-menu-separator { background: var(--se-border) !important; }

html.theme-light body .accent,
html.theme-light body .badge,
html.theme-light body .chip,
html.theme-light body .tag,
html.theme-light body .status-chip {
  background: var(--se-accent-soft) !important;
  color: var(--se-text) !important;
  border-color: var(--se-accent-border),  !important;
}

html.theme-light body .timeline-item-card.selected,
html.theme-light body .resource-item.active,
html.theme-light body .planner-phase-chip.active {
  background: var(--se-accent-soft) !important;
  color: var(--se-text) !important;
  border-color: var(--se-accent) !important;
}
html.theme-light body .fc-col-header-cell,
html.theme-light body .fc-multimonth-month,
html.theme-light body .fc-multimonth-header {
  background: var(--se-surface-2) !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body .fc-daygrid-day-number,
html.theme-light body .fc-timegrid-slot-label-cushion,
html.theme-light body .fc-toolbar-title { color: var(--se-text) !important; }
html.theme-light body .fc-timegrid-col.fc-day-today,
html.theme-light body .fc-daygrid-day.fc-day-today { background: var(--se-surface-2) !important; }
html.theme-light body .fc-timegrid-now-indicator-line { border-color: var(--se-primary) !important; }

html.theme-light body ::-webkit-scrollbar-track { background: var(--se-scrollbar-track) !important; }
html.theme-light body ::-webkit-scrollbar-thumb { background: var(--se-scrollbar-thumb) !important; border-color: var(--se-scrollbar-track) !important; }
html.theme-light body ::-webkit-scrollbar-thumb:hover { background: var(--se-scrollbar-thumb-hover) !important; }
html.theme-light body { scrollbar-color: var(--se-scrollbar-thumb) var(--se-scrollbar-track) !important; }

.portal-theme-choice-grid { display:flex; gap:10px; flex-wrap:wrap; }
.portal-theme-choice { min-width:150px; }
html.theme-light body .portal-theme-choice.is-active {
  background: var(--se-accent-soft) !important;
  color: var(--se-text) !important;
  border-color: var(--se-accent-border),  !important;
}

/* Legacy admin pages: replace page-owned dark surfaces only while light mode is active. */
html.theme-light body > header,
html.theme-light body > main,
html.theme-light body .page-header,
html.theme-light body .tasks-layout,
html.theme-light body .calendar-layout,
html.theme-light body .calendar-container,
html.theme-light body .calendar-wrapper,
html.theme-light body .sidebar,
html.theme-light body .card,
html.theme-light body .panel,
html.theme-light body .stats,
html.theme-light body .stats-grid,
html.theme-light body .stat,
html.theme-light body .stat-card,
html.theme-light body .filter-section,
html.theme-light body .filter-controls,
html.theme-light body .toolbar,
html.theme-light body .kanban-board,
html.theme-light body .kanban-column,
html.theme-light body .kanban-add,
html.theme-light body .board-archive,
html.theme-light body .brand-grid,
html.theme-light body .brand-card,
html.theme-light body .filter-bar,
html.theme-light body .workspace,
html.theme-light body .modal-content,
html.theme-light body .modal-card,
html.theme-light body .detail-block,
html.theme-light body .timeline-item,
html.theme-light body .document-item,
html.theme-light body .template-link,
html.theme-light body .fs-drop-card,
html.theme-light body .upload-zone,
html.theme-light body .asset-item,
html.theme-light body .usage-role-item {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
  box-shadow: var(--se-shadow-md) !important;
}

html.theme-light body .page-title,
html.theme-light body .page-header h1,
html.theme-light body .section-title h2,
html.theme-light body .section-title h3,
html.theme-light body .brand-name,
html.theme-light body .empty-state-title,
html.theme-light body .task-title,
html.theme-light body .task-subtitle,
html.theme-light body .task-item,
html.theme-light body .kanban-column,
html.theme-light body .calendar-container,
html.theme-light body .calendar-container * {
  color: var(--se-text) !important;
}

html.theme-light body .page-subtitle,
html.theme-light body .brand-description,
html.theme-light body .brand-meta,
html.theme-light body .brand-meta-item,
html.theme-light body .workspace-subtitle,
html.theme-light body .filter-section h4,
html.theme-light body .filter-section-title,
html.theme-light body .stat-label,
html.theme-light body .mut,
html.theme-light body .muted,
html.theme-light body .task-meta,
html.theme-light body .task-inline-note,
html.theme-light body .empty-state,
html.theme-light body .empty-state-text,
html.theme-light body .calendar-container .mut,
html.theme-light body .calendar-container small {
  color: var(--se-text-muted) !important;
}

html.theme-light body .filter-btn,
html.theme-light body .view-toggle,
html.theme-light body .view-toggle-row,
html.theme-light body .toggle-box,
html.theme-light body .pill,
html.theme-light body .kanban-count,
html.theme-light body .task-source,
html.theme-light body .task-color-btn,
html.theme-light body .task-color-option,
html.theme-light body .section-btn,
html.theme-light body .weekday-btn,
html.theme-light body .calendar-context-menu,
html.theme-light body .calendar-context-menu-item {
  background: var(--se-surface-2) !important;
  background-image: none !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-border) !important;
}

html.theme-light body .filter-btn:hover,
html.theme-light body .filter-btn.active,
html.theme-light body .view-toggle:hover,
html.theme-light body .view-toggle.active,
html.theme-light body .section-btn:hover,
html.theme-light body .section-btn.active,
html.theme-light body .calendar-context-menu-item:hover {
  background: var(--se-accent-soft) !important;
  color: var(--se-text) !important;
  border-color: var(--se-accent-border),  !important;
}

html.theme-light body .kanban-add,
html.theme-light body .board-archive,
html.theme-light body .task-item,
html.theme-light body .calendar-container .filter-section-content,
html.theme-light body .calendar-container .sidebar-section {
  background: var(--se-surface-2) !important;
  border-color: var(--se-border) !important;
}

html.theme-light body .task-item,
html.theme-light body .task-item.completed,
html.theme-light body .task-item.priority-low,
html.theme-light body .task-item.priority-normal,
html.theme-light body .task-item.priority-high,
html.theme-light body .task-item.priority-urgent {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
}

html.theme-light body .task-priority,
html.theme-light body .task-deadline,
html.theme-light body .priority-low,
html.theme-light body .status-count {
  color: var(--se-text-2) !important;
}

html.theme-light body .primary,
html.theme-light body button.primary,
html.theme-light body .toolbar .primary,
html.theme-light body .filter-bar button.primary {
  background: var(--se-primary) !important;
  background-image: none !important;
  color: var(--se-text-inverse) !important;
  border-color: var(--se-primary) !important;
}
html.theme-light body .primary:hover,
html.theme-light body button.primary:hover,
html.theme-light body .toolbar .primary:hover,
html.theme-light body .filter-bar button.primary:hover {
  background: var(--se-primary-hover) !important;
  color: var(--se-text-inverse) !important;
  border-color: var(--se-primary-hover) !important;
}

html.theme-light body .stat-number,
html.theme-light body .stat .value,
html.theme-light body .calendar-container .count,
html.theme-light body .calendar-container .active {
  color: var(--se-accent) !important;
}

html.theme-light body .brand-status,
html.theme-light body .brand-version,
html.theme-light body .asset-chip,
html.theme-light body .badge,
html.theme-light body .chip,
html.theme-light body .tag {
  background: var(--se-accent-soft) !important;
  color: var(--se-text) !important;
  border-color: var(--se-accent-border),  !important;
}

html.theme-light body .brand-card:hover,
html.theme-light body .task-item:hover,
html.theme-light body .filter-btn:hover {
  border-color: var(--se-accent-border),  !important;
  box-shadow: var(--se-shadow-md) !important;
}

html.theme-light body .modal,
html.theme-light body .modal-backdrop,
html.theme-light body .overlay {
  background: var(--se-scrim) !important;
  background-image: none !important;
}

html.theme-light body .modal[data-modal-ux="shared-form"] {
  background: var(--se-scrim-frost) !important;
  background-image: none !important;
  backdrop-filter: blur(14px) saturate(108%);
  -webkit-backdrop-filter: blur(14px) saturate(108%);
}

html.theme-light body .modal-content,
html.theme-light body .modal-card {
  color: var(--se-text) !important;
}

/* Remove decorative blue/purple gradients from legacy light-mode surfaces. */
html.theme-light body .hero,
html.theme-light body .hero-panel,
html.theme-light body .hero-card,
html.theme-light body .page-header,
html.theme-light body .brand-card,
html.theme-light body .kanban-column,
html.theme-light body .board-archive,
html.theme-light body .calendar-container,
html.theme-light body .calendar-wrapper,
html.theme-light body .calendar-toolbar,
html.theme-light body .filter-section,
html.theme-light body .card,
html.theme-light body .panel {
  background-image: none !important;
}

html.theme-light body .page-head,
html.theme-light body .company-grid,
html.theme-light body .company-card,
html.theme-light body .search-card,
html.theme-light body .kv,
html.theme-light body .text-block,
html.theme-light body .agreement-section,
html.theme-light body .modal-dialog,
html.theme-light body .check,
html.theme-light body details.advanced,
html.theme-light body .signature-preview,
html.theme-light body .signature-item,
html.theme-light body .signature-list-empty,
html.theme-light body .company-chip,
html.theme-light body .empty-tip {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
  box-shadow: var(--se-shadow-md) !important;
}

html.theme-light body .page-head h1,
html.theme-light body .company-card h3,
html.theme-light body .company-card strong,
html.theme-light body .kv .v,
html.theme-light body .text-block h4,
html.theme-light body .text-block p,
html.theme-light body .agreement-section h4,
html.theme-light body details.advanced summary,
html.theme-light body .signature-item strong {
  color: var(--se-text) !important;
}

html.theme-light body .page-head p,
html.theme-light body .company-card .mut,
html.theme-light body .company-card .meta,
html.theme-light body .kv .k,
html.theme-light body .inline-note,
html.theme-light body .agreement-note,
html.theme-light body .company-chip,
html.theme-light body .empty-tip,
html.theme-light body .search-meta {
  color: var(--se-text-muted) !important;
}

html.theme-light body .company-card:hover,
html.theme-light body .company-card.active {
  background: var(--se-surface-2) !important;
  border-color: var(--se-accent-border),  !important;
  box-shadow: var(--se-shadow-md) !important;
}

html.theme-light body .company-card,
html.theme-light body .company-card.success,
html.theme-light body .company-card.warn,
html.theme-light body .company-card.danger,
html.theme-light body .company-card.muted {
  border-left-color: var(--se-accent-border),  !important;
}

html.theme-light body .stat-card,
html.theme-light body .stat-card.success,
html.theme-light body .stat-card.warn,
html.theme-light body .stat-card::before,
html.theme-light body .stat-card.success::before,
html.theme-light body .stat-card.warn::before {
  background: var(--se-surface) !important;
  background-image: none !important;
  border-color: var(--se-border) !important;
}
html.theme-light body .stat-card::before,
html.theme-light body .stat-card.success::before,
html.theme-light body .stat-card.warn::before {
  background: var(--se-accent-border) !important;
}

html.theme-light body .badge-status-draft,
html.theme-light body .badge-status-legal_review,
html.theme-light body .badge-status-management_approval,
html.theme-light body .badge-status-active,
html.theme-light body .badge-status-on_hold,
html.theme-light body .badge-status-completed,
html.theme-light body .badge-status-cancelled,
html.theme-light body .badge-type,
html.theme-light body .badge-doc,
html.theme-light body .badge-ok,
html.theme-light body .badge-warn,
html.theme-light body .company-chip.total,
html.theme-light body .company-chip.active,
html.theme-light body .company-chip.review,
html.theme-light body .company-chip.due {
  background: var(--se-accent-soft) !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-accent-border),  !important;
}

/* Strict light-mode normalization for legacy Finance, Email, Travel, Tools and System pages. */
html.theme-light body * {
  background-image: none !important;
  border-color: var(--se-border) !important;
  color: var(--se-text) !important;
}

html.theme-light body :is(
  [class*="card"], [class*="panel"], [class*="container"], [class*="wrapper"],
  [class*="wrap"], [class*="toolbar"], [class*="section"], [class*="grid"],
  [class*="table"], [class*="list"], [class*="box"], [class*="content"],
  [class*="workspace"], [class*="drawer"], [class*="details"], [class*="summary"],
  [class*="filter"], [class*="form"], [class*="editor"], [class*="preview"],
  [class*="search"], [class*="stats"], [class*="stat"]
):not(.nav-header):not(.nav-dropdown-menu):not(.nav-user-dropdown):not(.status-badge):not(.status-pill):not(.ledger-status):not(.accounting-highlight):not(.signal-chip):not(.vat-rate-pill):not(.filter-btn):not(.section-btn) {
  background-color: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
  box-shadow: var(--se-shadow-md) !important;
}

html.theme-light body :is(
  [class*="card"] *, [class*="panel"] *, [class*="container"] *,
  [class*="wrapper"] *, [class*="wrap"] *, [class*="toolbar"] *,
  [class*="section"] *, [class*="grid"] *, [class*="table"] *,
  [class*="list"] *, [class*="box"] *, [class*="content"] *,
  [class*="workspace"] *, [class*="drawer"] *, [class*="details"] *,
  [class*="summary"] *, [class*="filter"] *, [class*="form"] *,
  [class*="editor"] *, [class*="preview"] *, [class*="search"] *,
  [class*="stats"] *, [class*="stat"] *
) {
  color: var(--se-text) !important;
}

html.theme-light body :is(
  [class*="muted"], [class*="meta"], [class*="hint"], [class*="subtitle"],
  [class*="description"], [class*="help"], [class*="label"], [class*="note"],
  [class*="caption"], [class*="secondary-text"]
) {
  color: var(--se-text-muted) !important;
}

html.theme-light body :is(
  [class*="active"], [class*="selected"], [aria-selected="true"], [aria-current="page"]
) {
  background-color: var(--se-accent-soft) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-accent-border),  !important;
}

html.theme-light body :is(
  [class*="primary"], [class*="submit"], [class*="save"], [class*="create"],
  [class*="add"]
):is(button, a, input[type="submit"], input[type="button"], .btn) {
  background: var(--se-primary) !important;
  background-image: none !important;
  color: var(--se-text-inverse) !important;
  border-color: var(--se-primary) !important;
}

html.theme-light body :is(
  [class*="primary"], [class*="submit"], [class*="save"], [class*="create"],
  [class*="add"]
):is(button, a, input[type="submit"], input[type="button"], .btn):hover {
  background: var(--se-primary-hover) !important;
  color: var(--se-text-inverse) !important;
  border-color: var(--se-primary-hover) !important;
}

html.theme-light body :is(
  .finance-card, .finance-panel, .accounting-panel, .accounting-kpi,
  .accounting-summary-card, .balance-detail-panel, .balance-detail-item,
  .chart-card, .chart-variant-card, .chart-canvas-wrap, .kpi,
  .period-item, .checkpoint-item, .report-table, .report-table-wrap,
  .ledger-card, .booking-card, .booking-row, .invoice-card, .vat-card,
  .profit-loss-card, .email-card, .email-panel, .mail-card, .mail-panel,
  .credential-card, .credential-panel, .travel-card, .trip-card,
  .trip-route, .trip-stat, .expense-card, .expense-panel,
  .monitor-card, .chart-container, .webhook-card, .endpoint-card,
  .hardware-card, .binding-card, .trigger-card, .system-card, .tool-card
) {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
  box-shadow: var(--se-shadow-md) !important;
}

html.theme-light body :is(
  .finance-hero, .finance-hero-link, .accounting-pill, .trend-legend-pill,
  .chart-legend-pill, .route-map-shell, .metric, .smart-callout,
  .gps-quick-info, .mobile-live-hero, .metric-card, .travel-topbar,
  .toast, .live-indicator, .filters, .session-item, .endpoint-status,
  .details-row, .tab.active
) {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
  box-shadow: var(--se-shadow-md) !important;
}

html.theme-light body :is(.accounting-pill, .trend-legend-pill, .chart-legend-pill) {
  background: var(--se-accent-soft) !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-accent-border),  !important;
}

html.theme-light body :is(.route-map-shell, .metric, .smart-callout, .metric-card) * {
  color: var(--se-text) !important;
}

html.theme-light body .finance-hero-link:hover,
html.theme-light body .accounting-pill:hover,
html.theme-light body .trend-legend-pill:hover {
  background: var(--se-hover) !important;
  color: var(--se-text) !important;
}

html.theme-light body .trend-legend-pill::before,
html.theme-light body .chart-legend-pill::before,
html.theme-light body .accounting-summary-card::before {
  background: var(--se-accent) !important;
  background-image: none !important;
}

html.theme-light body :is(h3, h4)::before {
  background: var(--se-accent) !important;
  background-image: none !important;
}

html.theme-light body :is(.status, .badge, .status-pill, .status-box, .success, .online, .toast-success) {
  background: var(--se-success-bg) !important;
  color: var(--se-success-fg) !important;
  border-color: var(--se-success-border) !important;
}
html.theme-light body :is(.warning, .warn, .pending, .review, .toast-warning) {
  background: var(--se-warning-bg) !important;
  color: var(--se-warning-fg) !important;
  border-color: var(--se-warning-border) !important;
}
html.theme-light body :is(.error, .danger, .critical, .toast-error) {
  background: var(--se-danger-bg) !important;
  color: var(--se-danger-fg) !important;
  border-color: var(--se-danger-border) !important;
}
html.theme-light body :is(button, a).danger,
html.theme-light body button.error {
  background: var(--se-danger-strong) !important;
  color: var(--se-text-inverse) !important;
  border-color: var(--se-danger-strong) !important;
}

html.theme-light body .redirect-notice,
html.theme-light body .receipt-preview-shell,
html.theme-light body .receipt-side-card,
html.theme-light body .receipt-preview-empty,
html.theme-light body .note-card,
html.theme-light body .upload-item,
html.theme-light body [style*="background:#0e1330"],
html.theme-light body [style*="background: #0e1330"],
html.theme-light body [style*="background:#151a2c"],
html.theme-light body [style*="background: #151a2c"],
html.theme-light body [style*="background:#0f1730"],
html.theme-light body [style*="background: #0f1730"] {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
  box-shadow: var(--se-shadow-md) !important;
}

html.theme-light body .redirect-notice p,
html.theme-light body .redirect-notice small,
html.theme-light body .receipt-preview-badge,
html.theme-light body .receipt-side-head,
html.theme-light body .receipt-side-actions,
html.theme-light body .receipt-preview-shell * {
  color: var(--se-text-muted) !important;
}

html.theme-light body :is(
  .finance-card *, .finance-panel *, .accounting-panel *, .accounting-kpi *,
  .accounting-summary-card *, .balance-detail-panel *, .balance-detail-item *,
  .chart-card *, .chart-variant-card *, .chart-canvas-wrap *, .kpi *,
  .period-item *, .checkpoint-item *, .report-table *, .ledger-card *,
  .booking-card *, .booking-row *, .invoice-card *, .vat-card *,
  .profit-loss-card *, .email-card *, .email-panel *, .mail-card *,
  .mail-panel *, .credential-card *, .credential-panel *, .travel-card *,
  .trip-card *, .trip-route *, .trip-stat *, .expense-card *, .expense-panel *,
  .monitor-card *, .chart-container *, .webhook-card *, .endpoint-card *,
  .hardware-card *, .binding-card *, .trigger-card *, .system-card *, .tool-card *
) {
  color: var(--se-text) !important;
}

html.theme-light body :is(
  .trend-canvas-wrap, .chart-canvas-wrap, .map-container, .map-wrapper,
  .editor-preview, .code-preview, .terminal, pre, code
) {
  background: var(--se-surface-2) !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-border) !important;
}

html.theme-light body :is(
  table, thead, tbody, tr, th, td, [role="table"], [role="row"], [role="cell"]
) {
  background-color: var(--se-surface) !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body :is(th, [role="columnheader"]) {
  background-color: var(--se-surface-2) !important;
  color: var(--se-text-2) !important;
}
html.theme-light body :is(tr:hover, [role="row"]:hover) {
  background-color: var(--se-hover) !important;
}

html.theme-light body #breadcrumbs {
  background: var(--se-surface-2) !important;
  color: var(--se-text-muted) !important;
  border-color: var(--se-border) !important;
  box-shadow: none !important;
}
html.theme-light body #breadcrumbs .breadcrumb-current,
html.theme-light body #breadcrumbs .breadcrumb-separator,
html.theme-light body #breadcrumbs .breadcrumb-link {
  color: var(--se-text-2) !important;
}

html.theme-light body .calendar-container .filter-section,
html.theme-light body .calendar-container .filter-section-header,
html.theme-light body .calendar-container .filter-section-content,
html.theme-light body .calendar-container .filter-item,
html.theme-light body .calendar-container .filter-btn,
html.theme-light body .calendar-container .section-btn,
html.theme-light body .calendar-container .count,
html.theme-light body .calendar-container .view-toggle,
html.theme-light body .calendar-container .view-toggle button,
html.theme-light body .calendar-container .person-badge,
html.theme-light body .calendar-container .multi-person-select,
html.theme-light body .calendar-container .weekday-btn span {
  background: var(--se-surface-2) !important;
  background-image: none !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body .calendar-container .filter-section-title,
html.theme-light body .calendar-container .filter-section-toggle,
html.theme-light body .calendar-container .filter-item .name,
html.theme-light body .calendar-container .filter-item .count,
html.theme-light body .calendar-container .filter-btn,
html.theme-light body .calendar-container .section-btn,
html.theme-light body .calendar-container .fc-toolbar-title,
html.theme-light body .calendar-container .fc-col-header-cell-cushion,
html.theme-light body .calendar-container .fc-timegrid-slot-label-cushion {
  color: var(--se-text-2) !important;
}
html.theme-light body .calendar-container .filter-item.active,
html.theme-light body .calendar-container .filter-item.solo,
html.theme-light body .calendar-container .filter-btn.solo-active,
html.theme-light body .calendar-container .view-toggle button.active,
html.theme-light body .calendar-container .weekday-btn input:checked + span {
  background: var(--se-accent-soft) !important;
  color: var(--se-text) !important;
  border-color: var(--se-accent-border),  !important;
}
html.theme-light body .calendar-container .fc,
html.theme-light body .calendar-container .fc-list,
html.theme-light body .calendar-container .fc-list-table,
html.theme-light body .calendar-container .fc-list-event,
html.theme-light body .calendar-container .fc-list-empty,
html.theme-light body .calendar-container .fc-col-header-cell,
html.theme-light body .calendar-container .fc-list-day-cushion {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body .calendar-container .fc-theme-standard td,
html.theme-light body .calendar-container .fc-theme-standard th,
html.theme-light body .calendar-container .fc-theme-standard .fc-scrollgrid,
html.theme-light body .calendar-container .fc-timegrid-slot,
html.theme-light body .calendar-container .fc-timegrid-col,
html.theme-light body .calendar-container .fc-timegrid-slot-lane {
  border-color: var(--se-border) !important;
}

html.theme-light body .calendar-container .fc-event,
html.theme-light body .calendar-container .event-task,
html.theme-light body .calendar-container .event-appointment,
html.theme-light body .calendar-container .event-project,
html.theme-light body .calendar-container .event-event_link,
html.theme-light body .calendar-container .event-meeting,
html.theme-light body .calendar-container .event-deadline,
html.theme-light body .calendar-container .event-reminder {
  background: var(--se-surface-2) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border: 1px solid var(--se-accent-border),  !important;
  border-left: 3px solid var(--se-accent) !important;
  box-shadow: none !important;
}
html.theme-light body .calendar-container .fc-event * {
  color: var(--se-text) !important;
}

/* Theme switches belong in profile settings, not in every work surface. */
html body .page-theme-toggle,
html body .local-theme-toggle { display: none !important; }

/* Finance status colors: semantic accents add clarity without dark containers. */
html.theme-light body .status-paid.status-paid,
html.theme-light body .payment-paid,
html.theme-light body .status-approved.status-approved,
html.theme-light body .status-reimbursed.status-reimbursed,
html.theme-light body .status-pill.matched.matched,
html.theme-light body .status-pill.checked.checked,
html.theme-light body .ledger-status.matched.matched,
html.theme-light body .signal-chip.good,
html.theme-light body .signal-chip.filed {
  background: var(--se-success-bg) !important;
  background-image: none !important;
  color: var(--se-success-fg) !important;
  border-color: var(--se-success-border) !important;
}

html.theme-light body .payment-unpaid,
html.theme-light body .payment-partial,
html.theme-light body .status-planned.status-planned,
html.theme-light body .status-pending.status-pending,
html.theme-light body .status-review.status-review,
html.theme-light body .status-pill.review.review,
html.theme-light body .ledger-status.review.review,
html.theme-light body .accounting-highlight.review.review,
html.theme-light body .signal-chip.warn,
html.theme-light body .vat-rate-pill.mixed {
  background: var(--se-warning-bg) !important;
  background-image: none !important;
  color: var(--se-warning-fg) !important;
  border-color: var(--se-warning-border) !important;
}

html.theme-light body .status-overdue.status-overdue,
html.theme-light body .status-rejected.status-rejected,
html.theme-light body .payment-refunded,
html.theme-light body .status-review.status-review.needs-review,
html.theme-light body .needs-review,
html.theme-light body .status-pill.unmatched.unmatched,
html.theme-light body .ledger-status.unmatched.unmatched,
html.theme-light body .accounting-highlight.unmatched.unmatched,
html.theme-light body .accounting-highlight.overdue.overdue {
  background: var(--se-danger-bg) !important;
  background-image: none !important;
  color: var(--se-danger-fg) !important;
  border-color: var(--se-danger-border) !important;
}

html.theme-light body .status-draft.status-draft,
html.theme-light body .status-sent.status-sent,
html.theme-light body .vat-rate-pill.zero,
html.theme-light body .vat-rate-pill.unknown,
html.theme-light body .signal-chip.neutral,
html.theme-light body .accounting-highlight.unchecked {
  background: var(--se-hover) !important;
  background-image: none !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-border-strong) !important;
}

/* Keep finance summary cards calm while making their meaning visible at a glance. */
html.theme-light body .finance-page .stat-card.paid,
html.theme-light body .finance-page .stat-card.approved,
html.theme-light body .finance-page .stat-card.success,
html.theme-light body .finance-page [class*="stat"].paid,
html.theme-light body .finance-page [class*="stat"].approved {
  background: var(--se-success-bg) !important;
  border-left: 3px solid var(--se-success-border) !important;
}
html.theme-light body .finance-page .stat-card.overdue,
html.theme-light body .finance-page .stat-card.danger,
html.theme-light body .finance-page .stat-card.error,
html.theme-light body .finance-page [class*="stat"].overdue {
  background: var(--se-danger-bg) !important;
  border-left: 3px solid var(--se-danger-border) !important;
}
html.theme-light body .finance-page .stat-card.pending,
html.theme-light body .finance-page .stat-card.warning,
html.theme-light body .finance-page [class*="stat"].pending,
html.theme-light body .finance-page [class*="stat"].warning {
  background: var(--se-warning-bg) !important;
  border-left: 3px solid var(--se-warning-border) !important;
}

html.theme-light body .vat-rate-pill.low {
  background: var(--se-success-bg) !important;
  color: var(--se-success-fg) !important;
  border-color: var(--se-success-border) !important;
}

/* Agenda: readable filter counts and calm color-coded event fields. */
html.theme-light body .calendar-container .filter-item,
html.theme-light body .calendar-container .filter-item .name,
html.theme-light body .calendar-container .filter-item .icon,
html.theme-light body .calendar-container .filter-item .count,
html.theme-light body .calendar-container .filter-section-title,
html.theme-light body .calendar-container .filter-section-toggle,
html.theme-light body .calendar-container .filter-btn,
html.theme-light body .calendar-container .view-toggle button,
html.theme-light body .calendar-container .weekday-btn span {
  color: var(--se-text-2) !important;
}

html.theme-light body .calendar-container .filter-item .count,
html.theme-light body .calendar-container .count {
  background: var(--se-primary) !important;
  color: var(--se-text-inverse) !important;
  border: 1px solid var(--se-primary) !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}

html.theme-light body .calendar-container span.count.count {
  background-color: var(--se-primary) !important;
  color: var(--se-text-inverse) !important;
  -webkit-text-fill-color: var(--se-text-inverse) !important;
  text-shadow: none !important;
  border-color: var(--se-primary) !important;
}

html.theme-light body .calendar-container .filter-item > span.count,
html.theme-light body .calendar-container .filter-item > span.count * {
  color: var(--se-text-inverse) !important;
  -webkit-text-fill-color: var(--se-text-inverse) !important;
}

html.theme-light body .calendar-container .filter-controls .filter-btn,
html.theme-light body .calendar-container .section-controls .section-btn {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text-2) !important;
  border: 1px solid var(--se-border-strong) !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}

html.theme-light body .calendar-container .filter-controls .filter-btn:hover,
html.theme-light body .calendar-container .section-controls .section-btn:hover {
  background: var(--se-accent-soft) !important;
  color: var(--se-text) !important;
  border-color: var(--se-accent) !important;
}

html.theme-light body .calendar-container .filter-controls .filter-btn.solo-active {
  background-color: var(--se-accent-soft) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-accent) !important;
}

html.theme-light body .calendar-container .filter-controls .filter-btn.mute-active {
  background-color: var(--se-danger-bg) !important;
  background-image: none !important;
  color: var(--se-danger-fg) !important;
  border-color: var(--se-danger-border) !important;
}

html.theme-light body .calendar-container .filter-item.active,
html.theme-light body .calendar-container .filter-item.solo,
html.theme-light body .calendar-container .filter-btn.solo-active {
  background: var(--se-accent-soft) !important;
  color: var(--se-text) !important;
  border-color: var(--se-accent-border),  !important;
}

html.theme-light body .calendar-container .filter-item.active .name,
html.theme-light body .calendar-container .filter-item.solo .name,
html.theme-light body .calendar-container .filter-item.active .count,
html.theme-light body .calendar-container .filter-item.solo .count {
  color: var(--se-text) !important;
}

html.theme-light body .calendar-container .fc-event,
html.theme-light body .calendar-container .event-task,
html.theme-light body .calendar-container .event-appointment,
html.theme-light body .calendar-container .event-project,
html.theme-light body .calendar-container .event-event_link,
html.theme-light body .calendar-container .event-meeting,
html.theme-light body .calendar-container .event-deadline,
html.theme-light body .calendar-container .event-reminder {
  background-image: none !important;
  border-width: 1px !important;
  border-style: solid !important;
  border-radius: 10px !important;
  box-shadow: var(--se-shadow-md) !important;
  font-weight: 600 !important;
}

html.theme-light body .calendar-container .fc-event {
  background: var(--se-hover) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border-strong) !important;
}

html.theme-light body .calendar-container .event-task {
  background: var(--se-info-bg) !important;
  color: var(--se-info-fg) !important;
  border-color: var(--se-info-border) !important;
}
html.theme-light body .calendar-container .event-appointment {
  background: var(--se-warning-bg) !important;
  color: var(--se-warning-fg) !important;
  border-color: var(--se-warning-border) !important;
}
html.theme-light body .calendar-container .event-project {
  background: var(--se-accent-soft) !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-accent-border) !important;
}
html.theme-light body .calendar-container .event-event_link {
  background: var(--se-accent-soft) !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-accent-border) !important;
}
html.theme-light body .calendar-container .event-meeting {
  background: var(--se-success-bg) !important;
  color: var(--se-success-fg) !important;
  border-color: var(--se-success-border) !important;
}
html.theme-light body .calendar-container .event-deadline {
  background: var(--se-danger-bg) !important;
  color: var(--se-danger-fg) !important;
  border-color: var(--se-danger-border) !important;
}
html.theme-light body .calendar-container .event-reminder {
  background: var(--se-accent-soft) !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-accent-border) !important;
}

html.theme-light body .calendar-container .fc-event * {
  color: inherit !important;
  text-shadow: none !important;
}

/* Bank statements: a high-contrast light ledger surface, scoped to light mode. */
html.theme-light body.bank-page {
  --bank-light-page: var(--se-page);
  --bank-light-card: var(--se-surface);
  --bank-light-card-soft: var(--se-surface-2);
  --bank-light-ink: var(--se-text);
  --bank-light-muted: var(--se-text-muted);
  --bank-light-border: var(--se-border-strong);
  --bank-light-navy: var(--se-primary);
  background:
    var(--se-page) !important;
  color: var(--bank-light-ink) !important;
}

html.theme-light body.bank-page header {
  background: var(--se-surface) !important;
  border-color: var(--se-border-strong) !important;
  box-shadow: var(--se-shadow-md) !important;
}

html.theme-light body.bank-page header h1 {
  background: var(--se-surface) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  text-shadow: none !important;
}

html.theme-light body.bank-page .card,
html.theme-light body.bank-page .modal-card,
html.theme-light body.bank-page #matchingModal > div > div,
html.theme-light body.bank-page #manualLinkModal > div > div {
  background: var(--bank-light-card) !important;
  background-image: none !important;
  border: 1px solid var(--bank-light-border) !important;
  box-shadow: var(--se-shadow-md) !important;
  color: var(--bank-light-ink) !important;
}

html.theme-light body.bank-page h2,
html.theme-light body.bank-page h3,
html.theme-light body.bank-page strong,
html.theme-light body.bank-page .counterparty,
html.theme-light body.bank-page .statement-counterparty {
  color: var(--bank-light-ink) !important;
}

html.theme-light body.bank-page .mut,
html.theme-light body.bank-page .stat-label,
html.theme-light body.bank-page .statement-date,
html.theme-light body.bank-page .statement-description,
html.theme-light body.bank-page .statement-balance,
html.theme-light body.bank-page .reference,
html.theme-light body.bank-page .loading,
html.theme-light body.bank-page .empty {
  color: var(--bank-light-muted) !important;
}

html.theme-light body.bank-page .stat-card {
  background: var(--se-surface) !important;
  border: 1px solid var(--se-border-strong) !important;
  box-shadow: var(--se-shadow-md) !important;
}

html.theme-light body.bank-page .stat-card:nth-child(1) {
  background: var(--se-surface) !important;
  border-color: var(--se-info-border) !important;
}

html.theme-light body.bank-page .stat-card:nth-child(2) {
  background: var(--se-surface) !important;
  border-color: var(--se-success-border) !important;
}

html.theme-light body.bank-page .stat-card:nth-child(3) {
  background: var(--se-surface) !important;
  border-color: var(--se-warning-border) !important;
}

html.theme-light body.bank-page .stat-card:nth-child(4) {
  background: var(--se-surface) !important;
  border-color: var(--se-accent-border) !important;
}

html.theme-light body.bank-page .stat-value,
html.theme-light body.bank-page .statement-date-day {
  color: var(--se-text) !important;
}

html.theme-light body.bank-page .amount-positive { color: var(--se-success-fg) !important; }
html.theme-light body.bank-page .amount-negative { color: var(--se-warning-fg) !important; }
html.theme-light body.bank-page .amount-neutral { color: var(--se-text-2) !important; }

html.theme-light body.bank-page input,
html.theme-light body.bank-page select,
html.theme-light body.bank-page textarea,
html.theme-light body.bank-page .search-bar input {
  background: var(--se-surface) !important;
  color: var(--se-text) !important;
  border: 1px solid var(--se-border-strong) !important;
  box-shadow: var(--se-shadow-md) !important;
}

html.theme-light body.bank-page input::placeholder { color: var(--se-text-muted) !important; }
html.theme-light body.bank-page input:focus,
html.theme-light body.bank-page select:focus {
  border-color: var(--se-info-border) !important;
  box-shadow: var(--se-shadow-md) !important;
}

html.theme-light body.bank-page .bank-selector {
  padding: 4px;
  background: var(--se-surface-2);
  border: 1px solid var(--se-border-strong);
  border-radius: 14px;
}

html.theme-light body.bank-page .bank-btn,
html.theme-light body.bank-page .view-toggle button {
  background: var(--se-surface) !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-border-strong) !important;
  box-shadow: var(--se-shadow-md) !important;
}

html.theme-light body.bank-page .bank-btn:hover,
html.theme-light body.bank-page .view-toggle button:hover {
  background: var(--se-info-bg) !important;
  border-color: var(--se-info-border) !important;
}

html.theme-light body.bank-page .bank-btn.active,
html.theme-light body.bank-page .view-toggle button.active {
  background: var(--se-primary) !important;
  color: var(--se-text-inverse) !important;
  border-color: var(--se-primary) !important;
  box-shadow: var(--se-shadow-md) !important;
}

html.theme-light body.bank-page .bank-btn.archived::after { color: var(--se-text-muted) !important; }

html.theme-light body.bank-page .status-executed { background: var(--se-success-bg) !important; color: var(--se-success-fg) !important; border: 1px solid var(--se-success-border) !important; }
html.theme-light body.bank-page .status-pending { background: var(--se-warning-bg) !important; color: var(--se-warning-fg) !important; border: 1px solid var(--se-warning-border) !important; }
html.theme-light body.bank-page .status-cancelled { background: var(--se-danger-bg) !important; color: var(--se-danger-fg) !important; border: 1px solid var(--se-danger-border) !important; }
html.theme-light body.bank-page .matched-badge { background: var(--se-info-bg) !important; color: var(--se-info-fg) !important; border: 1px solid var(--se-info-border) !important; }

html.theme-light body.bank-page .statement-list {
  background: var(--se-surface-3) !important;
  border: 1px solid var(--se-border-strong);
  border-radius: 14px;
  overflow: hidden;
  gap: 1px;
}

html.theme-light body.bank-page .statement-item {
  background: var(--se-surface) !important;
  color: var(--bank-light-ink) !important;
  border-left-width: 5px !important;
  border-bottom: 1px solid var(--se-border);
}

html.theme-light body.bank-page .statement-item.income { background: var(--se-success-bg) !important; border-left-color: var(--se-success-border) !important; }
html.theme-light body.bank-page .statement-item.expense { background: var(--se-warning-bg) !important; border-left-color: var(--se-warning-border) !important; }
html.theme-light body.bank-page .statement-item:hover { background: var(--se-info-bg) !important; border-left-color: var(--se-info-border) !important; }
html.theme-light body.bank-page .statement-date-day,
html.theme-light body.bank-page .statement-counterparty { color: var(--se-text) !important; }
html.theme-light body.bank-page .statement-description { color: var(--se-text-2) !important; }
html.theme-light body.bank-page .statement-account { color: var(--se-text-muted) !important; }

html.theme-light body.bank-page table { background: var(--se-surface); border: 1px solid var(--se-border-strong); border-radius: 12px; overflow: hidden; }
html.theme-light body.bank-page th { background: var(--se-primary) !important; color: var(--se-text-inverse) !important; border-color: var(--se-primary) !important; }
html.theme-light body.bank-page td { background: var(--se-surface) !important; color: var(--se-text-2) !important; border-color: var(--se-border) !important; }
html.theme-light body.bank-page tbody tr:nth-child(even) td { background: var(--se-surface-2) !important; }
html.theme-light body.bank-page tbody tr:hover td { background: var(--se-info-bg) !important; }

html.theme-light body.bank-page .manual-item {
  background: var(--se-surface-2) !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-border-strong) !important;
  box-shadow: var(--se-shadow-md) !important;
}

html.theme-light body.bank-page .mt940-import-summary {
  background: var(--se-info-bg) !important;
  color: var(--se-text) !important;
  border-color: var(--se-info-border) !important;
}
html.theme-light body.bank-page .mt940-import-summary.empty { background: var(--se-surface-2) !important; color: var(--se-text-muted) !important; }
html.theme-light body.bank-page .mt940-import-summary strong { color: var(--se-text) !important; }

html.theme-light body.bank-page #matchingModal,
html.theme-light body.bank-page #manualLinkModal {
  background: var(--se-scrim) !important;
  backdrop-filter: blur(8px);
}

@media (max-width: 760px) {
  html.theme-light body.bank-page .statement-item { grid-template-columns: 58px 1fr; gap: 10px; }
  html.theme-light body.bank-page .statement-amount-col { grid-column: 2; align-items: flex-start; }
  html.theme-light body.bank-page .manual-item { grid-template-columns: 1fr; }
  html.theme-light body.bank-page .mt940-import-grid { grid-template-columns: 1fr; }
}
html.theme-light body .calendar-container .fc-event-time,
html.theme-light body .calendar-container .fc-event-title,
html.theme-light body .calendar-container .fc-timegrid-slot-label-cushion,
html.theme-light body .calendar-container .fc-col-header-cell-cushion,
html.theme-light body .calendar-container .fc-toolbar-title {
  color: var(--se-text-2) !important;
  opacity: 1 !important;
}

html.theme-light body .calendar-container .fc .fc-button,
html.theme-light body .calendar-container .fc .fc-prev-button,
html.theme-light body .calendar-container .fc .fc-next-button,
html.theme-light body .calendar-container .fc .fc-today-button {
  color: var(--se-text-inverse) !important;
  background: var(--se-primary) !important;
  background-image: none !important;
  border-color: var(--se-primary) !important;
  --fc-button-text-color: var(--se-text-inverse) !important;
}

html.theme-light body .calendar-container .fc .fc-button .fc-icon,
html.theme-light body .calendar-container .fc .fc-prev-button .fc-icon,
html.theme-light body .calendar-container .fc .fc-next-button .fc-icon {
  color: var(--se-text-inverse) !important;
  -webkit-text-fill-color: var(--se-text-inverse) !important;
}

html.theme-light body .calendar-container .fc .fc-button:hover,
html.theme-light body .calendar-container .fc .fc-button:focus {
  color: var(--se-text-inverse) !important;
  background: var(--se-primary-hover) !important;
  border-color: var(--se-primary-hover) !important;
}

/* Final bank light-mode overrides: keep these after the generic light theme. */
html.theme-light body.bank-page {
  background: var(--se-page) !important;
  color: var(--se-text) !important;
}
html.theme-light body.bank-page header,
html.theme-light body.bank-page .card,
html.theme-light body.bank-page .modal-card,
html.theme-light body.bank-page #matchingModal > div > div,
html.theme-light body.bank-page #manualLinkModal > div > div {
  background: var(--se-surface) !important;
  background-image: none !important;
  border-color: var(--se-border-strong) !important;
  color: var(--se-text) !important;
  box-shadow: var(--se-shadow-md) !important;
}
html.theme-light body.bank-page header { background: var(--se-surface) !important; }
html.theme-light body.bank-page header h1 { background: var(--se-surface) !important; -webkit-background-clip: text !important; background-clip: text !important; text-shadow: none !important; }
html.theme-light body.bank-page h2,
html.theme-light body.bank-page h3,
html.theme-light body.bank-page strong,
html.theme-light body.bank-page .counterparty,
html.theme-light body.bank-page .statement-counterparty,
html.theme-light body.bank-page .stat-value { color: var(--se-text) !important; }
html.theme-light body.bank-page .mut,
html.theme-light body.bank-page .stat-label,
html.theme-light body.bank-page .statement-date,
html.theme-light body.bank-page .statement-description,
html.theme-light body.bank-page .statement-account,
html.theme-light body.bank-page .statement-balance,
html.theme-light body.bank-page .reference,
html.theme-light body.bank-page .loading,
html.theme-light body.bank-page .empty { color: var(--se-text-muted) !important; }
html.theme-light body.bank-page .stat-card { background: var(--se-surface) !important; border-color: var(--se-border-strong) !important; box-shadow: var(--se-shadow-md) !important; }
html.theme-light body.bank-page .stat-card:nth-child(1) { background: var(--se-surface) !important; border-color: var(--se-info-border) !important; }
html.theme-light body.bank-page .stat-card:nth-child(2) { background: var(--se-surface) !important; border-color: var(--se-success-border) !important; }
html.theme-light body.bank-page .stat-card:nth-child(3) { background: var(--se-surface) !important; border-color: var(--se-warning-border) !important; }
html.theme-light body.bank-page .stat-card:nth-child(4) { background: var(--se-surface) !important; border-color: var(--se-accent-border) !important; }
html.theme-light body.bank-page .amount-positive { color: var(--se-success-fg) !important; }
html.theme-light body.bank-page .amount-negative { color: var(--se-warning-fg) !important; }
html.theme-light body.bank-page .amount-neutral { color: var(--se-text-2) !important; }
html.theme-light body.bank-page input,
html.theme-light body.bank-page select,
html.theme-light body.bank-page textarea,
html.theme-light body.bank-page .search-bar input { background: var(--se-surface) !important; color: var(--se-text) !important; border-color: var(--se-border-strong) !important; box-shadow: var(--se-shadow-md) !important; }
html.theme-light body.bank-page input::placeholder { color: var(--se-text-muted) !important; }
html.theme-light body.bank-page .bank-selector { background: var(--se-surface-2) !important; border: 1px solid var(--se-border-strong) !important; border-radius: 14px; padding: 4px; }
html.theme-light body.bank-page .bank-btn,
html.theme-light body.bank-page .view-toggle button { background: var(--se-surface) !important; color: var(--se-text-2) !important; border-color: var(--se-border-strong) !important; box-shadow: var(--se-shadow-md) !important; }
html.theme-light body.bank-page .bank-btn.active,
html.theme-light body.bank-page .view-toggle button.active { background: var(--se-primary) !important; color: var(--se-text-inverse) !important; border-color: var(--se-primary) !important; }
html.theme-light body.bank-page .status-executed { background: var(--se-success-bg) !important; color: var(--se-success-fg) !important; border: 1px solid var(--se-success-border) !important; }
html.theme-light body.bank-page .status-pending { background: var(--se-warning-bg) !important; color: var(--se-warning-fg) !important; border: 1px solid var(--se-warning-border) !important; }
html.theme-light body.bank-page .status-cancelled { background: var(--se-danger-bg) !important; color: var(--se-danger-fg) !important; border: 1px solid var(--se-danger-border) !important; }
html.theme-light body.bank-page .matched-badge { background: var(--se-info-bg) !important; color: var(--se-info-fg) !important; border: 1px solid var(--se-info-border) !important; }
html.theme-light body.bank-page .statement-list { background: var(--se-surface-3) !important; border: 1px solid var(--se-border-strong) !important; border-radius: 14px; overflow: hidden; gap: 1px; }
html.theme-light body.bank-page .statement-item { background: var(--se-surface) !important; color: var(--se-text) !important; border-left-width: 5px !important; border-bottom: 1px solid var(--se-border) !important; }
html.theme-light body.bank-page .statement-item.income { background: var(--se-success-bg) !important; border-left-color: var(--se-success-border) !important; }
html.theme-light body.bank-page .statement-item.expense { background: var(--se-warning-bg) !important; border-left-color: var(--se-warning-border) !important; }
html.theme-light body.bank-page .statement-item:hover { background: var(--se-info-bg) !important; border-left-color: var(--se-info-border) !important; }
html.theme-light body.bank-page table { background: var(--se-surface) !important; border: 1px solid var(--se-border-strong) !important; }
html.theme-light body.bank-page th { background: var(--se-primary) !important; color: var(--se-text-inverse) !important; border-color: var(--se-primary) !important; }
html.theme-light body.bank-page td { background: var(--se-surface) !important; color: var(--se-text-2) !important; border-color: var(--se-border) !important; }
html.theme-light body.bank-page tbody tr:nth-child(even) td { background: var(--se-surface-2) !important; }
html.theme-light body.bank-page tbody tr:hover td { background: var(--se-info-bg) !important; }
html.theme-light body.bank-page .manual-item { background: var(--se-surface-2) !important; color: var(--se-text-2) !important; border-color: var(--se-border-strong) !important; box-shadow: var(--se-shadow-md) !important; }
html.theme-light body.bank-page .mt940-import-summary { background: var(--se-info-bg) !important; color: var(--se-text) !important; border-color: var(--se-info-border) !important; }
html.theme-light body.bank-page .mt940-import-summary.empty { background: var(--se-surface-2) !important; color: var(--se-text-muted) !important; }
html.theme-light body.bank-page #matchingModal,
html.theme-light body.bank-page #manualLinkModal { background: var(--se-scrim) !important; backdrop-filter: blur(8px); }

@media (max-width: 760px) {
  html.theme-light body.bank-page .statement-item { grid-template-columns: 58px 1fr !important; gap: 10px; }
  html.theme-light body.bank-page .statement-amount-col { grid-column: 2; align-items: flex-start; }
  html.theme-light body.bank-page .manual-item,
  html.theme-light body.bank-page .mt940-import-grid { grid-template-columns: 1fr; }
}

/* Higher specificity wins over the shared premium-shell light defaults. */
html.theme-light body.admin-wow.premium-shell-page.bank-page .card,
html.theme-light body.admin-wow.premium-shell-page.bank-page .modal-card,
html.theme-light body.admin-wow.premium-shell-page.bank-page #matchingModal > div > div,
html.theme-light body.admin-wow.premium-shell-page.bank-page #manualLinkModal > div > div {
  background-color: var(--se-surface) !important;
  background-image: none !important;
  border-color: var(--se-border-strong) !important;
  color: var(--se-text) !important;
  box-shadow: var(--se-shadow-md) !important;
}

/* File Storage: the folder rail is not a .card, so its page-owned dark
   background otherwise survives the shared light-theme conversion. */
html.theme-light body.file-storage-page .folder-sidebar {
  background: var(--se-surface) !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
  box-shadow: var(--se-shadow-md) !important;
}
html.theme-light body.file-storage-page .folder-sidebar > div:first-child {
  border-bottom-color: var(--se-border) !important;
}
html.theme-light body.file-storage-page .folder-item {
  color: var(--se-text-2) !important;
}
html.theme-light body.file-storage-page .folder-item:hover {
  background: var(--se-hover) !important;
}
html.theme-light body.file-storage-page .folder-item.active {
  background: var(--se-accent-soft) !important;
  color: var(--se-text) !important;
}
html.theme-light body.file-storage-page .folder-item.system {
  color: var(--se-text-muted) !important;
}
html.theme-light body.file-storage-page .folder-item .count {
  background: var(--se-surface-2) !important;
  color: var(--se-text-2) !important;
}
html.theme-light body.file-storage-page .folder-children {
  border-left-color: var(--se-border) !important;
}
html.theme-light body.admin-wow.premium-shell-page.bank-page .stat-card { background-image: var(--se-surface) !important; }
html.theme-light body.admin-wow.premium-shell-page.bank-page .stat-card:nth-child(1) { background-image: var(--se-surface) !important; }
html.theme-light body.admin-wow.premium-shell-page.bank-page .stat-card:nth-child(2) { background-image: var(--se-surface) !important; }
html.theme-light body.admin-wow.premium-shell-page.bank-page .stat-card:nth-child(3) { background-image: var(--se-surface) !important; }
html.theme-light body.admin-wow.premium-shell-page.bank-page .stat-card:nth-child(4) { background-image: var(--se-surface) !important; }
html.theme-light body.admin-wow.premium-shell-page.bank-page .statement-list { background-color: var(--se-surface-3) !important; background-image: none !important; }
html.theme-light body.admin-wow.premium-shell-page.bank-page .statement-item.income { background-color: var(--se-success-bg) !important; background-image: none !important; }
html.theme-light body.admin-wow.premium-shell-page.bank-page .statement-item.expense { background-color: var(--se-warning-bg) !important; background-image: none !important; }
html.theme-light body.admin-wow.premium-shell-page.bank-page .statement-item { border-bottom-color: var(--se-border) !important; }

/* Module-wide light pass: several legacy pages use page-specific navy classes
   that are not covered by the generic .card rules above. Keep this block
   strictly scoped to light mode so dark mode is untouched. */
html.theme-light body .file-main,
html.theme-light body .file-toolbar,
html.theme-light body .breadcrumb-nav,
html.theme-light body .bulk-actions-toolbar,
html.theme-light body .file-content,
html.theme-light body .stats-section,
html.theme-light body .stats-section > .card,
html.theme-light body .stats-grid,
html.theme-light body .stat-box,
html.theme-light body .file-grid-item,
html.theme-light body .folder-grid-item,
html.theme-light body .folder-list-item,
html.theme-light body .file-list-item,
html.theme-light body .file-grid-item .thumb,
html.theme-light body .file-list-item .thumb,
html.theme-light body .selected-file-info,
html.theme-light body .token-result {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body .file-toolbar button,
html.theme-light body .file-toolbar select,
html.theme-light body .file-toolbar input,
html.theme-light body .bulk-actions-toolbar button,
html.theme-light body .file-grid-item .actions button,
html.theme-light body .sidebar-toggle {
  background: var(--se-surface) !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-accent-border) !important;
}
html.theme-light body .file-toolbar button.active,
html.theme-light body .file-list-item.selected,
html.theme-light body .file-grid-item.selected {
  background: var(--se-accent-soft) !important;
  color: var(--se-accent) !important;
  border-color: var(--se-accent) !important;
}
html.theme-light body .folder-grid-item .name,
html.theme-light body .folder-list-item .name,
html.theme-light body .file-grid-item .name,
html.theme-light body .file-list-item .name,
html.theme-light body .file-grid-item .meta,
html.theme-light body .file-list-item .meta,
html.theme-light body .file-list-item .size,
html.theme-light body .file-list-item .date,
html.theme-light body .stat-box .lbl {
  color: var(--se-text-muted) !important;
}
html.theme-light body .folder-grid-item .name,
html.theme-light body .folder-list-item .name { color: var(--se-accent) !important; }

html.theme-light body .sidebar,
html.theme-light body .channel-list,
html.theme-light body .sidebar-header,
html.theme-light body .sidebar-search,
html.theme-light body .chat-container,
html.theme-light body .chat-header,
html.theme-light body .messages-container,
html.theme-light body .input-container,
html.theme-light body .channel-item,
html.theme-light body .channel-icon,
html.theme-light body .reply-context,
html.theme-light body .mention-dropdown,
html.theme-light body .attachment-preview,
html.theme-light body .emoji-picker,
html.theme-light body .reaction-picker {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body .channel-item:hover,
html.theme-light body .channel-item.active,
html.theme-light body .channel-item.active .channel-icon {
  background: var(--se-accent-soft) !important;
  color: var(--se-text) !important;
  border-color: var(--se-accent-border),  !important;
}
html.theme-light body .channel-item.active .channel-last,
html.theme-light body .channel-item.active .channel-time { color: var(--se-text-muted) !important; }
html.theme-light body .channel-name,
html.theme-light body .chat-title,
html.theme-light body .message-content,
html.theme-light body .channel-last { color: var(--se-text) !important; }
html.theme-light body .channel-time,
html.theme-light body .channel-meta,
html.theme-light body .chat-subtitle { color: var(--se-text-muted) !important; }

html.theme-light body.identity-page .brand-card,
html.theme-light body.identity-page .stat-card,
html.theme-light body.identity-page .filter-bar,
html.theme-light body.identity-page .filter-bar input,
html.theme-light body.identity-page .filter-bar select,
html.theme-light body.identity-page .form-group input,
html.theme-light body.identity-page .form-group select,
html.theme-light body.identity-page .form-group textarea,
html.theme-light body.identity-page .style-preview,
html.theme-light body.identity-page .fs-drop-card,
html.theme-light body.identity-page .asset-item,
html.theme-light body.identity-page .usage-role-item {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body.identity-page .brand-name,
html.theme-light body.identity-page .empty-state-title,
html.theme-light body.identity-page .form-group label,
html.theme-light body.identity-page .asset-name { color: var(--se-text) !important; }

/* Inline legacy declarations cannot be changed from the page stylesheet,
   therefore neutralize only the known navy color tokens while light mode is active. */
html.theme-light body [style*="#0b1020"],
html.theme-light body [style*="#0b1128"],
html.theme-light body [style*="#0e1330"],
html.theme-light body [style*="#101a35"],
html.theme-light body [style*="#111731"],
html.theme-light body [style*="#1b2242"],
html.theme-light body [style*="#1a1f3d"],
html.theme-light body [style*="#121a31"] {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
}

/* Companies detail page: its KPI and service panels use legacy navy IDs and
   inline colors, so give them an explicit light treatment. */
html.theme-light body #companyProfileSection,
html.theme-light body #portalAccessSection,
html.theme-light body #financialOverviewSec,
html.theme-light body #companyDocumentsSec,
html.theme-light body #billablesOverviewSec,
html.theme-light body #companyConsumablesSec,
html.theme-light body #companyDepartmentsSec,
html.theme-light body #contactsSection,
html.theme-light body #companyCommunicationSec,
html.theme-light body #eventsSec,
html.theme-light body .hero-card,
html.theme-light body .hero-kv,
html.theme-light body .doc-metric,
html.theme-light body .profile-block,
html.theme-light body .department-card,
html.theme-light body .department-row,
html.theme-light body .inline-panel,
html.theme-light body .company-edit-section,
html.theme-light body .product-access-card,
html.theme-light body .billable-type-group,
html.theme-light body .section-fold,
html.theme-light body .subsection-card,
html.theme-light body .comm-panel,
html.theme-light body .comm-kpi,
html.theme-light body .comm-table-wrap,
html.theme-light body .modal-panel {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
  box-shadow: var(--se-shadow-md) !important;
}
html.theme-light body #financialOverviewSec .stat-card,
html.theme-light body #billablesOverviewSec > div > div,
html.theme-light body #companyConsumablesSec > div > div {
  background: var(--se-surface-2) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body #financialOverviewSec .stat-value,
html.theme-light body #financialOverviewSec .stat-label,
html.theme-light body .doc-metric .k,
html.theme-light body .doc-metric .v,
html.theme-light body .department-card .k,
html.theme-light body .department-card .v,
html.theme-light body .comm-kpi .k,
html.theme-light body .comm-kpi .v,
html.theme-light body .product-access-card,
html.theme-light body .hero-kv,
html.theme-light body .hero-kv * {
  color: var(--se-text) !important;
}
html.theme-light body #financialOverviewSec .stat-label,
html.theme-light body .doc-metric .k,
html.theme-light body .department-card .k,
html.theme-light body .comm-kpi .k,
html.theme-light body .comm-muted,
html.theme-light body .company-detail-muted {
  color: var(--se-text-muted) !important;
}
html.theme-light body.company-detail-page table,
html.theme-light body.company-detail-page main table,
html.theme-light body.company-detail-page main thead th,
html.theme-light body.company-detail-page main tbody td {
  background: var(--se-surface) !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-border) !important;
}

/* Finance workspace: override the page's premium navy skin only in light mode. */
html.theme-light body.finance-page .finance-hero,
html.theme-light body.finance-page .stats-overview,
html.theme-light body.finance-page .stats-block-head,
html.theme-light body.finance-page .accounting-panel,
html.theme-light body.finance-page .accounting-summary-card,
html.theme-light body.finance-page .accounting-kpi,
html.theme-light body.finance-page .accounting-attention-card,
html.theme-light body.finance-page .accounting-action-item,
html.theme-light body.finance-page .accounting-quick-link,
html.theme-light body.finance-page .accounting-booking-detail-card,
html.theme-light body.finance-page .table-wrap,
html.theme-light body.finance-page .balance-table-wrap,
html.theme-light body.finance-page .trend-canvas-wrap,
html.theme-light body.finance-page .modal-card,
html.theme-light body.finance-page .tabs,
html.theme-light body.finance-page .tab,
html.theme-light body.finance-page .doc-toolbar,
html.theme-light body.finance-page .balance-toolbar,
html.theme-light body.finance-page .trend-toolbar,
html.theme-light body.finance-page .accounting-toolbar,
html.theme-light body.finance-page .accounting-card-toolbar {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
  box-shadow: var(--se-shadow-md) !important;
}
html.theme-light body.finance-page .stats-grid--primary .stat-card,
html.theme-light body.finance-page .stats-grid--secondary .stat-card,
html.theme-light body.finance-page .stat-card,
html.theme-light body.finance-page .accounting-summary-card,
html.theme-light body.finance-page .accounting-kpi,
html.theme-light body.finance-page .accounting-action-item,
html.theme-light body.finance-page .accounting-quick-link,
html.theme-light body.finance-page .accounting-booking-detail-card,
html.theme-light body.finance-page .accounting-attention-card {
  background: var(--se-surface-2) !important;
  background-image: none !important;
  color: var(--se-text) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body.finance-page .stat-label,
html.theme-light body.finance-page .accounting-card-eyebrow,
html.theme-light body.finance-page .accounting-summary-note,
html.theme-light body.finance-page .accounting-attention-label,
html.theme-light body.finance-page .accounting-attention-sub,
html.theme-light body.finance-page .accounting-empty,
html.theme-light body.finance-page .accounting-pill,
html.theme-light body.finance-page .mut,
html.theme-light body.finance-page .small {
  color: var(--se-text-muted) !important;
}
html.theme-light body.finance-page .stat-value,
html.theme-light body.finance-page .accounting-summary-value,
html.theme-light body.finance-page .accounting-card-title,
html.theme-light body.finance-page .accounting-attention-value,
html.theme-light body.finance-page .accounting-mini-row,
html.theme-light body.finance-page .accounting-mini-row strong,
html.theme-light body.finance-page .accounting-quick-link,
html.theme-light body.finance-page .accounting-kpi * {
  color: var(--se-text) !important;
}
html.theme-light body.finance-page .accounting-pill,
html.theme-light body.finance-page .trend-legend-pill,
html.theme-light body.finance-page .accounting-link-btn,
html.theme-light body.finance-page .accounting-toolbar input,
html.theme-light body.finance-page .accounting-toolbar select,
html.theme-light body.finance-page .trend-toolbar select,
html.theme-light body.finance-page .doc-toolbar button,
html.theme-light body.finance-page .balance-toolbar button,
html.theme-light body.finance-page .balance-toolbar select,
html.theme-light body.finance-page .doc-toolbar select {
  background: var(--se-surface) !important;
  background-image: none !important;
  color: var(--se-accent) !important;
  border-color: var(--se-accent-border) !important;
}
html.theme-light body.finance-page .accounting-link-btn,
html.theme-light body.finance-page .doc-toolbar button.primary,
html.theme-light body.finance-page .balance-toolbar button.primary {
  background: var(--se-accent) !important;
  color: var(--se-text-inverse) !important;
  border-color: var(--se-accent-border) !important;
}
html.theme-light body.finance-page table,
html.theme-light body.finance-page .balance-table,
html.theme-light body.finance-page .accounting-booking-main td,
html.theme-light body.finance-page .accounting-booking-detail td {
  background: var(--se-surface) !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-border) !important;
}
html.theme-light body.finance-page table th,
html.theme-light body.finance-page .balance-table th,
html.theme-light body.finance-page .balance-table tr.group td {
  background: var(--se-surface-2) !important;
  color: var(--se-text-2) !important;
  border-color: var(--se-border) !important;
}

/* ---------------------------------------------------------------------------
   Afwerking (apple-design): rustige typografie, zachte focus en selectie.
   --------------------------------------------------------------------------- */
html.theme-light body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html.theme-light ::selection {
  background: var(--se-selection-bg);
  color: var(--se-selection-fg);
}

/* Focus alleen tonen bij toetsenbord-navigatie; muis blijft rustig. */
html.theme-light body :focus:not(:focus-visible) {
  outline: none !important;
}
html.theme-light body :focus-visible {
  outline: 2px solid var(--se-focus-ring) !important;
  outline-offset: 2px;
}

/* Stevige, professionele knoppen: direct feedback op indrukken (pointer-down). */
html.theme-light body button,
html.theme-light body .btn,
html.theme-light body .company-nav-btn,
html.theme-light body .nav-link,
html.theme-light body .filter-btn,
html.theme-light body .section-btn {
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}
html.theme-light body button:active,
html.theme-light body .btn:active,
html.theme-light body .company-nav-btn:active {
  transform: scale(0.98);
}
