/**
 * FCMS app-wide light / dark theme
 * Preference: html[data-theme-preference="light|dark|system"]
 * Resolved:   html[data-theme="light|dark"]
 *
 * Light theme = base styles in fcms.css + page CSS.
 * This file only adds dark overrides (and shared theme-picker chrome).
 */

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

/* Full Circle brand tokens for dark mode (grey chrome + gear red) */
html[data-theme="dark"] {
  --fc-red: #c41e3a;
  --fc-red-deep: #e84860;
  --fc-red-soft: #e8a0a8;
  --fc-red-wash: #3a2228;
  --fc-red-border: #6a3040;
  --fc-ink: #eeeeee;
  --fc-body: #e0e0e0;
  --fc-muted: #9a9a9a;
  --fc-steel: #8a8a8a;
  --fc-border: #444444;
  --fc-border-strong: #555555;
  --fc-panel: #1a1a1a;
  --fc-panel-2: #222222;
  --fc-page: #121212;
  --fc-white: #1a1a1a;
  --fc-nav-bg: #1a1a1a;
  --fc-nav-text: #e8e8e8;
  --fc-nav-muted: #9a9a9a;
  --fc-primary: #c41e3a;
  --fc-primary-hover: #e84860;
  --fc-link: #e8a0a8;
  --fc-link-hover: #ffc8d0;
  --fc-focus: #c41e3a;
}


/* ==========================================================================
   Core surfaces
   ========================================================================== */
html[data-theme="dark"] body {
  color: #e6e6e6;
  background: #121212;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5 {
  color: #eeeeee;
}

/* Brand links in dark mode: light text with red hover (not sky blue) */
html[data-theme="dark"] a { color: #e8a0a8; }
html[data-theme="dark"] a:hover { color: #ffc0c8; }
html[data-theme="dark"] .fcms-float-preview,
html[data-theme="dark"] .fcms-float-preview:hover,
html[data-theme="dark"] .fcms-float-preview:focus-visible {
  color: #fff;
}

html[data-theme="dark"] .hint,
html[data-theme="dark"] .readonly-note,
html[data-theme="dark"] .preview,
html[data-theme="dark"] .ls-muted,
html[data-theme="dark"] .mpe-empty,
html[data-theme="dark"] .er-muted,
html[data-theme="dark"] .er-empty,
html[data-theme="dark"] .or-empty,
html[data-theme="dark"] .help-lead {
  color: #9a9a9a;
}

html[data-theme="dark"] .fcms-copyright {
  color: #9a9a9a;
  background: rgba(18, 22, 28, 0.96);
  border-top-color: #2e2e2e;
}
html[data-theme="dark"] .fcms-copyright-line,
html[data-theme="dark"] .fcms-version { color: #9a9a9a; }

html[data-theme="dark"] hr { border-color: #3a3a3a; }
html[data-theme="dark"] code {
  background: #2a2a2a;
  color: #f0d8dc;
}

/* Messages */
html[data-theme="dark"] .error,
html[data-theme="dark"] .fcms-delete-modal-error {
  color: #ff8a9a;
}
html[data-theme="dark"] p.error {
  background: #3a1a22;
  border: 1px solid #6a3040;
  padding: 8px 12px;
  border-radius: 6px;
}
html[data-theme="dark"] .success {
  color: #8fdf9f;
}
html[data-theme="dark"] p.success {
  background: #1a2e22;
  border: 1px solid #2a5a3a;
  padding: 8px 12px;
  border-radius: 6px;
}

html[data-theme="dark"] .dirty-note { color: #e0c36a; }

/* ==========================================================================
   Navigation
   ========================================================================== */
/* Dark nav: charcoal + Full Circle red accent (same brand as light) */
html[data-theme="dark"] .fcms-nav-wrap {
  background: #1a1a1a;
  border-bottom-color: #c41e3a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .fcms-nav,
html[data-theme="dark"] .fcms-nav-bar {
  background: transparent;
  border-color: transparent;
}
html[data-theme="dark"] .fcms-nav-toggle {
  background: #2a2a2a;
  border-color: #444;
  color: #e6e6e6;
}
html[data-theme="dark"] .fcms-nav-toggle-icon::before,
html[data-theme="dark"] .fcms-nav-toggle-icon::after {
  background: #c41e3a;
  box-shadow: 0 7px 0 #c41e3a;
}
html[data-theme="dark"] .fcms-nav-list a,
html[data-theme="dark"] .fcms-nav-toggle-text { color: #e0e0e0; }
html[data-theme="dark"] .fcms-nav-current-label { color: #9a9a9a; }
html[data-theme="dark"] .fcms-nav a:hover {
  color: #fff;
  border-bottom-color: #c41e3a;
}
html[data-theme="dark"] .fcms-nav .nav-current,
html[data-theme="dark"] .fcms-nav strong {
  color: #fff;
  background: transparent;
  border-bottom-color: #c41e3a;
}
html[data-theme="dark"] .fcms-nav-list li:not(:last-child)::after,
html[data-theme="dark"] .fcms-nav .sep {
  color: #7a7a7a;
  background: transparent;
  opacity: 1;
  font-weight: 600;
}
html[data-theme="dark"] .fcms-nav-list li { border-bottom-color: #333; }
html[data-theme="dark"] .fcms-nav-list li.is-current { background: #3a2228; }
html[data-theme="dark"] .fcms-nav-list li.is-current .nav-current {
  color: #fff;
  background: transparent;
}
html[data-theme="dark"] .role-switcher,
html[data-theme="dark"] .role-switch-form label { color: #c5c5c5; }
html[data-theme="dark"] .role-switch-form select {
  background: #1a1a1a;
  color: #e6e6e6;
  border-color: #444444;
}
html[data-theme="dark"] .fcms-logout-btn {
  background: #2a1c1c;
  border-color: #6a4040;
  color: #e8a8a8;
}
html[data-theme="dark"] .fcms-logout-btn:hover {
  background: #3a2424;
  border-color: #8a5555;
  color: #f0c0c0;
}
html[data-theme="dark"] .fcms-logout-btn:focus-visible {
  outline-color: #e8a8b0;
}

/* ==========================================================================
   Forms & buttons
   ========================================================================== */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] input.miles,
html[data-theme="dark"] .fcms-task-complete-notes,
html[data-theme="dark"] .fcms-delete-modal-reason {
  background: #1a1a1a;
  color: #e6e6e6;
  border-color: #454545;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #8a8a8a; }
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] input.miles:focus {
  border-color: #c41e3a;
  outline-color: #c41e3a;
}
html[data-theme="dark"] label { color: #d0d0d0; }

html[data-theme="dark"] button,
html[data-theme="dark"] .btn,
html[data-theme="dark"] input[type="submit"],
html[data-theme="dark"] .asg-nav-btn,
html[data-theme="dark"] .mpe-nav-btn,
html[data-theme="dark"] .btn-task,
html[data-theme="dark"] .bulk-bar button {
  background: #222222;
  color: #e6e6e6;
  border-color: #454545;
}
html[data-theme="dark"] button:hover:not(:disabled),
html[data-theme="dark"] .btn:hover:not(:disabled),
html[data-theme="dark"] .btn-task:hover:not(:disabled),
html[data-theme="dark"] .bulk-bar button:hover:not(:disabled) {
  background: #303030;
}

html[data-theme="dark"] button.primary,
html[data-theme="dark"] .btn.primary,
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] form.stack button,
html[data-theme="dark"] form.stack button[type="submit"],
html[data-theme="dark"] body.page-login button,
html[data-theme="dark"] .page-actions button#save-update,
html[data-theme="dark"] button.btn-save,
html[data-theme="dark"] .week-primary-btn,
html[data-theme="dark"] .week-next-btn,
html[data-theme="dark"] .photo-pick-btn:not(.secondary),
html[data-theme="dark"] .alert-banner .btn-primary,
html[data-theme="dark"] .alert-modal-actions .btn-primary {
  background: #c41e3a;
  border-color: #c41e3a;
  color: #fff;
}
html[data-theme="dark"] button.primary:hover,
html[data-theme="dark"] .btn.primary:hover,
html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] form.stack button:hover,
html[data-theme="dark"] body.page-login button:hover,
html[data-theme="dark"] .page-actions button#save-update:hover:not(:disabled),
html[data-theme="dark"] button.btn-save:hover:not(:disabled),
html[data-theme="dark"] .week-primary-btn:hover,
html[data-theme="dark"] .week-next-btn:hover {
  background: #a04050;
}
html[data-theme="dark"] .week-secondary-btn {
  background: #222222;
  border-color: #454545;
  color: #e6e6e6;
}
html[data-theme="dark"] .week-secondary-btn:hover {
  filter: brightness(1.08);
  color: #e6e6e6;
}

html[data-theme="dark"] .btn-void { background: #c0392b !important; color: #fff !important; }
html[data-theme="dark"] .btn-restore { background: #2a8f5a !important; color: #fff !important; }
html[data-theme="dark"] .bulk-bar button.danger {
  background: #3a2020;
  border-color: #a66;
  color: #ffb0b0;
}

html[data-theme="dark"] button.meal-btn,
html[data-theme="dark"] button.bulk-day-btn {
  background: #2a2a2a;
  border-color: #555555;
  color: #e6e6e6;
}
html[data-theme="dark"] button.meal-btn.on {
  background: #2a7a3a;
  border-color: #1f5c2b;
  color: #fff;
}
html[data-theme="dark"] button.bulk-day-btn {
  background: #1a2e24;
  border-color: #3a6a4a;
}

/* ==========================================================================
   Panels / cards / boxes (shared)
   ========================================================================== */
html[data-theme="dark"] .info-box,
html[data-theme="dark"] .rates,
html[data-theme="dark"] .void-section,
html[data-theme="dark"] .void-banner,
html[data-theme="dark"] .entry-view,
html[data-theme="dark"] .editor-wrap,
html[data-theme="dark"] .feedback-box,
html[data-theme="dark"] .feedback-box-body,
html[data-theme="dark"] .dev-card,
html[data-theme="dark"] .help-card,
html[data-theme="dark"] .help-toc,
html[data-theme="dark"] .ss-card,
html[data-theme="dark"] .ss-roadmap,
html[data-theme="dark"] .mpe-card,
html[data-theme="dark"] .mpe-bar,
html[data-theme="dark"] .er-list-filters,
html[data-theme="dark"] .ls-filters,
html[data-theme="dark"] .or-toolbar,
html[data-theme="dark"] .or-summary,
html[data-theme="dark"] .al-toolbar,
html[data-theme="dark"] .al-detail,
html[data-theme="dark"] .photo-storage-note,
html[data-theme="dark"] .alert-banner,
html[data-theme="dark"] .alert-modal,
html[data-theme="dark"] .roadmap-page .ss-roadmap-body,
html[data-theme="dark"] .pw-gen-block,
html[data-theme="dark"] .pw-gen-display {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}

html[data-theme="dark"] .void-banner {
  background: #3a3420;
  border-color: #6a5a20;
  color: #e0c36a;
}

html[data-theme="dark"] .entry-view { background: #141414; }

/* ==========================================================================
   Tables
   ========================================================================== */
html[data-theme="dark"] table.data,
html[data-theme="dark"] table.grid,
html[data-theme="dark"] table.mpe-table,
html[data-theme="dark"] table.ls-table,
html[data-theme="dark"] table.help-table,
html[data-theme="dark"] table.ss-roadmap-table,
html[data-theme="dark"] table.task-table,
html[data-theme="dark"] table.er-table {
  color: #e6e6e6;
}

html[data-theme="dark"] table.data th,
html[data-theme="dark"] table.grid th,
html[data-theme="dark"] table.mpe-table th,
html[data-theme="dark"] table.ls-table th,
html[data-theme="dark"] table.help-table th,
html[data-theme="dark"] table.ss-roadmap-table th,
html[data-theme="dark"] table.task-table th,
html[data-theme="dark"] table.er-table th {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: #454545;
}

html[data-theme="dark"] table.data td,
html[data-theme="dark"] table.grid td,
html[data-theme="dark"] table.mpe-table td,
html[data-theme="dark"] table.ls-table td,
html[data-theme="dark"] table.help-table td,
html[data-theme="dark"] table.ss-roadmap-table td,
html[data-theme="dark"] table.task-table td,
html[data-theme="dark"] table.er-table td {
  border-color: #3a3a3a;
  background: #161c26;
  color: #e6e6e6;
}

html[data-theme="dark"] table.data tr:hover,
html[data-theme="dark"] table.grid tbody tr:hover {
  background: #1e1e1e;
}
html[data-theme="dark"] table.data tr:hover td,
html[data-theme="dark"] table.grid tbody tr:hover td {
  background: #1e1e1e;
}

html[data-theme="dark"] table.grid th.day-col,
html[data-theme="dark"] table.grid td.day-col,
html[data-theme="dark"] table.data th.day-col,
html[data-theme="dark"] table.data td.day-col {
  background: #1a1a1a;
}

html[data-theme="dark"] table.grid th.miles-col,
html[data-theme="dark"] table.grid td.miles-col {
  background: #162820;
}
html[data-theme="dark"] table.grid th.miles-col { background: #1a3024; }

html[data-theme="dark"] table.grid tfoot td,
html[data-theme="dark"] table.data tfoot td,
html[data-theme="dark"] table.mpe-table tfoot td {
  background: #222222;
  color: #eeeeee;
}
html[data-theme="dark"] table.grid tfoot td.miles-col { background: #1a3024; }

html[data-theme="dark"] tr.voided,
html[data-theme="dark"] tr.voided:hover {
  background: #2a1a1a;
  color: #9a8a8a;
}
html[data-theme="dark"] tr.voided td { background: #2a1a1a; }

html[data-theme="dark"] tr.task-completed td {
  background: #162820;
  color: #9a9a9a;
}
html[data-theme="dark"] tr.task-row.task-dragging { background: #1e1e1e; }
html[data-theme="dark"] tr.ls-open { background: #162820; }
html[data-theme="dark"] tr.ls-open td { background: #162820; }

/* ==========================================================================
   Badges / pills / status
   ========================================================================== */
html[data-theme="dark"] .badge-task-open,
html[data-theme="dark"] .week-badge-need,
html[data-theme="dark"] .ls-pill.idle {
  background: #3a3420;
  color: #e0c36a;
  border-color: #6a5a20;
}
html[data-theme="dark"] .badge-task-done,
html[data-theme="dark"] .week-badge-done,
html[data-theme="dark"] .ls-pill.open {
  background: #1a3a28;
  color: #8fdf9f;
  border-color: #2a6a40;
}
html[data-theme="dark"] .week-badge-opt,
html[data-theme="dark"] .ls-pill,
html[data-theme="dark"] .ls-pill.logout,
html[data-theme="dark"] .er-st {
  background: #2a2a2a;
  color: #c5c5c5;
  border-color: #454545;
}
html[data-theme="dark"] .badge-void {
  background: #c0392b;
  color: #fff;
}
html[data-theme="dark"] .er-st-signed {
  background: #1a3a28;
  color: #8fdf9f;
  border-color: #2a6a40;
}
html[data-theme="dark"] .er-st-partial {
  background: #3a3420;
  color: #e0c36a;
  border-color: #6a5a20;
}
html[data-theme="dark"] .er-st-issued {
  background: #2a2a2a;
  color: #b0b0b0;
  border-color: #454545;
}

/* ==========================================================================
   Week context strip (Hours / Service / Per diem / Expenses)
   ========================================================================== */
html[data-theme="dark"] .week-strip {
  background: #1a1a1a;
  border-color: #4a3a40;
  color: #e6e6e6;
}
html[data-theme="dark"] .week-strip-main {
  color: #eeeeee;
}
html[data-theme="dark"] .week-strip-main a {
  color: #e098a0;
}
html[data-theme="dark"] .week-strip-main strong {
  color: #fff;
}
html[data-theme="dark"] .week-strip-check {
  color: #a8a8a8;
}
html[data-theme="dark"] .week-strip-check .sep {
  color: #7a7a7a;
}
html[data-theme="dark"] .week-strip-check a.week-step-done {
  color: #6dce94;
}
html[data-theme="dark"] .week-strip-check a.week-step-todo {
  color: #a8a8a8;
}
html[data-theme="dark"] .week-strip-actions .week-next-btn,
html[data-theme="dark"] .week-strip .week-next-btn {
  background: #c41e3a;
  color: #fff !important;
}

/* Hub panels / toolbars (wide desktop list pages) */
html[data-theme="dark"] .hub-panel {
  background: #1a1a1a;
  border-color: #4a4a4a;
}
html[data-theme="dark"] .hub-toolbar {
  background: #1a1a1a;
  border-color: #4a4a4a;
}
html[data-theme="dark"] .hub-toolbar label {
  color: #b0b0b0;
}
html[data-theme="dark"] .hub-toolbar input,
html[data-theme="dark"] .hub-toolbar select {
  background: #141414;
  color: #e6e6e6;
  border-color: #4a4a4a;
}

/* TinyMCE rich-text boxes (service notes, scope, quotes, report template)
   oxide-dark skin is loaded via service-editor.js; these rules reinforce chrome. */
html[data-theme="dark"] .editor-wrap {
  background: transparent;
}
html[data-theme="dark"] .tox-tinymce {
  border: 1px solid #444444 !important;
  border-radius: 8px !important;
  background: #1a1a1a !important;
}
html[data-theme="dark"] .tox .tox-edit-area,
html[data-theme="dark"] .tox .tox-edit-area__iframe {
  background: #141414 !important;
}
html[data-theme="dark"] .tox:not(.tox-tinymce-inline) .tox-editor-header {
  background: #1a1a1a !important;
  border-bottom: 1px solid #3a3a3a !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .tox .tox-toolbar,
html[data-theme="dark"] .tox .tox-toolbar__primary,
html[data-theme="dark"] .tox .tox-toolbar__overflow,
html[data-theme="dark"] .tox .tox-menubar {
  background: #1a1a1a !important;
}
html[data-theme="dark"] .tox .tox-tbtn,
html[data-theme="dark"] .tox .tox-mbtn,
html[data-theme="dark"] .tox .tox-tbtn svg,
html[data-theme="dark"] .tox .tox-tbtn__select-label {
  color: #d0d0d0 !important;
  fill: #d0d0d0 !important;
}
html[data-theme="dark"] .tox .tox-tbtn:hover,
html[data-theme="dark"] .tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active) {
  background: #303030 !important;
}
html[data-theme="dark"] .tox .tox-tbtn--enabled,
html[data-theme="dark"] .tox .tox-tbtn--enabled:hover,
html[data-theme="dark"] .tox .tox-mbtn--active {
  background: #c41e3a !important;
}
html[data-theme="dark"] .tox .tox-statusbar {
  background: #1a1a1a !important;
  border-top: 1px solid #3a3a3a !important;
  color: #9a9a9a !important;
}
html[data-theme="dark"] .tox .tox-statusbar a,
html[data-theme="dark"] .tox .tox-statusbar__path-item,
html[data-theme="dark"] .tox .tox-statusbar__wordcount {
  color: #9a9a9a !important;
}
html[data-theme="dark"] .tox .tox-collection--list .tox-collection__item {
  color: #e6e6e6;
}
html[data-theme="dark"] .tox .tox-menu,
html[data-theme="dark"] .tox .tox-collection--list,
html[data-theme="dark"] .tox .tox-dialog,
html[data-theme="dark"] .tox .tox-dialog__header,
html[data-theme="dark"] .tox .tox-dialog__footer,
html[data-theme="dark"] .tox .tox-dialog__body {
  background: #1a1a1a !important;
  color: #e6e6e6 !important;
  border-color: #444444 !important;
}
html[data-theme="dark"] .tox .tox-dialog__title,
html[data-theme="dark"] .tox .tox-label {
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .tox .tox-textfield,
html[data-theme="dark"] .tox .tox-listboxfield .tox-listbox--select,
html[data-theme="dark"] .tox .tox-textarea {
  background: #141414 !important;
  color: #e6e6e6 !important;
  border-color: #454545 !important;
}
html[data-theme="dark"] .tox .tox-button--secondary {
  background: #2a2a2a !important;
  color: #e6e6e6 !important;
  border-color: #454545 !important;
}
html[data-theme="dark"] .preview {
  color: #a8a8a8;
}
/* Fallback if editor not yet upgraded: raw textarea before TinyMCE mounts */
html[data-theme="dark"] .editor-wrap textarea,
html[data-theme="dark"] textarea#entry,
html[data-theme="dark"] textarea#scope_summary,
html[data-theme="dark"] textarea#scope_of_work,
html[data-theme="dark"] textarea#body_html {
  background: #141414;
  color: #e6e6e6;
  border-color: #444444;
}

/* ==========================================================================
   Week overview
   ========================================================================== */
html[data-theme="dark"] .week-card {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .week-card:hover {
  border-color: #c41e3a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  background: #1e1e1e;
}
html[data-theme="dark"] .week-card-done {
  border-left-color: #3cb371;
  background: #162820;
}
html[data-theme="dark"] .week-card-empty {
  border-left-color: #555555;
  background: #1a1a1a;
}
html[data-theme="dark"] .week-card-top { color: #eeeeee; }
html[data-theme="dark"] .week-card-detail { color: #a8a8a8; }
html[data-theme="dark"] .week-card-go { color: #e098a0; }
html[data-theme="dark"] .week-step-done { color: #8fdf9f; }
html[data-theme="dark"] .week-step-todo { color: #9a9a9a; }
html[data-theme="dark"] .week-summary h3 { color: #eeeeee; }

html[data-theme="dark"] .week-tasks-panel {
  background: #1a1a1a;
  border-color: #444444;
}
html[data-theme="dark"] .week-tasks-panel > summary { color: #eeeeee; }
html[data-theme="dark"] .week-tasks-panel > summary::before { color: #e098a0; }
html[data-theme="dark"] .week-tasks-panel > summary .week-tasks-meta { color: #9a9a9a; }
html[data-theme="dark"] .week-tasks-panel > summary .week-tasks-go { color: #e098a0; }
html[data-theme="dark"] .week-tasks-body {
  background: #141414;
  border-top-color: #3a3a3a;
  color: #e6e6e6;
}
html[data-theme="dark"] .week-tasks-body .task-completion-result {
  background: #1a2e24;
  border-color: #2a5a3a;
  color: #c5e8c5;
}
html[data-theme="dark"] .fcms-task-complete-card,
html[data-theme="dark"] .fcms-delete-modal-card {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .fcms-task-complete-card h3,
html[data-theme="dark"] .fcms-delete-modal-card h3 { color: #e8a8b0; }
html[data-theme="dark"] .fcms-task-complete-desc,
html[data-theme="dark"] .fcms-task-complete-hint,
html[data-theme="dark"] .fcms-delete-modal-msg { color: #a8a8a8; }

/* ==========================================================================
   Photos
   ========================================================================== */
html[data-theme="dark"] .photo-card,
html[data-theme="dark"] .photo-category-block,
html[data-theme="dark"] .photo-gallery-wrap {
  color: #e6e6e6;
}
html[data-theme="dark"] .photo-category-title { color: #e8a8b0; }
html[data-theme="dark"] .photo-meta,
html[data-theme="dark"] .photo-caption { color: #c5c5c5; }
html[data-theme="dark"] .photo-pick-btn.secondary {
  background: #222222;
  color: #e6e6e6;
  border-color: #454545;
}
html[data-theme="dark"] .photo-preview-card {
  background: #1a1a1a;
  border-color: #3a3a3a;
}
html[data-theme="dark"] .photo-drop-zone {
  background: #222222;
  border-color: #555555;
}
html[data-theme="dark"] .photo-drop-copy { color: #eeeeee; }
html[data-theme="dark"] .photo-drop-sub { color: #9a9a9a; }
html[data-theme="dark"] .photo-drop-zone.is-drag,
html[data-theme="dark"] #photo-upload-form.is-drag-over .photo-drop-zone {
  background: #3a2228;
  border-color: #c41e3a;
}
html[data-theme="dark"] .photo-batch-status { color: #eeeeee; }
html[data-theme="dark"] .photo-batch-status.is-ok { color: #7dcea0; }
html[data-theme="dark"] .photo-batch-status.is-error { color: #e8a0a8; }
html[data-theme="dark"] .photo-pick-clear {
  background: #2a2a2a;
  border-color: #454545;
  color: #c5c5c5;
}
html[data-theme="dark"] #photo-pick-count { color: #d0d0d0; }
html[data-theme="dark"] .fcms-photo-thumb {
  background: #1a1a1a;
  border-color: #444444;
}
html[data-theme="dark"] .fcms-photo-thumb:hover,
html[data-theme="dark"] .fcms-photo-thumb:focus {
  border-color: #c41e3a;
}

/* ==========================================================================
   Dashboard / feedback / alerts
   ========================================================================== */
html[data-theme="dark"] a.btn-primary,
html[data-theme="dark"] .btn.btn-primary {
  color: #fff !important;
}
html[data-theme="dark"] .dash-section-title {
  color: #d0d0d0;
  border-color: #3a3a3a;
}
html[data-theme="dark"] .quick-links a { color: #e098a0; }
html[data-theme="dark"] .feedback-box-header h3,
html[data-theme="dark"] .dev-card h3,
html[data-theme="dark"] .help-card h3 { color: #e8a8b0; }
html[data-theme="dark"] .feedback-box-toggle { color: #e098a0; }
html[data-theme="dark"] .feedback-type-row label {
  background: #2a2a2a;
  border-color: #454545;
  color: #d0d0d0;
}
html[data-theme="dark"] .feedback-type-row label:has(input:checked) {
  background: #c41e3a;
  border-color: #c41e3a;
  color: #fff;
}
html[data-theme="dark"] .feedback-count-pill {
  background: #c0392b;
  color: #fff;
}
html[data-theme="dark"] .alert-modal-backdrop {
  background: rgba(0, 0, 0, 0.55);
}

/* Dashboard quote / staffing popups — page CSS sets p { color:#334 } which is unreadable on dark */
html[data-theme="dark"] .alert-modal {
  background: #1a1a1a !important;
  border: 1px solid #444444;
  color: #e6e6e6;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .alert-modal h3 {
  color: #eeeeee !important;
}
html[data-theme="dark"] .alert-modal p,
html[data-theme="dark"] .alert-modal li,
html[data-theme="dark"] .alert-modal ul {
  color: #d0d0d0 !important;
}
html[data-theme="dark"] .alert-modal a {
  color: #e098a0 !important;
}
html[data-theme="dark"] .alert-modal a:hover {
  color: #ffc8d0 !important;
}
html[data-theme="dark"] .alert-modal strong {
  color: #fff !important;
}

/* Nested week cards inside staffing modal (were hard-coded light in page CSS) */
html[data-theme="dark"] .alert-modal-panel {
  background: #141414 !important;
  border-color: #444444 !important;
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .alert-modal-panel p,
html[data-theme="dark"] .alert-modal-panel li,
html[data-theme="dark"] .alert-modal-panel ul {
  color: #d0d0d0 !important;
}
html[data-theme="dark"] .alert-modal-panel strong {
  color: #fff !important;
}
html[data-theme="dark"] .alert-modal-panel a.btn-primary {
  color: #fff !important;
}

/* Inline banners on dashboard (staffing / quotes) */
html[data-theme="dark"] .alert-banner {
  background: #2a2818 !important;
  border-color: #6a5a20 !important;
  color: #e8e0c8 !important;
}
html[data-theme="dark"] .alert-banner strong {
  color: #fff3c8 !important;
}
html[data-theme="dark"] .alert-banner a {
  color: #e8a8b0 !important;
}

html[data-theme="dark"] .alert-banner .btn,
html[data-theme="dark"] .alert-modal-actions .btn {
  background: #2a2a2a !important;
  border-color: #555555 !important;
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .alert-banner .btn-primary,
html[data-theme="dark"] .alert-modal-actions .btn-primary {
  background: #c41e3a !important;
  border-color: #c41e3a !important;
  color: #fff !important;
}
html[data-theme="dark"] .dev-card:hover {
  border-color: #c41e3a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .help-card.tip {
  background: #2a2818;
  border-color: #6a5a20;
}
html[data-theme="dark"] .help-card.tip h3 { color: #e0c36a; }
html[data-theme="dark"] .help-card .tag {
  background: #2a2a2a;
  border-color: #555555;
  color: #e8a8b0;
}
html[data-theme="dark"] .help-table th { background: #2a2a2a; }

/* ==========================================================================
   Global Feedback/Bugs modal
   ========================================================================== */
html[data-theme="dark"] .fcms-help-toggle,
html[data-theme="dark"] .fcms-ri-launch {
  background: #c41e3a;
  border-color: #4a2028;
  color: #fff;
}
html[data-theme="dark"] .fcms-help-toggle[aria-pressed="false"] {
  background: #4a4a4a;
  border-color: #333;
  color: #e6e6e6;
}
html[data-theme="dark"] .fcms-ri-dialog {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .fcms-ri-head h2 {
  color: #eeeeee;
}
html[data-theme="dark"] .fcms-ri-close {
  color: #9a9a9a;
}
html[data-theme="dark"] .fcms-ri-lead,
html[data-theme="dark"] .fcms-ri-hint,
html[data-theme="dark"] .fcms-ri-types legend {
  color: #9a9a9a;
}
html[data-theme="dark"] .fcms-ri-types {
  border-color: #444444;
  background: #141414;
}
html[data-theme="dark"] .fcms-ri-form label,
html[data-theme="dark"] .fcms-ri-type {
  color: #d0d0d0;
}
html[data-theme="dark"] .fcms-ri-form input[type="text"],
html[data-theme="dark"] .fcms-ri-form textarea {
  background: #141414;
  color: #e6e6e6;
  border-color: #454545;
}
html[data-theme="dark"] .fcms-ri-actions button.primary {
  background: #c41e3a;
  border-color: #c41e3a;
  color: #fff;
}
html[data-theme="dark"] .fcms-ri-cancel {
  background: #222222;
  border-color: #454545;
  color: #e6e6e6;
}
html[data-theme="dark"] .fcms-ri-flash {
  background: #1a2e22;
  border-color: #2a5a3a;
  color: #8fdf9f;
}
html[data-theme="dark"] .fcms-ri-backdrop {
  background: rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   Admin reference data (types)
   ========================================================================== */
html[data-theme="dark"] .at-tabs a {
  background: #1a1a1a;
  border-color: #444444;
  color: #d0d0d0;
}
html[data-theme="dark"] .at-tabs a.is-on {
  background: #c41e3a;
  border-color: #c41e3a;
  color: #fff;
}
html[data-theme="dark"] .at-card {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .at-card h3 {
  color: #eeeeee;
}
html[data-theme="dark"] .at-form input[type="text"],
html[data-theme="dark"] .at-form input[type="number"] {
  background: #141414;
  color: #e6e6e6;
  border-color: #454545;
}
html[data-theme="dark"] .at-form a.btn {
  background: #222222;
  border-color: #454545;
  color: #e6e6e6;
}
html[data-theme="dark"] .at-form button.primary {
  background: #c41e3a;
  border-color: #c41e3a;
  color: #fff;
}
html[data-theme="dark"] .at-pill.on {
  background: #1a2e22;
  border-color: #2a5a3a;
  color: #8fdf9f;
}
html[data-theme="dark"] .at-pill.off {
  background: #2a2a2a;
  border-color: #454545;
  color: #9a9a9a;
}

/* ==========================================================================
   Audit log (Admin / Developer)
   ========================================================================== */
html[data-theme="dark"] .al-toolbar label {
  color: #c5c5c5;
}
html[data-theme="dark"] .al-toolbar select,
html[data-theme="dark"] .al-toolbar input[type="text"] {
  background: #141414;
  color: #e6e6e6;
  border: 1px solid #454545;
  border-radius: 4px;
}
html[data-theme="dark"] .al-toolbar select:focus,
html[data-theme="dark"] .al-toolbar input[type="text"]:focus {
  border-color: #c41e3a;
  outline-color: #c41e3a;
}
html[data-theme="dark"] .al-toolbar button.primary,
html[data-theme="dark"] .al-toolbar .btn.primary {
  background: #c41e3a;
  border-color: #c41e3a;
  color: #fff;
}
html[data-theme="dark"] .al-toolbar a.btn {
  background: #222222;
  border: 1px solid #454545;
  color: #e6e6e6;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}
html[data-theme="dark"] .al-count {
  color: #9a9a9a;
}
html[data-theme="dark"] .al-empty {
  color: #9a9a9a;
}
html[data-theme="dark"] .al-json {
  color: #c5c5c5;
}
html[data-theme="dark"] .al-reason {
  color: #e0c36a;
}
html[data-theme="dark"] .al-meta {
  color: #e6e6e6;
}
html[data-theme="dark"] .al-detail h3 {
  color: #eeeeee;
  border: none;
}
html[data-theme="dark"] .al-detail pre {
  background: #141414;
  border-color: #454545;
  color: #f0d8dc;
}
html[data-theme="dark"] .al-act-ins {
  background: #1a2e22;
  border-color: #2a5a3a;
  color: #8fdf9f;
}
html[data-theme="dark"] .al-act-upd {
  background: #1a1a1a;
  border-color: #4a383e;
  color: #e098a0;
}
html[data-theme="dark"] .al-act-del {
  background: #3a1a22;
  border-color: #6a3040;
  color: #ff8a9a;
}

/* ==========================================================================
   My pay / expense list / login sessions / outstanding
   ========================================================================== */
html[data-theme="dark"] .mpe-card .k { color: #9a9a9a; }
html[data-theme="dark"] .mpe-card .v { color: #e8a8b0; }
html[data-theme="dark"] .mpe-card.mpe-accent {
  background: #1e1e1e;
  border-color: #555555;
}
html[data-theme="dark"] .mpe-tabs a {
  background: #1a1a1a;
  border-color: #444444;
  color: #d0d0d0;
}
html[data-theme="dark"] .mpe-tabs a.is-on {
  background: #c41e3a;
  border-color: #c41e3a;
  color: #fff;
}
html[data-theme="dark"] .mpe-period .mpe-label { color: #e8a8b0; }

html[data-theme="dark"] .or-badge,
html[data-theme="dark"] .or-badge-service,
html[data-theme="dark"] .or-badge-expense {
  background: #2a2a2a;
  border-color: #454545;
  color: #d0d0d0;
}
html[data-theme="dark"] .or-ok { color: #8fdf9f; }
html[data-theme="dark"] .or-miss { color: #ff8a9a; }

/* ==========================================================================
   Time off
   ========================================================================== */
html[data-theme="dark"] .to-st-ok {
  background: #1a3a28;
  color: #8fdf9f;
  border-color: #2a6a40;
}
html[data-theme="dark"] .to-st-pend {
  background: #3a3420;
  color: #e0c36a;
  border-color: #6a5a20;
}
html[data-theme="dark"] .to-st-deny,
html[data-theme="dark"] .to-st-cancel {
  background: #3a1a22;
  color: #ff8a9a;
  border-color: #6a3040;
}

/* ==========================================================================
   Projects (project-ui.css)
   ========================================================================== */
html[data-theme="dark"] .project-panel {
  background: #1a1a1a;
  border-color: #555555;
  color: #d0d0d0;
}
html[data-theme="dark"] .project-panel.project-panel-info {
  background: #1a1a1a;
  border-color: #555555;
  color: #d0d0d0;
}
html[data-theme="dark"] .project-panel a {
  color: #e098a0;
}
html[data-theme="dark"] .project-form-block {
  background: #151c26;
  border-color: #454545;
}
html[data-theme="dark"] .project-hub {
  background: #151c26;
  border-color: #454545;
}
html[data-theme="dark"] .project-hub-name,
html[data-theme="dark"] .project-hub-meta {
  color: #9a9a9a;
}
html[data-theme="dark"] .project-hub-on { color: #8fd0a0; }
html[data-theme="dark"] .project-hub-off { color: #e0a060; }
html[data-theme="dark"] .project-hub-tile {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .project-hub-tile:hover,
html[data-theme="dark"] .project-hub-tile:focus-visible {
  border-color: #b84858;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .project-hub-tile-label { color: #e8a8b0; }
html[data-theme="dark"] .project-hub-tile-stat { color: #9a9a9a; }
html[data-theme="dark"] .project-modal-backdrop {
  background: rgba(0, 0, 0, 0.62);
}
html[data-theme="dark"] .project-modal-panel {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .project-modal-header {
  background: #141414;
  border-bottom-color: #444444;
}
html[data-theme="dark"] .project-modal-header h3 { color: #e8a8b0; }
html[data-theme="dark"] .project-modal-close { color: #9a9a9a; }
html[data-theme="dark"] .project-modal-close:hover { color: #e6e6e6; }
html[data-theme="dark"] .project-section {
  border-top-color: #444444;
}
html[data-theme="dark"] .machine-checkboxes {
  background: #141414;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .machine-checkboxes label {
  color: #e6e6e6;
}
html[data-theme="dark"] .project-active-warn {
  color: #e0a060 !important;
}
html[data-theme="dark"] .task-completion-result {
  background: #1a2e24 !important;
  border-color: #2a5a3a !important;
  color: #c5e8c5 !important;
}
html[data-theme="dark"] .task-prompt-hint em {
  color: #a8a8a8;
}
html[data-theme="dark"] .fcms-task-complete-card {
  background: #1a1a1a !important;
  border-color: #444444 !important;
  color: #e6e6e6;
}
html[data-theme="dark"] .fcms-task-complete-card h3 {
  color: #e8a8b0;
}
html[data-theme="dark"] .fcms-task-complete-desc,
html[data-theme="dark"] .fcms-task-complete-hint {
  color: #a8a8a8 !important;
}
html[data-theme="dark"] .fcms-task-complete-notes {
  background: #141414;
  color: #e6e6e6;
  border-color: #454545;
}
html[data-theme="dark"] .project-section-heading {
  color: #e8a8b0;
}

/* ==========================================================================
   Quotes (edit / list panels — quote-ui.css)
   ========================================================================== */
html[data-theme="dark"] .quote-panel {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .quote-panel.quote-panel-success {
  background: #162820;
  border-color: #2a6a40;
  color: #c5e8c5;
}
html[data-theme="dark"] .quote-panel.quote-panel-info {
  background: #1a1a1a;
  border-color: #555555;
  color: #d0d0d0;
}
html[data-theme="dark"] .quote-panel.quote-panel-muted {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .quote-panel a {
  color: #e098a0;
}
html[data-theme="dark"] .quote-expired-banner {
  background: #3a1a22 !important;
  border-color: #a05050 !important;
  color: #ffb0b0 !important;
}
html[data-theme="dark"] .quote-expired-banner a {
  color: #ffd0d0 !important;
}
html[data-theme="dark"] .quote-rev-label {
  color: #e8a8b0;
}
/* Customer total box above line items */
html[data-theme="dark"] .quote-total-box {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .quote-total-box-warn {
  background: #2a2410;
  border-color: #8a7020;
  color: #f0e6c8;
}
html[data-theme="dark"] .quote-total-box-main,
html[data-theme="dark"] .quote-total-amount,
html[data-theme="dark"] .quote-line-sum-val {
  color: #e6e6e6;
}
html[data-theme="dark"] .quote-total-box .hint,
html[data-theme="dark"] .quote-total-box-note,
html[data-theme="dark"] .quote-total-box-meta {
  color: #b0b0b0;
}
html[data-theme="dark"] .quote-total-box code {
  background: #141414;
  color: #d0d0d0;
  border: 1px solid #454545;
  padding: 1px 5px;
  border-radius: 3px;
}
html[data-theme="dark"] .quote-tax-breakdown {
  border-top-color: #444444;
}
html[data-theme="dark"] .quote-tax-table tr.quote-tax-grand td {
  border-top-color: #5a5a5a;
}
html[data-theme="dark"] .quote-tax-class-cell select {
  background: #141414;
  color: #e6e6e6;
  border: 1px solid #454545;
}
/* Line items table */
html[data-theme="dark"] table.data.quote-lines-table input[type="text"],
html[data-theme="dark"] table.data.quote-lines-table input[type="number"] {
  background: #141414 !important;
  color: #e6e6e6 !important;
  border-color: #454545 !important;
}
html[data-theme="dark"] table.data.quote-lines-table input::placeholder {
  color: #787878;
  opacity: 1;
}
html[data-theme="dark"] table.data.quote-lines-table .quote-line-total {
  color: #e6e6e6;
}
html[data-theme="dark"] table.data.quote-lines-table tfoot td {
  background: #1a1a1a;
  border-top-color: #5a5a5a;
  color: #e6e6e6;
}
html[data-theme="dark"] .line-actions button {
  background: #2a2a2a;
  border-color: #555555;
  color: #e6e6e6;
}
html[data-theme="dark"] .line-actions button[type="submit"]:not(.btn-void) {
  background: #c41e3a;
  border-color: #c41e3a;
  color: #fff;
}
html[data-theme="dark"] .line-actions button.btn-void {
  background: #3a2020;
  border-color: #a44;
  color: #ffb0b0;
}
html[data-theme="dark"] .quote-prep-sub,
html[data-theme="dark"] .quote-clause-body {
  color: #9a9a9a !important;
}
html[data-theme="dark"] table.data input[type="text"],
html[data-theme="dark"] table.data input[type="number"] {
  background: #1a1a1a;
  color: #e6e6e6;
  border-color: #454545;
}

/* ==========================================================================
   Quote calendar
   ========================================================================== */
html[data-theme="dark"] .qc-toolbar,
html[data-theme="dark"] .qc-legend,
html[data-theme="dark"] .qc-list,
html[data-theme="dark"] .qc-cal {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .qc-day {
  background: #141414;
  border-color: #3a3a3a;
  color: #e6e6e6;
}
html[data-theme="dark"] .qc-day.out {
  background: #10141a;
  color: #7a7a7a;
}
html[data-theme="dark"] .qc-day.today {
  background: #1a1a1a;
  box-shadow: inset 0 0 0 2px #c41e3a;
}
html[data-theme="dark"] .qc-day.in-horizon:not(.out) {
  background: #162820;
}
html[data-theme="dark"] .qc-chip {
  background: #2a2a2a;
  border-color: #454545;
  color: #e6e6e6;
}
html[data-theme="dark"] .qc-chip.qc-st-draft {
  background: #2a2a2a;
  border-color: #555;
}
html[data-theme="dark"] .qc-chip.qc-st-lost {
  background: #3a2020;
  border-color: #a05050;
}
html[data-theme="dark"] .qc-chip.qc-st-expired {
  background: #3a3020;
  border-color: #a08040;
}
html[data-theme="dark"] .qc-badge {
  background: #2a2a2a;
  border-color: #454545;
  color: #d0d0d0;
}
html[data-theme="dark"] .qc-badge.urgent {
  background: #3a1a22;
  border-color: #a05050;
  color: #ff8a9a;
}
html[data-theme="dark"] .qc-badge.soon {
  background: #3a3020;
  border-color: #a08040;
  color: #e0c36a;
}
html[data-theme="dark"] .qc-badge.past {
  background: #3a3020;
  border-color: #a08040;
  color: #d0a060;
}

/* ==========================================================================
   Assignments calendar
   ========================================================================== */
html[data-theme="dark"] .asg-toolbar {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .asg-toolbar label { color: #d0d0d0; }
html[data-theme="dark"] .asg-toolbar select,
html[data-theme="dark"] .asg-toolbar input[type="month"],
html[data-theme="dark"] .asg-toolbar input[type="date"] {
  background: #141414;
  color: #e6e6e6;
  border-color: #454545;
}
html[data-theme="dark"] .asg-view-tabs a {
  background: #1a1a1a;
  border-color: #454545;
  color: #d0d0d0;
}
html[data-theme="dark"] .asg-view-tabs a.active,
html[data-theme="dark"] .asg-nav-btn:hover {
  background: #c41e3a;
  border-color: #c41e3a;
  color: #fff;
}
html[data-theme="dark"] .asg-period-label { color: #eeeeee; }
html[data-theme="dark"] .asg-legend {
  color: #c5c5c5;
  border-color: #444444;
}
html[data-theme="dark"] .asg-month,
html[data-theme="dark"] .asg-week-wrap,
html[data-theme="dark"] .asg-resource-week,
html[data-theme="dark"] .asg-list-wrap,
html[data-theme="dark"] .asg-form-panel {
  background: #141414;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .asg-month-head,
html[data-theme="dark"] .asg-emp-col,
html[data-theme="dark"] .asg-daynum-cell {
  background: #1a1a1a;
  color: #e0e0e0;
  border-color: #3a3a3a;
}
html[data-theme="dark"] .asg-day,
html[data-theme="dark"] .asg-cell,
html[data-theme="dark"] .asg-lane {
  background: #121212;
  border-color: #2e2e2e;
  color: #e6e6e6;
}
html[data-theme="dark"] .asg-day.out,
html[data-theme="dark"] .asg-day.muted {
  background: #0e1218;
  color: #6a6a6a;
}
html[data-theme="dark"] .asg-day.today,
html[data-theme="dark"] .asg-cell.today {
  background: #1a1a1a;
  box-shadow: inset 0 0 0 2px #c41e3a;
}
html[data-theme="dark"] .asg-day-add { color: #e098a0; }
html[data-theme="dark"] .asg-lane-empty,
html[data-theme="dark"] .asg-week-empty { color: #7a7a7a; }
html[data-theme="dark"] .asg-pto-pending-banner {
  background: #2a2038;
  border-color: #6b3fa0;
  color: #e0d0f0;
}
html[data-theme="dark"] .asg-month-week,
html[data-theme="dark"] .asg-month-daynums,
html[data-theme="dark"] .asg-month-lanes {
  border-color: #3a3a3a;
}
html[data-theme="dark"] .asg-week th,
html[data-theme="dark"] .asg-week td {
  border-color: #333840;
}
html[data-theme="dark"] .asg-week td {
  background: #121212;
  color: #e6e6e6;
}
html[data-theme="dark"] .asg-week td.today-col {
  background: #1a1518;
}
html[data-theme="dark"] .asg-form-panel.highlight {
  background: #1a222c;
  border-color: #4a6a90;
}
html[data-theme="dark"] .asg-status-banner {
  background: #1a2820;
  border-color: #3a6a48;
  color: #d8ece0;
}
html[data-theme="dark"] .asg-list-toolbar {
  background: #1a1a1a;
  border-color: #444444;
}
html[data-theme="dark"] .asg-modal-panel {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .asg-modal-panel input,
html[data-theme="dark"] .asg-modal-panel select,
html[data-theme="dark"] .asg-modal-panel textarea {
  background: #141414;
  color: #e6e6e6;
  border-color: #454545;
}

/* ==========================================================================
   Server status (cards + history graph)
   ========================================================================== */
html[data-theme="dark"] .ss-wrap {
  color: #e6e6e6;
}
html[data-theme="dark"] .ss-meta {
  color: #9a9a9a !important;
}
html[data-theme="dark"] .ss-meta strong {
  color: #e6e6e6 !important;
}

html[data-theme="dark"] .ss-card,
html[data-theme="dark"] .ss-roadmap,
html[data-theme="dark"] .ss-chart-panel {
  background: #1a1a1a !important;
  border-color: #444444 !important;
  color: #e6e6e6;
}

html[data-theme="dark"] .ss-chart-toolbar label {
  color: #d0d0d0 !important;
}
html[data-theme="dark"] .ss-chart-toolbar select {
  background: #141414;
  color: #e6e6e6;
  border: 1px solid #454545;
  border-radius: 6px;
}
html[data-theme="dark"] .ss-chart-head h3 {
  color: #eeeeee;
}
html[data-theme="dark"] .ss-chart-meta,
html[data-theme="dark"] .ss-chart-empty {
  color: #9a9a9a !important;
}

/* SVG chart surface */
html[data-theme="dark"] .ss-chart-bg {
  fill: #141414 !important;
}
html[data-theme="dark"] .ss-grid-line {
  stroke: #3a3a3a !important;
}
html[data-theme="dark"] .ss-axis-label {
  fill: #9a9a9a !important;
}
html[data-theme="dark"] .ss-chart-dot {
  stroke: #1a1a1a !important;
}
html[data-theme="dark"] .ss-chart-area {
  opacity: 0.18;
}

html[data-theme="dark"] .ss-card h3 {
  color: #e8a8b0;
  border-bottom-color: #3a3a3a;
}
html[data-theme="dark"] .ss-card dt {
  color: #9a9a9a !important;
}
html[data-theme="dark"] .ss-card dd {
  color: #e6e6e6 !important;
}

html[data-theme="dark"] .ss-bar {
  background: #2e2e2e !important;
}
html[data-theme="dark"] .ss-bar-fill {
  background: #3cb371;
}
html[data-theme="dark"] .ss-bar-fill.ss-level-warn { background: #d4a017; }
html[data-theme="dark"] .ss-bar-fill.ss-level-crit { background: #e05555; }
html[data-theme="dark"] .ss-bar-fill.ss-level-unknown { background: #7a7a7a; }

html[data-theme="dark"] .ss-pill {
  background: #2a2a2a;
  border-color: #454545;
  color: #d0d0d0;
}
html[data-theme="dark"] .ss-pill.ss-level-ok {
  background: #1a3a28;
  border-color: #2a6a40;
  color: #8fdf9f;
}
html[data-theme="dark"] .ss-pill.ss-level-warn {
  background: #3a3420;
  border-color: #6a5a20;
  color: #e0c36a;
}
html[data-theme="dark"] .ss-pill.ss-level-crit {
  background: #3a1a22;
  border-color: #a05050;
  color: #ff8a9a;
}

html[data-theme="dark"] .ss-table th,
html[data-theme="dark"] .ss-table td {
  border-color: #3a3a3a;
}
html[data-theme="dark"] .ss-table th {
  background: #2a2a2a !important;
  color: #e0e0e0;
}
html[data-theme="dark"] .ss-table td {
  background: #161c26;
  color: #e6e6e6;
}
html[data-theme="dark"] tr.ss-session-you td {
  background: #1a1a1a !important;
}

html[data-theme="dark"] .ss-ok { color: #8fdf9f !important; }
html[data-theme="dark"] .ss-bad { color: #ff8a9a !important; }
html[data-theme="dark"] .ss-mono { color: #c5c5c5; }

html[data-theme="dark"] .ss-roadmap-source,
html[data-theme="dark"] .ss-note {
  color: #9a9a9a !important;
  background: #141414 !important;
  border-color: #3a3a3a !important;
}
html[data-theme="dark"] .ss-roadmap-body { color: #d0d0d0 !important; }
html[data-theme="dark"] .ss-roadmap-body .ss-roadmap-h {
  color: #e8a8b0 !important;
  border-bottom-color: #3a3a3a !important;
}
html[data-theme="dark"] .ss-roadmap-hr { border-top-color: #3a3a3a; }
html[data-theme="dark"] .ss-roadmap-body code {
  background: #2a2a2a !important;
  color: #f0d8dc;
}
html[data-theme="dark"] .ss-task-done { color: #8a8a8a !important; }
html[data-theme="dark"] .ss-task-open { color: #e6e6e6 !important; }
html[data-theme="dark"] .ss-level-ok { color: #8fdf9f; }
html[data-theme="dark"] .ss-level-warn { color: #e0c36a; }
html[data-theme="dark"] .ss-level-crit { color: #ff8a9a; }

/* ==========================================================================
   Expense report on-screen (print stays light)
   expense-report.css hard-codes #000 / light table fills on .er-doc, meta
   facts table, headings — use !important so dark theme wins on screen.
   ========================================================================== */
html[data-theme="dark"] .er-paper,
html[data-theme="dark"] .er-section,
html[data-theme="dark"] .er-header,
html[data-theme="dark"] .er-transfer-card,
html[data-theme="dark"] .er-sig-panel,
html[data-theme="dark"] .er-sign-slot {
  background: #1a1a1a !important;
  border-color: #444444 !important;
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .er-doc,
html[data-theme="dark"] .er-meta,
html[data-theme="dark"] .er-header h1,
html[data-theme="dark"] .er-header h2,
html[data-theme="dark"] .er-section h3,
html[data-theme="dark"] .er-section h4,
html[data-theme="dark"] .er-transfer-card h4,
html[data-theme="dark"] .er-paper p,
html[data-theme="dark"] .er-paper li,
html[data-theme="dark"] .er-paper td,
html[data-theme="dark"] .er-paper th,
html[data-theme="dark"] .er-table td,
html[data-theme="dark"] .er-table th,
html[data-theme="dark"] .er-sign-meta,
html[data-theme="dark"] .er-sign-title {
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .er-company-line,
html[data-theme="dark"] .er-rates,
html[data-theme="dark"] .er-meta-sep {
  color: #b0b0b0 !important;
}
html[data-theme="dark"] .er-section h3 {
  border-bottom-color: #6a6a6a !important;
}
html[data-theme="dark"] .er-note,
html[data-theme="dark"] .er-muted,
html[data-theme="dark"] .er-empty,
html[data-theme="dark"] .er-empty-cell {
  color: #b0b0b0 !important;
}

/* Facts block (report #, tech, customer, project, site) — was white/#f2 fills + #000
   text; dark theme set light ink only → unreadable customer row (#92). */
html[data-theme="dark"] .er-meta-table {
  background: #141414 !important;
  border-color: #555555 !important;
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .er-meta-table th,
html[data-theme="dark"] .er-meta-table td {
  background: #1a1a1a !important;
  border-color: #444444 !important;
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .er-meta-table th {
  background: #222222 !important;
  color: #c5c5c5 !important;
}
html[data-theme="dark"] .er-meta-table .er-meta-emph,
html[data-theme="dark"] .er-meta-table .er-meta-rid {
  color: #eeeeee !important;
}

/* Data tables inside the paper */
html[data-theme="dark"] .er-table th {
  background: #222222 !important;
  border-color: #444444 !important;
}
html[data-theme="dark"] .er-table td {
  border-color: #444444 !important;
}
html[data-theme="dark"] .er-table tbody tr.er-day-break td {
  border-top-color: #eeeeee !important;
}
html[data-theme="dark"] .er-table tfoot td,
html[data-theme="dark"] .er-total-row td {
  background: #222222 !important;
}

html[data-theme="dark"] .er-toolbar {
  background: #141414;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .er-toolbar label {
  color: #e6e6e6;
}
html[data-theme="dark"] .er-warn {
  background: #3a3420;
  border-color: #6a5a20;
  color: #e0c36a;
}

/* Empty ER cleanup + payroll handoff + Mode gate (screen chrome) */
html[data-theme="dark"] .er-package-admin,
html[data-theme="dark"] .er-payroll-handoff {
  background: #1a1a1a !important;
  border-color: #444444 !important;
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .er-payroll-handoff {
  border-left-color: #c41e3a !important;
}
html[data-theme="dark"] .er-package-admin-title {
  color: #eeeeee !important;
}
html[data-theme="dark"] .er-package-admin-body,
html[data-theme="dark"] .er-package-admin-body strong {
  color: #c5c5c5 !important;
}
html[data-theme="dark"] .er-package-admin-body strong {
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .er-package-admin-btn {
  background: #222222 !important;
  border-color: #555555 !important;
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .er-sign-gate {
  background: #222222 !important;
  border-color: #444444 !important;
  border-left-color: #c41e3a !important;
  color: #c5c5c5 !important;
}
html[data-theme="dark"] .er-sign-gate-line {
  color: #c5c5c5 !important;
}
html[data-theme="dark"] .er-sign-gate strong {
  color: #eeeeee !important;
}

/* Digital signatures capture shell (screen-only; hidden when printing) */
html[data-theme="dark"] .er-sign-capture {
  background: #1a1a1a !important;
  border-color: #444444 !important;
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .er-sign-capture h3,
html[data-theme="dark"] .er-sig-panel h4 {
  color: #eeeeee !important;
  border-bottom-color: #444444;
}
html[data-theme="dark"] .er-sig-panel {
  background: #141414 !important;
  border-color: #444444 !important;
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .er-sig-label {
  color: #9a9a9a;
}
html[data-theme="dark"] .er-sig-autofill,
html[data-theme="dark"] .er-sig-autofill-name,
html[data-theme="dark"] .er-sig-autofill-time {
  color: #e6e6e6;
}
html[data-theme="dark"] .er-sig-actions button {
  background: #222222;
  border-color: #454545;
  color: #e6e6e6;
}
html[data-theme="dark"] .er-sig-actions button.primary {
  background: #c41e3a;
  border-color: #c41e3a;
  color: #fff;
}
html[data-theme="dark"] .er-actions button,
html[data-theme="dark"] .er-actions a.btn {
  background: #222222;
  border-color: #454545;
  color: #e6e6e6;
}
html[data-theme="dark"] .er-actions button.primary {
  background: #c41e3a;
  border-color: #c41e3a;
  color: #fff;
}
html[data-theme="dark"] .er-sig-status {
  color: #8fdf9f;
}
html[data-theme="dark"] .er-sig-status-err {
  color: #ff8a9a;
}
/* Drawing pads stay white so pen strokes remain visible */
html[data-theme="dark"] .er-sign-canvas,
html[data-theme="dark"] .er-sig-canvas,
html[data-theme="dark"] .er-sig-existing,
html[data-theme="dark"] .er-sign-img-wrap {
  background: #fff;
  border-color: #454545;
}
html[data-theme="dark"] .er-sign-line {
  background: #141414;
  border-color: #555555;
}
html[data-theme="dark"] .er-sign-title,
html[data-theme="dark"] .er-sign-meta {
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .er-table th {
  background: #2a2a2a !important;
  color: #e0e0e0 !important;
  border-color: #444444 !important;
}
html[data-theme="dark"] .er-table td {
  border-color: #444444 !important;
  color: #e6e6e6 !important;
  background: transparent;
}
html[data-theme="dark"] .er-table tfoot td,
html[data-theme="dark"] .er-total-row td {
  background: #222222 !important;
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .er-transfer-card {
  background: #141414 !important;
  border-color: #444444 !important;
  color: #e6e6e6 !important;
}
/* Screen paper + receipts: avoid leftover light-only bands / black-on-black */
html[data-theme="dark"] .er-paper {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  border-color: #444444 !important;
}
html[data-theme="dark"] .er-receipt-page {
  border-color: #555555 !important;
  background: #141414 !important;
}
html[data-theme="dark"] .er-receipt-page + .er-receipt-page {
  border-top-color: #c41e3a !important;
  box-shadow: 0 -12px 0 0 #2a2a2a;
}
html[data-theme="dark"] .er-receipt-head {
  background: #1a1a1a !important;
  border-bottom-color: #555555 !important;
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .er-receipt-page-label {
  color: #b0b0b0 !important;
}
html[data-theme="dark"] .er-receipt-pdf {
  background: #1a1a1a !important;
  border-color: #444444 !important;
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .er-muted,
html[data-theme="dark"] .er-sig-panel .er-muted {
  color: #9a9a9a !important;
}
html[data-theme="dark"] .er-sign-capture .hint,
html[data-theme="dark"] .er-sign-capture .error {
  color: #c5c5c5 !important;
}
html[data-theme="dark"] .er-sign-capture .error {
  color: #ff8a9a !important;
}

/* ==========================================================================
   Service report page (screen). Print media keeps paper white for PDF/print.
   ========================================================================== */
html[data-theme="dark"] .sr-toolbar,
html[data-theme="dark"] .sr-complete-panel,
html[data-theme="dark"] .sr-sign-capture,
html[data-theme="dark"] .sr-machine-once {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}

html[data-theme="dark"] .sr-actions button,
html[data-theme="dark"] .sr-actions a.btn,
html[data-theme="dark"] .sr-complete-banner a.btn,
html[data-theme="dark"] .sr-sig-actions button {
  background: #222222;
  border-color: #454545;
  color: #e6e6e6;
}

html[data-theme="dark"] .sr-actions button.primary,
html[data-theme="dark"] .sr-actions a.btn.primary,
html[data-theme="dark"] .sr-complete-card button.primary,
html[data-theme="dark"] .sr-complete-banner a.btn.primary,
html[data-theme="dark"] a.btn.primary,
html[data-theme="dark"] .sr-sig-actions button.primary,
html[data-theme="dark"] .sr-email-form button.primary {
  background: #c41e3a;
  border-color: #c41e3a;
  color: #fff;
}

html[data-theme="dark"] .sr-complete-banner button.btn.danger {
  background: #3a2020;
  border-color: #a44;
  color: #ffb0b0;
}

/* On-screen draft "paper" — dark surface (print CSS forces white) */
html[data-theme="dark"] .sr-paper {
  background: #161c26;
  border-color: #444444;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  color: #e6e6e6;
}

html[data-theme="dark"] .sr-doc h1,
html[data-theme="dark"] .sr-doc h3,
html[data-theme="dark"] .sr-subhead,
html[data-theme="dark"] .sr-machine-heading {
  color: #eeeeee;
  border-bottom-color: #444444;
}

html[data-theme="dark"] .sr-doc h2,
html[data-theme="dark"] .sr-complete-card h4 {
  color: #e8a8b0;
}

html[data-theme="dark"] .sr-meta,
html[data-theme="dark"] .sr-service-meta,
html[data-theme="dark"] .sr-sign-meta {
  color: #c5c5c5;
}

html[data-theme="dark"] .sr-empty,
html[data-theme="dark"] .sr-note,
html[data-theme="dark"] .sr-muted,
html[data-theme="dark"] .sr-daily-summary td.sr-detail,
html[data-theme="dark"] .sr-expense-detail td.sr-detail {
  color: #9a9a9a;
}

html[data-theme="dark"] .sr-service-item {
  border-bottom-color: #3a3a3a;
}

html[data-theme="dark"] .sr-service-body,
html[data-theme="dark"] .sr-scope {
  color: #e6e6e6;
}

html[data-theme="dark"] .sr-customer-blurb {
  background: #1a1a1a;
  border-left-color: #c41e3a;
  color: #d0d0d0;
}

html[data-theme="dark"] .sr-sign-slot,
html[data-theme="dark"] .sr-sig-panel,
html[data-theme="dark"] .sr-complete-card {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}

html[data-theme="dark"] .sr-sign-line {
  background: #141414;
  border-color: #555555;
}

/* Signature images/canvas: keep white pad for pen contrast */
html[data-theme="dark"] .sr-sign-img-wrap,
html[data-theme="dark"] .sr-sig-canvas,
html[data-theme="dark"] .sr-sig-existing {
  background: #fff;
  border-color: #454545;
}

html[data-theme="dark"] .sr-sig-label {
  color: #9a9a9a;
}

html[data-theme="dark"] .sr-sig-print-name,
html[data-theme="dark"] .sr-sig-print-title,
html[data-theme="dark"] .sr-sig-print-reason {
  background: #141414;
  color: #e6e6e6;
  border-color: #454545;
}
html[data-theme="dark"] .sr-sign-title-line {
  color: #a8a8a8;
}
html[data-theme="dark"] .sr-sign-reason {
  color: #d0c090;
}

html[data-theme="dark"] .sr-sig-status {
  color: #8fdf9f;
}

html[data-theme="dark"] .sr-sig-status-err {
  color: #ff8a9a;
}

html[data-theme="dark"] .sr-complete-banner {
  background: #162820;
  border-color: #2a6a40;
  color: #c5e8c5;
}

html[data-theme="dark"] .sr-upload-label {
  color: #d0d0d0;
}

html[data-theme="dark"] .sr-upload-label input[type="file"],
html[data-theme="dark"] .sr-upload-label input[type="text"],
html[data-theme="dark"] .sr-upload-label input[type="email"] {
  background: #141414;
  color: #e6e6e6;
  border-color: #454545;
}

/* Service report photo attach / picker (was light cards + inherited light text) */
html[data-theme="dark"] .sr-photo-attach-card {
  background: #141414;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .sr-photo-attach-card img,
html[data-theme="dark"] .sr-photo-thumb-btn img {
  background: #1a1a1a;
}
html[data-theme="dark"] .sr-photo-attach-meta,
html[data-theme="dark"] .sr-photo-attach-cap {
  color: #d0d0d0;
}
html[data-theme="dark"] .sr-photo-attach-cat {
  color: #e8a8b0;
}
html[data-theme="dark"] .sr-photo-thumb-btn:focus {
  outline-color: #c41e3a;
}
html[data-theme="dark"] .sr-photo-cat-title,
html[data-theme="dark"] .sr-report-photo-cat {
  color: #e8a8b0;
}
html[data-theme="dark"] .sr-photo-cat-title .hint,
html[data-theme="dark"] .sr-photo-on-section .hint {
  color: #9a9a9a;
}
html[data-theme="dark"] .sr-photo-on-section + .sr-photo-on-section,
html[data-theme="dark"] .sr-photo-cat-section {
  border-top-color: #3a3a3a;
}
html[data-theme="dark"] .sr-photo-cat-chip {
  background: #222222;
  border-color: #454545;
  color: #e6e6e6;
}
html[data-theme="dark"] .sr-photo-cat-chip:hover {
  background: #2a2a2a;
}
html[data-theme="dark"] .sr-photo-cat-chip.is-active {
  background: #c41e3a;
  border-color: #c41e3a;
  color: #fff;
}
html[data-theme="dark"] .sr-photo-cat-count {
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
}
html[data-theme="dark"] .sr-photo-cat-chip.is-active .sr-photo-cat-count {
  background: rgba(255, 255, 255, 0.22);
}
html[data-theme="dark"] .sr-photo-cat-add-all .btn,
html[data-theme="dark"] .sr-photo-attach-tools .btn {
  background: #222222;
  border-color: #454545;
  color: #e6e6e6;
}
html[data-theme="dark"] .sr-photo-attach-actions .btn-void {
  color: #ffb0b0;
  border-color: #6a3a3a;
  background: #2a1a1a;
}
html[data-theme="dark"] .sr-photo-picker summary {
  color: #e6e6e6;
}
html[data-theme="dark"] .sr-report-photo-cap {
  color: #c5c5c5;
}
html[data-theme="dark"] .sr-paper .sr-report-photo-cat {
  border-bottom-color: #444444;
  color: #e8a8b0;
}

html[data-theme="dark"] .sr-table th,
html[data-theme="dark"] .sr-daily-summary th {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: #454545;
}

html[data-theme="dark"] .sr-table td,
html[data-theme="dark"] .sr-daily-summary td {
  background: #161c26;
  color: #e6e6e6;
  border-color: #3a3a3a;
}

html[data-theme="dark"] .sr-table tfoot td {
  background: #222222;
  color: #eeeeee;
}

/* Template editor token chips */
html[data-theme="dark"] .tpl-insert-bar button {
  background: #1a2e24;
  border-color: #3a6a4a;
  color: #c5e8c5;
}
html[data-theme="dark"] .tpl-insert-bar button.block {
  background: #1e1e1e;
  border-color: #555555;
  color: #d0d0d0;
}
html[data-theme="dark"] .tpl-insert-bar .group-label,
html[data-theme="dark"] .tpl-hint {
  color: #9a9a9a;
}

/* Service reports list */
html[data-theme="dark"] .srl-toolbar {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .srl-toolbar label { color: #d0d0d0; }
html[data-theme="dark"] .srl-toolbar input,
html[data-theme="dark"] .srl-toolbar select {
  background: #141414;
  color: #e6e6e6;
  border-color: #454545;
}
html[data-theme="dark"] .srl-count,
html[data-theme="dark"] .srl-empty { color: #9a9a9a; }
html[data-theme="dark"] .srl-badge-done {
  background: #1a3a28;
  color: #8fdf9f;
}
html[data-theme="dark"] .srl-badge-draft {
  background: #2a2a2a;
  color: #c5c5c5;
}

/* Service report archive viewer banner */
html[data-theme="dark"] .sr-archive-banner {
  background: #162820;
  border-color: #2a6a40;
  color: #c5e8c5;
}

/* ==========================================================================
   Theme picker + settings panels (layout in fcms.css; colors here for dark)
   ========================================================================== */
/* Today job to-do scratch pad */
html[data-theme="dark"] .td-todo-warn {
  background: #3a2228;
  border-color: #6a3040;
  color: #e6e6e6;
}
html[data-theme="dark"] .td-todo-item {
  border-bottom-color: #444;
}
html[data-theme="dark"] .td-todo-check {
  background: #1a1a1a;
  border-color: #555;
  color: #e8a0a8;
}
html[data-theme="dark"] .td-todo-item.is-done .td-todo-check {
  background: #c41e3a;
  border-color: #c41e3a;
  color: #fff;
}
html[data-theme="dark"] .td-todo-body {
  color: #e0e0e0;
}
html[data-theme="dark"] .td-todo-item.is-done .td-todo-body {
  color: #9a9a9a;
}
html[data-theme="dark"] .td-todo-add input[type="text"] {
  background: #1a1a1a;
  border-color: #555;
  color: #e6e6e6;
}
html[data-theme="dark"] .td-todo-add .btn {
  background: #2a2a2a;
  border-color: #555;
  color: #e6e6e6;
}
html[data-theme="dark"] .td-ex-item {
  border-top-color: #444;
}
html[data-theme="dark"] .td-ex-amt {
  color: #eeeeee;
}
html[data-theme="dark"] .ex-receipt-btn-secondary {
  background: #222;
  color: #e6e6e6;
  border-color: #555;
}
html[data-theme="dark"] .ex-receipt-btn-secondary:hover {
  background: #303030;
  color: #fff;
}

html[data-theme="dark"] .settings-panel {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .settings-panel h3 {
  color: #eeeeee;
}
html[data-theme="dark"] .theme-choice-card {
  background: #141414;
  border-color: #454545;
}
html[data-theme="dark"] .theme-choice-card .theme-choice-title { color: #e6e6e6; }
html[data-theme="dark"] .theme-choice-card .theme-choice-hint { color: #9a9a9a; }
html[data-theme="dark"] .theme-choice input:checked + .theme-choice-card {
  background: #3a2228;
  border-color: #c41e3a;
  box-shadow: 0 0 0 1px #c41e3a;
}

/* Idle modal */
html[data-theme="dark"] .fcms-idle-dialog {
  background: #1a1a1a;
  border-color: #454545;
  color: #e6e6e6;
}
html[data-theme="dark"] .fcms-idle-dialog h3 { color: #e8a8b0; }

/* Login */
html[data-theme="dark"] body.page-login,
html[data-theme="dark"] body.page-narrow {
  background: #121212;
}
html[data-theme="dark"] .login-recovery {
  border-top-color: #444444;
}

/* ==========================================================================
   Print: force black-on-white for all document papers (any theme)
   ========================================================================== */
@media print {
  html[data-theme="dark"] body,
  body {
    color: #000 !important;
    background: #fff !important;
  }

  /* Document surfaces */
  .week-card,
  .er-paper,
  .sr-paper,
  .qp-paper,
  .pm-paper,
  html[data-theme="dark"] .week-card,
  html[data-theme="dark"] .er-paper,
  html[data-theme="dark"] .sr-paper,
  html[data-theme="dark"] .qp-paper,
  html[data-theme="dark"] .pm-paper {
    background: #fff !important;
    color: #000 !important;
    border-color: #ccc !important;
    box-shadow: none !important;
  }

  /* Headings + body copy inside papers (dark theme uses light h1–h3 globally) */
  .er-paper h1, .er-paper h2, .er-paper h3, .er-paper h4,
  .sr-paper h1, .sr-paper h2, .sr-paper h3, .sr-paper h4,
  .qp-paper h1, .qp-paper h2, .qp-paper h3, .qp-paper h4,
  .pm-paper h1, .pm-paper h2, .pm-paper h3, .pm-paper h4,
  .sr-doc, .sr-doc h1, .sr-doc h2, .sr-doc h3, .sr-doc h4,
  .sr-meta, .sr-empty, .sr-note, .sr-muted, .sr-subhead,
  .sr-machine-heading, .sr-service-meta, .sr-sign-meta, .sr-scope, .sr-service-body,
  .er-doc, .er-meta, .er-note, .er-muted, .er-empty, .er-empty-cell, .er-sign-meta,
  .er-table td, .er-table th, .sr-table td, .sr-table th,
  .qp-paper p, .qp-paper td, .qp-paper th,
  .pm-meta, .pm-stats, .pm-assign, .pm-empty, .pm-role,
  html[data-theme="dark"] .er-paper h1,
  html[data-theme="dark"] .er-paper h2,
  html[data-theme="dark"] .er-paper h3,
  html[data-theme="dark"] .er-paper h4,
  html[data-theme="dark"] .sr-paper h1,
  html[data-theme="dark"] .sr-paper h2,
  html[data-theme="dark"] .sr-paper h3,
  html[data-theme="dark"] .sr-paper h4,
  html[data-theme="dark"] .sr-doc,
  html[data-theme="dark"] .sr-doc h1,
  html[data-theme="dark"] .sr-doc h2,
  html[data-theme="dark"] .sr-doc h3,
  html[data-theme="dark"] .sr-meta,
  html[data-theme="dark"] .sr-table td,
  html[data-theme="dark"] .sr-table th,
  html[data-theme="dark"] .qp-paper h1,
  html[data-theme="dark"] .qp-paper h2,
  html[data-theme="dark"] .qp-paper h3,
  html[data-theme="dark"] .qp-paper h4,
  html[data-theme="dark"] .qp-paper p,
  html[data-theme="dark"] .qp-paper td,
  html[data-theme="dark"] .qp-paper th,
  html[data-theme="dark"] .pm-paper h1,
  html[data-theme="dark"] .pm-paper h2,
  html[data-theme="dark"] .pm-paper h3,
  html[data-theme="dark"] .pm-paper h4,
  html[data-theme="dark"] table.data td,
  html[data-theme="dark"] table.data th {
    background: #fff !important;
    color: #000 !important;
    border-color: #ccc !important;
    box-shadow: none !important;
  }

  /* Allow light tinted table headers without washing text */
  .er-table th,
  .sr-table th,
  html[data-theme="dark"] .er-table th,
  html[data-theme="dark"] .sr-table th {
    background: #e8eef6 !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Signature slots stay light on PDF (dark theme paints them dark on screen) */
  .sr-sign-slot,
  .sr-sign-line,
  .sr-sign-img-wrap,
  .sr-sign-title,
  .sr-sign-meta,
  .er-sign-slot,
  .er-sign-line,
  .er-sign-img-wrap,
  .er-sign-title,
  .er-sign-meta,
  .er-section,
  .er-header,
  .er-transfer-card,
  html[data-theme="dark"] .sr-sign-slot,
  html[data-theme="dark"] .sr-sign-line,
  html[data-theme="dark"] .sr-sign-img-wrap,
  html[data-theme="dark"] .sr-sign-meta,
  html[data-theme="dark"] .er-sign-slot,
  html[data-theme="dark"] .er-sign-line,
  html[data-theme="dark"] .er-sign-img-wrap,
  html[data-theme="dark"] .er-sign-meta,
  html[data-theme="dark"] .er-section,
  html[data-theme="dark"] .er-header,
  html[data-theme="dark"] .er-transfer-card,
  html[data-theme="dark"] .er-sig-panel {
    background: #fff !important;
    color: #000 !important;
    border-color: #999 !important;
    box-shadow: none !important;
  }

  .sr-sign-line,
  .er-sign-line,
  html[data-theme="dark"] .sr-sign-line,
  html[data-theme="dark"] .er-sign-line {
    background: #fafafa !important;
    border: 1px dashed #666 !important;
  }

  .sr-sign-img-wrap,
  .er-sign-img-wrap,
  html[data-theme="dark"] .sr-sign-img-wrap,
  html[data-theme="dark"] .er-sign-img-wrap {
    background: #fff !important;
  }
}

/* In-app entry modal */
html[data-theme="dark"] .fcms-entry-modal-backdrop {
  background: rgba(0, 0, 0, 0.72);
}
html[data-theme="dark"] .fcms-entry-modal-panel {
  background: #151c26;
  border-color: #454545;
  color: #e6e6e6;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] .fcms-entry-modal-header {
  background: #1a2330;
  border-bottom-color: #454545;
}
html[data-theme="dark"] .fcms-entry-modal-header h3 {
  color: #e8a8b0;
}
html[data-theme="dark"] .fcms-entry-modal-close {
  color: #9a9a9a;
}
html[data-theme="dark"] .fcms-entry-modal-close:hover {
  color: #e8eef5;
}
html[data-theme="dark"] .fcms-entry-modal-frame {
  background: #121212;
}

/* In-app coach */
html[data-theme="dark"] .fcms-coach-scrim {
  background: rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] .fcms-coach-bubble {
  background: #1a1a1a;
  border-color: #a04050;
  color: #e6e6e6;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] .fcms-coach-title {
  color: #e8a8b0;
}
html[data-theme="dark"] .fcms-coach-body {
  color: #c5c5c5;
}
html[data-theme="dark"] .fcms-coach-body strong {
  color: #e6e6e6;
}
html[data-theme="dark"] .fcms-coach-arrow-shaft {
  background: #e8a020;
}
html[data-theme="dark"] .fcms-coach-arrow-head {
  border-left-color: #e8a020;
}

/* What’s New modal */
html[data-theme="dark"] .fcms-whats-new-scrim {
  background: rgba(0, 0, 0, 0.6);
}
html[data-theme="dark"] .fcms-whats-new-panel {
  background: #1a1a1a;
  border-color: #a04050;
  color: #e6e6e6;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}
html[data-theme="dark"] .fcms-whats-new-title {
  color: #e8a8b0;
}
html[data-theme="dark"] .fcms-whats-new-card {
  background: #151c26;
  border-color: #454545;
}
html[data-theme="dark"] .fcms-whats-new-card-title {
  color: #e8c8cc;
}
html[data-theme="dark"] .fcms-whats-new-card-body {
  color: #c5c5c5;
}
html[data-theme="dark"] .fcms-whats-new-card-body strong {
  color: #e6e6e6;
}

/* Expense report pre-sign validation modal */
html[data-theme="dark"] .er-validate-panel {
  background: #1a1a1a !important;
  color: #e6e6e6 !important;
  border-color: #555555 !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] .er-validate-panel h3 {
  color: #e8a8b0 !important;
}
html[data-theme="dark"] .er-validate-lead,
html[data-theme="dark"] .er-validate-foot,
html[data-theme="dark"] .er-validate-msg {
  color: #c5c5c5 !important;
}
html[data-theme="dark"] .er-validate-item {
  background: #2a2410 !important;
  border-color: #8a7020 !important;
  border-left-color: #d4a017 !important;
}
html[data-theme="dark"] .er-validate-actions button {
  background: #2a2a2a !important;
  border-color: #555555 !important;
  color: #e8eef5 !important;
}
html[data-theme="dark"] .er-validate-actions button.primary {
  background: #c41e3a !important;
  border-color: #c41e3a !important;
  color: #fff !important;
}
html[data-theme="dark"] .er-validate-fix {
  color: #e098a0 !important;
}

/* Week / workspace task detail modal (shared via project-ui.css) */
html[data-theme="dark"] .week-task-detail-card {
  background: #1a1a1a !important;
  border-color: #4a4a4a !important;
  color: #e6e6e6;
}
html[data-theme="dark"] .week-task-detail-close {
  color: #9a9a9a;
}
html[data-theme="dark"] .week-task-detail-meta {
  color: #b0b0b0;
}
html[data-theme="dark"] .week-task-detail-meta strong {
  color: #eeeeee;
}
html[data-theme="dark"] .week-task-detail-result {
  background: #141414 !important;
  border-color: #4a4a4a !important;
}
html[data-theme="dark"] .week-task-detail-actions {
  border-top-color: #3a3a3a;
}
html[data-theme="dark"] .week-task-detail-edit input[type="text"] {
  background: #141414;
  color: #e6e6e6;
  border-color: #4a4a4a;
}
html[data-theme="dark"] .week-task-detail-card h3 {
  color: #e8a8b0;
}

/* ==========================================================================
   Maintenance page (Admin / Developer)
   ========================================================================== */
html[data-theme="dark"] .mt-card {
  background: #1a1a1a;
  border-color: #454545;
}
html[data-theme="dark"] .mt-card .lbl {
  color: #9a9a9a;
}
html[data-theme="dark"] .mt-card .val {
  color: #eeeeee;
}
html[data-theme="dark"] .mt-card.warn {
  background: #2a2410;
  border-color: #8a7020;
}
html[data-theme="dark"] .mt-card.ok {
  background: #1a2e22;
  border-color: #2a5a3a;
}
html[data-theme="dark"] .mt-card.bad {
  background: #3a1a22;
  border-color: #6a3040;
}
html[data-theme="dark"] .mt-section {
  border-top-color: #3a3a3a;
}
html[data-theme="dark"] .mt-section h3 {
  color: #e8a8b0;
}
html[data-theme="dark"] .mt-section h4 {
  color: #c5c5c5;
}
html[data-theme="dark"] .mt-note {
  color: #9a9a9a;
}
html[data-theme="dark"] .mt-toc a {
  color: #e098a0;
}
html[data-theme="dark"] table.mt-table th,
html[data-theme="dark"] table.mt-table td {
  border-color: #3a3a3a;
  color: #e6e6e6;
}
html[data-theme="dark"] table.mt-table th {
  background: #222222;
  color: #c5c5c5;
}
html[data-theme="dark"] table.mt-table td {
  background: #141414;
}
html[data-theme="dark"] table.mt-table tr.hi-free td {
  background: #2a2410;
}
html[data-theme="dark"] table.mt-table code,
html[data-theme="dark"] .mt-result code,
html[data-theme="dark"] code.path {
  background: #2a2a2a;
  color: #f0d8dc;
}
html[data-theme="dark"] .mt-pill.ok {
  background: #1a3a28;
  color: #8fdf9f;
}
html[data-theme="dark"] .mt-pill.bad {
  background: #3a1a22;
  color: #ff8a9a;
}
html[data-theme="dark"] .mt-pill.warn {
  background: #2a2410;
  color: #e0c36a;
}
html[data-theme="dark"] .mt-result {
  background: #1a1a1a;
  border-color: #454545;
  color: #d0d0d0;
}
html[data-theme="dark"] .mt-result strong {
  color: #eeeeee;
}
html[data-theme="dark"] .mt-actions label,
html[data-theme="dark"] .mt-check-all {
  color: #d0d0d0;
}
html[data-theme="dark"] .mt-actions input[type="number"] {
  background: #1a1a1a;
  color: #e6e6e6;
  border-color: #454545;
}

/* ==========================================================================
   Today (field landing)
   ========================================================================== */
html[data-theme="dark"] .td-date,
html[data-theme="dark"] .td-section-title {
  color: #e8a8b0;
}
html[data-theme="dark"] .td-sub {
  color: #a8a8a8;
}
html[data-theme="dark"] .td-sub a,
html[data-theme="dark"] .td-links a,
html[data-theme="dark"] .td-gap a,
html[data-theme="dark"] .td-empty a {
  color: #e098a0;
}
html[data-theme="dark"] .td-sub a:hover,
html[data-theme="dark"] .td-links a:hover,
html[data-theme="dark"] .td-gap a:hover {
  color: #ffc8d0;
}
html[data-theme="dark"] .td-links {
  color: #a8a8a8;
}
html[data-theme="dark"] .td-job {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
  box-shadow: none;
}
html[data-theme="dark"] .td-job:hover {
  border-color: #c41e3a;
  background: #1e1e1e;
  color: #eeeeee;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .td-job.is-selected {
  background: #3a2228;
  border-color: #c41e3a;
  box-shadow: 0 0 0 2px rgba(90, 159, 212, 0.35);
  color: #eeeeee;
}
html[data-theme="dark"] .td-job .rid {
  color: #e8a8b0;
}
html[data-theme="dark"] .td-job .pname {
  color: #d0d0d0;
}
html[data-theme="dark"] .td-job .st {
  color: #9a9a9a;
}
html[data-theme="dark"] .td-empty {
  background: #1a1a1a;
  border-color: #444444;
  color: #c5c5c5;
}
html[data-theme="dark"] .td-empty strong {
  color: #eeeeee;
}
html[data-theme="dark"] .td-gap {
  background: #2a2410;
  border-color: #8a7020;
  color: #e8dcc0;
}
html[data-theme="dark"] .td-gap strong {
  color: #f0e0a0;
}
/* Checklist cards on Today (reuse week-card + boost contrast) */
html[data-theme="dark"] .td-check .week-card {
  background: #1a1a1a;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .td-check .week-card:hover {
  border-color: #c41e3a;
  background: #1e1e1e;
  color: #eeeeee;
}
html[data-theme="dark"] .td-check .week-card-done {
  border-left-color: #3cb371;
  background: #162820;
}
html[data-theme="dark"] .td-check .week-card-empty {
  border-left-color: #555555;
  background: #1a1a1a;
}
html[data-theme="dark"] .td-check .week-card-top {
  color: #eeeeee;
}
html[data-theme="dark"] .td-check .week-card-detail {
  color: #b0b0b0;
}
html[data-theme="dark"] .td-check .week-card-go {
  color: #e098a0;
}
/* Quick-action buttons: match global .btn / .btn-primary dark rules */
html[data-theme="dark"] .td-actions .btn,
html[data-theme="dark"] .td-actions a.btn {
  background: #222222;
  color: #e6e6e6;
  border-color: #454545;
}
html[data-theme="dark"] .td-actions .btn:hover,
html[data-theme="dark"] .td-actions a.btn:hover {
  background: #303030;
  color: #fff;
}
html[data-theme="dark"] .td-actions .btn-primary,
html[data-theme="dark"] .td-actions a.btn-primary,
html[data-theme="dark"] .td-actions .btn.primary,
html[data-theme="dark"] .td-actions a.btn.primary {
  background: #c41e3a;
  border-color: #c41e3a;
  color: #fff;
}
html[data-theme="dark"] .td-actions .btn-primary:hover,
html[data-theme="dark"] .td-actions a.btn-primary:hover,
html[data-theme="dark"] .td-actions .btn.primary:hover,
html[data-theme="dark"] .td-actions a.btn.primary:hover {
  background: #a04050;
  color: #fff;
}
/* Job title line under section heading */
html[data-theme="dark"] .td-wrap > .hint {
  color: #a8a8a8;
}
html[data-theme="dark"] .td-block {
  background: #1a1a1a;
  border-color: #444444;
}
html[data-theme="dark"] .td-job-meta {
  color: #a8a8a8;
}
html[data-theme="dark"] .td-inline-label {
  color: #e8a8b0;
}
html[data-theme="dark"] .td-field {
  color: #a8a8a8;
}
html[data-theme="dark"] .td-mini-link {
  color: #e098a0;
}
html[data-theme="dark"] .td-field input[type="number"],
html[data-theme="dark"] .td-field select,
html[data-theme="dark"] .td-field textarea {
  background: #141414;
  color: #e6e6e6;
  border-color: #454545;
}
html[data-theme="dark"] .td-field input:focus,
html[data-theme="dark"] .td-field select:focus,
html[data-theme="dark"] .td-field textarea:focus {
  border-color: #c41e3a;
  outline-color: #c41e3a;
}
html[data-theme="dark"] .td-meal {
  background: #141414;
  border-color: #444444;
  color: #e6e6e6;
}
html[data-theme="dark"] .td-meal:has(input:checked) {
  background: #3a2228;
  border-color: #c41e3a;
}
html[data-theme="dark"] .td-save-bar {
  background: transparent;
  border: none;
  box-shadow: none;
}
html[data-theme="dark"] .td-save-btn {
  background: #c41e3a;
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .td-save-btn:hover {
  background: #a04050;
}
