/*
 * FSG Dark Mode — phase 1 (quick win)
 *
 * Additive override stylesheet: main.css stays untouched.
 * Active on <html data-theme="dark"> (opt-in via toggle, localStorage
 * "fsgTheme", no-FOUC snippet in <head>) — since round 5 also for the
 * public website (logged out); default stays light.
 *
 * Color system: see Nextcloud-FSG/Admin/Typo3/DarkMode/2026-07-07_darkmode-designplan.md
 */

/* ------------------------------------------------------------------ */
/* Theme toggle in the service nav (always styled)                      */
/* ------------------------------------------------------------------ */
/* icons (fa-solid, colors follow the menu):
   auto = circle-half-stroke; on a light page the moon-star (switch to dark),
   on a dark page the sun-bright (switch to light) */
.theme-toggle::before {content: "\f042"; font-weight: 900;} /* fa-circle-half-stroke = auto */
html[data-theme-mode="light"] body .theme-toggle::before {content: "\e7c9";} /* fa-moon-star */
html[data-theme-mode="dark"] body .theme-toggle::before {content: "\e28f";} /* fa-sun-bright */

/* ------------------------------------------------------------------ */
/* Token switching                                                      */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] body {
	color-scheme: dark;

	/* dark tokens (new) */
	--dm-bg-page:    #1D1D1B; /* = --fsg_black, corporate design */
	--dm-bg-surface: #242527;
	--dm-bg-raised:  #2C2E31;
	--dm-bg-hover:   #35373B;
	--dm-txt:        #E7E9EC;
	--dm-txt-2nd:    #9DA2A8;
	--dm-link:       #4FA8DF; /* lightened --fsg_blue */
	--dm-danger-txt: #F1545E; /* lightened --fsg_red */

	/* For templates: var(--bg-content, #fff) etc. — in light mode the
	   fallback applies (token undefined), in dark mode these values */
	--bg-content: var(--dm-bg-surface);
	--bg-tooltip: var(--dm-bg-raised);
	--bg-ignored: #4A4D52;
	--txt-on-ignored: #E7E9EC;
	/* zebra: clearly visible "dark" vs. "very dark" */
	--bg-stripe-even: #2A2D31;
	--bg-stripe-odd:  #1F2022;
	--bg-team-even: #33363B;
	--bg-team-odd:  #2A2C30;
	--bg-hover-info: #35373B;
	/* error hint boxes (e.g. Keycloak hint on the login page) */
	--bg-alert-err:  #3B2528;
	--txt-alert-err: #E7E9EC;

	/* status tokens for status.css (fsg-* classes in templates + SQL query HTML) */
	--st-ok:     #8CCB4F; /* lightened --fsg_green */
	--st-err:    #F1545E; /* lightened --fsg_red */
	--st-warn:   #F0A73A;
	--st-info:   #4FA8DF;
	--st-muted:  #9DA2A8;
	--st-signal: #7BA3F5;
	--st-teal:   #2BBFA8;
	--st-orange: #F0A73A;
	--st-brown:  #C89B6E;
	--st-bg-muted:     #3A3D42;
	--st-bg-muted-txt: #E7E9EC;
	/* intensity ramp: dark greens instead of pastels */
	--st-scale-1: #1F3327;
	--st-scale-2: #24422F;
	--st-scale-3: #2B5439;
	--st-scale-4: #346845;
	--st-scale-5: #3E7D52;

	/* remap existing light tokens -> flips every var() usage in main.css */
	--txt_black: var(--dm-txt);
	--border:    #3A3D42;
	--gray-f1:   var(--dm-bg-raised);
	--gray-f4:   #26272A;
	--gray-f5:   #2A2D31; /* zebra stripe "dark" (even rows) */
	--gray-f8:   var(--dm-bg-surface);
	--gray-dark: #C3C7CC; /* used as text color (accordion, dt-info) */
	--charcoal:  #D5D8DB; /* text color in wrl_table th */
	--silver:    #6E7378; /* mixed usage bg/border/text */

	background-color: var(--dm-bg-page);
	color: var(--dm-txt);
}

/* ------------------------------------------------------------------ */
/* Base: links, text                                                    */
/* ------------------------------------------------------------------ */
/* text selection: black on gold, exactly like light mode (main.css uses
   var(--txt_black) which is remapped to light in dark mode) */
html[data-theme="dark"] body ::selection {background-color: var(--fsg_gold); color: #1D1D1B;}
html[data-theme="dark"] body ::-moz-selection {background-color: var(--fsg_gold); color: #1D1D1B;}
html[data-theme="dark"] body a {color: var(--dm-link);}
html[data-theme="dark"] body a:hover,
html[data-theme="dark"] body a:hover::before {color: var(--dm-danger-txt);}

/* ------------------------------------------------------------------ */
/* Header, top nav, service nav                                         */
/* ------------------------------------------------------------------ */
/* header: flat surface — logo readability comes from the dark logo variants */
html[data-theme="dark"] body #site-header {background: var(--dm-bg-surface); border-bottom: 1px solid var(--border);}
html[data-theme="dark"] body #servicenav a,
html[data-theme="dark"] body #mobile-header a,
html[data-theme="dark"] body #breadcrumb a {color: var(--dm-txt);}
html[data-theme="dark"] body #servicenav a:hover,
html[data-theme="dark"] body #mobile-header a:hover,
html[data-theme="dark"] body #breadcrumb a:hover {color: var(--dm-danger-txt);}
html[data-theme="dark"] body #auth .servicebar {border-left-color: var(--border);}

/* logo: dark variants with lightened black tone (#1D1D1B -> #BFC3C8),
   red and gold stay untouched; swapped via content:url */
html[data-theme="dark"] body #topbox a#homelink img[src*="FSG-icon"] {content: url("/typo3conf/ext/fsg_sitepackage/Resources/Public/Icons/FSG-icon_dark.svg");}
html[data-theme="dark"] body #topbox a#homelink img[src*="FSG_Logo_rgb"] {content: url("/typo3conf/ext/fsg_sitepackage/Resources/Public/Icons/FSG_Logo_rgb_dark.svg");}

/* 2nd level dropdown: dark frosted glass instead of light */
html[data-theme="dark"] body .navbar #topnav .secondlvl {background: rgba(36, 37, 39, 0.75); border-color: var(--border); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);}
html[data-theme="dark"] body .navbar #topnav .secondlvl::after {background-color: rgba(29, 29, 27, 0.5);}
/* active item: gold surface needs dark text (hardcoded black already fits, just make sure) */
html[data-theme="dark"] body .navbar #topnav .secondlvl > li.act > a {color: #1D1D1B;}

/* sidebar flyout (collapsed sidenav, hover preview): dark frosted glass */
html[data-theme="dark"] body #auth #innerwrapper.closed.sidenav-preview #leftcol {background: rgba(36, 37, 39, 0.8); border-right-color: var(--border); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);}

/* mobile menu (mmenu light) */
html[data-theme="dark"] body .mm-spn.mm-spn--light {background: var(--dm-bg-surface); color: var(--dm-txt);}

/* ------------------------------------------------------------------ */
/* Sidebar                                                              */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] body #sidenav ul > li > a {border-left-color: var(--dm-bg-raised);}
html[data-theme="dark"] body #sidenav ul > li.cur > a {color: #1D1D1B;} /* text on gold */

/* ------------------------------------------------------------------ */
/* Content components (hardcoded white in main.css)                     */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] body .frame-layout-1 .text-frame {background-color: var(--dm-bg-surface);}
html[data-theme="dark"] body .news-list-view .article {background-color: #26282B; border: 1px solid #33363B;}
/* news image area light: dark logos in news images stay visible,
   photos cover the area anyway */
html[data-theme="dark"] body .news-list-view .news-img-wrap {background-color: #D6D8DB;}

/* partner/sponsor logos in content: light surface (logos unaltered) */
html[data-theme="dark"] body #maincol .sponsoren_logos {background-color: #D6D8DB; border-radius: 4px; padding: 15px 20px;}
html[data-theme="dark"] body #maincol .frame-type-textpic .ce-gallery figure.image {background-color: #D6D8DB; border-radius: 4px;}
html[data-theme="dark"] body figcaption {color: var(--dm-txt);}
html[data-theme="dark"] body .frame-layout-4 figcaption {color: var(--dm-txt);}
html[data-theme="dark"] body .modal {background: var(--dm-bg-raised); border: 1px solid var(--border);}
html[data-theme="dark"] body .upload-state.neutral {background-color: var(--dm-bg-surface) !important;}

/* login and registration boxes */
html[data-theme="dark"] body .frame-type-felogin_login,
html[data-theme="dark"] body .layout-100.layout-intended .tx-srfeuserregister-pi1 form {background-color: var(--dm-bg-surface); box-shadow: none; border: 1px solid var(--border);}

/* standard tables (zebra: even rows follow --gray-f5 automatically,
   odd rows are hardcoded white in main.css) */
html[data-theme="dark"] body .overview thead,
html[data-theme="dark"] body .contenttable thead,
html[data-theme="dark"] body .table-fsg1 thead,
html[data-theme="dark"] body table.data thead,
html[data-theme="dark"] body .wrl_table thead {background-color: var(--dm-bg-raised);}
html[data-theme="dark"] body .overview tbody,
html[data-theme="dark"] body .contenttable tbody,
html[data-theme="dark"] body .table-fsg1 tbody,
html[data-theme="dark"] body table.data tbody,
html[data-theme="dark"] body .wrl_table tbody {background-color: var(--bg-stripe-odd);}
html[data-theme="dark"] body .overview tbody > tr:nth-child(2n+1),
html[data-theme="dark"] body .contenttable tbody > tr:nth-child(2n+1),
html[data-theme="dark"] body .table-fsg1 tbody > tr:nth-child(2n+1),
html[data-theme="dark"] body table.data tbody > tr:nth-child(2n+1),
html[data-theme="dark"] body .wrl_table tbody > tr:nth-child(2n+1) {background: var(--bg-stripe-odd);}
html[data-theme="dark"] body .judge-table tr {background: var(--dm-bg-surface);}

/* DataTables (main.css sets white !important) */
html[data-theme="dark"] body div.dt-container tbody {background-color: var(--bg-stripe-odd) !important;}
html[data-theme="dark"] body div.dt-container table.dataTable tbody tr {background-color: var(--bg-stripe-odd);}
html[data-theme="dark"] body div.dt-container table.dataTable tbody tr:nth-child(odd) {background-color: var(--gray-f5);}
html[data-theme="dark"] body div.dt-container table.dataTable thead th {background-color: var(--dm-bg-raised); color: var(--dm-txt);}
/* button-collection dropdown (Columns / States / Export menus): hardcoded
   white; it is appended to <body>, so it is not covered by #maincol rules */
html[data-theme="dark"] body div.dt-button-collection {background-color: var(--dm-bg-raised); border-color: var(--border); color: var(--dm-txt); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);}
html[data-theme="dark"] body div.dt-button-collection.fixed {background-color: var(--dm-bg-raised);}
html[data-theme="dark"] body div.dt-button-collection .dt-button:hover:not(.disabled) {background: var(--dm-bg-hover);}
html[data-theme="dark"] body div.dt-button-collection .dt-button.disabled {color: var(--dm-txt-2nd);}
/* the transparent backdrop behind the open dropdown */
html[data-theme="dark"] body div.dt-button-background {background: rgba(0, 0, 0, 0.4);}

/* generic tables in content */
html[data-theme="dark"] body #maincol table th {background-color: var(--dm-bg-raised);}

/* ------------------------------------------------------------------ */
/* Forms                                                                */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] body #maincol input[type="email"],
html[data-theme="dark"] body #maincol input[type="password"],
html[data-theme="dark"] body #maincol select,
html[data-theme="dark"] body #maincol textarea,
html[data-theme="dark"] body #maincol input[type="text"] {background-color: var(--dm-bg-raised); color: var(--dm-txt);}
/* radios/checkboxes: uniform bright checked state (FSG green) — some render
   nearly black on dark otherwise (e.g. gender radios in the volunteer form) */
html[data-theme="dark"] body input[type="radio"],
html[data-theme="dark"] body input[type="checkbox"] {accent-color: var(--fsg_green);}
/* volunteer registration: page style block paints custom radios (appearance:
   none) with per-value colors — the "black" checked states become light */
html[data-theme="dark"] body div.tx_frontendformslib-fe_users-gender div.radiobuttons input[type="radio"]:checked,
html[data-theme="dark"] body #content .user-fsgregister-pi1 fieldset#step_5 div.radiobuttons input[type="radio"][value="3"]:checked,
html[data-theme="dark"] body #content .user-fsgregister-pi1 fieldset#step_5 div.radiobuttons input[type="radio"][value="99"]:checked {background: var(--dm-txt) !important; border-color: var(--dm-txt) !important;}

/* gold buttons need dark text (would otherwise use the remapped --txt_black) */
html[data-theme="dark"] body #maincol input[type="button"],
html[data-theme="dark"] body #maincol input[type="submit"] {color: #1D1D1B;}
html[data-theme="dark"] body #maincol input[type="button"]:disabled,
html[data-theme="dark"] body #maincol input[type="submit"]:disabled {color: var(--dm-txt);}

/* ------------------------------------------------------------------ */
/* Dark footer; partner logos on a light panel (original colors,       */
/* no alteration — partner brand guidelines)                            */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] body #wrapper > footer {background-color: var(--dm-bg-surface); border-top-color: var(--border);}
html[data-theme="dark"] body #wrapper > footer a {color: var(--dm-txt);}
html[data-theme="dark"] body #wrapper > footer a:hover {color: var(--dm-danger-txt);}
html[data-theme="dark"] body footer .sponsoren_logos {background-color: #D6D8DB; border-radius: 4px; padding: 12px 16px;}
/* social icons: keep circle dark (would otherwise use the remapped --txt_black) */
html[data-theme="dark"] body .socialmedia i {background-color: #3A3D42;}

/* ------------------------------------------------------------------ */
/* Images: dim instead of invert (footer logos excluded)                */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] body main img {filter: brightness(0.88);}

/* ------------------------------------------------------------------ */
/* Legacy guards: catch inline styles from PHP/DB                      */
/* (attribute substring + !important beats inline styles)               */
/* ------------------------------------------------------------------ */
/* zebra stripes, e.g. BackendModule output */
html[data-theme="dark"] body [style*="background-color: #ccc"],
html[data-theme="dark"] body [style*="background-color:#ccc"] {background-color: var(--dm-bg-raised) !important;}
/* white boxes (confirm gate, srfeuser wrapper etc.) */
html[data-theme="dark"] body [style*="background:#fff"],
html[data-theme="dark"] body [style*="background: #fff"],
html[data-theme="dark"] body [style*="background-color:#fff"],
html[data-theme="dark"] body [style*="background-color: #fff"],
html[data-theme="dark"] body [style*="background-color: white"],
html[data-theme="dark"] body [style*="background-color:white"],
html[data-theme="dark"] body [style*="background:#f9f9f9"],
html[data-theme="dark"] body [style*="background: #f9f9f9"],
html[data-theme="dark"] body [style*="background-color: rgb(255, 255, 255)"] {background-color: var(--dm-bg-surface) !important; color: var(--dm-txt) !important;}
/* gray hint text */
html[data-theme="dark"] body [style*="color:#808080"],
html[data-theme="dark"] body [style*="color: #808080"] {color: var(--dm-txt-2nd) !important;}
/* legacy HTML bgcolor attribute */
html[data-theme="dark"] body [bgcolor="#FFFFFF"],
html[data-theme="dark"] body [bgcolor="#ffffff"] {background-color: var(--dm-bg-surface) !important;}
html[data-theme="dark"] body [bgcolor="#cccccc"] {background-color: var(--dm-bg-raised) !important;}

/* gray/black inline text without its own background -> light */
html[data-theme="dark"] body [style*="color:black"]:not([style*="background"]),
html[data-theme="dark"] body [style*="color: black"]:not([style*="background"]),
html[data-theme="dark"] body [style*="color:#333"]:not([style*="background"]) {color: var(--dm-txt) !important;}
html[data-theme="dark"] body [style*="color:#999"]:not([style*="background"]),
html[data-theme="dark"] body [style*="color:#888"]:not([style*="background"]),
html[data-theme="dark"] body [style*="color:#555"]:not([style*="background"]),
html[data-theme="dark"] body [style*="color:#666"]:not([style*="background"]),
html[data-theme="dark"] body [style*="color:gray"]:not([style*="background"]) {color: var(--dm-txt-2nd) !important;}

/* light inline backgrounds (status cells from SQL queries): keep the surface
   but force dark text -> readable in both themes */
html[data-theme="dark"] body [style*="background-color:LightGray"],
html[data-theme="dark"] body [style*="background-color:lightgray"],
html[data-theme="dark"] body [style*="background-color:yellow"],
html[data-theme="dark"] body [style*="background-color:Yellow"],
html[data-theme="dark"] body [style*="background: Yellow"],
html[data-theme="dark"] body [style*="background-color:pink"],
html[data-theme="dark"] body [style*="background-color:LightSkyBlue"],
html[data-theme="dark"] body [style*="background:#EAFAF1"],
html[data-theme="dark"] body [style*="background:#D5F5E3"],
html[data-theme="dark"] body [style*="background:#ABEBC6"],
html[data-theme="dark"] body [style*="background:#82E0AA"],
html[data-theme="dark"] body [style*="background:#58D68D"],
html[data-theme="dark"] body [style*="background-color:#FF9"],
html[data-theme="dark"] body [style*="background-color:#FFFF99"],
html[data-theme="dark"] body [style*="background-color:#FFDD00"],
html[data-theme="dark"] body [style*="background:#FFDD00"],
html[data-theme="dark"] body [style*="background-color:Gold"],
html[data-theme="dark"] body [style*="background-color:LightBlue"],
html[data-theme="dark"] body [style*="background:LightBlue"],
html[data-theme="dark"] body [style*="background-color:Plum"],
html[data-theme="dark"] body [style*="background:Plum"],
html[data-theme="dark"] body [style*="background-color:Aquamarine"],
html[data-theme="dark"] body [style*="background-color:LemonChiffon"],
html[data-theme="dark"] body [style*="background:LemonChiffon"],
html[data-theme="dark"] body [style*="background-color:Khaki"],
html[data-theme="dark"] body [style*="background-color:PaleGreen"],
html[data-theme="dark"] body [style*="background-color:LightGreen"],
html[data-theme="dark"] body [style*="background-color:LightYellow"],
/* bright named colors from the hotel assigned-users list (case-insensitive) */
html[data-theme="dark"] body [style*="background-color:Chartreuse" i],
html[data-theme="dark"] body [style*="background-color:LightSteelBlue" i],
html[data-theme="dark"] body [style*="background-color:Orange" i],
html[data-theme="dark"] body [style*="background-color:Pink" i],
html[data-theme="dark"] body [style*="background-color:WhiteSmoke" i],
/* JS-set styles serialize lowercase with a space (e.g. hotel room grid) */
html[data-theme="dark"] body [style*="background-color: gold" i],
html[data-theme="dark"] body [style*="background-color: lightskyblue" i],
html[data-theme="dark"] body [style*="background-color: lightsteelblue" i],
html[data-theme="dark"] body [style*="background-color: pink" i],
html[data-theme="dark"] body [style*="background-color: plum" i],
html[data-theme="dark"] body [style*="background-color: lime" i],
html[data-theme="dark"] body [style*="background-color: lightblue" i],
html[data-theme="dark"] body [style*="background-color:#e2e2e2"],
/* design judge selection: light status colors on cells + <option> items */
html[data-theme="dark"] body [style*="background-color:#8ff439" i],
html[data-theme="dark"] body [style*="background-color:#de8bc0" i],
html[data-theme="dark"] body [style*="background-color:#edf439" i],
/* world ranking data base: light-blue top-placement highlight cells (#9cf) */
html[data-theme="dark"] body [style*="background-color:#9cf" i] {color: #1D1D1B !important;}
/* design judge tool: color-coded grids paint cells via inline background
   (hex from server, rgb() from JS edits). In light mode every colored cell
   has dark text -> mirror that here regardless of the concrete color, incl.
   the cream highlight rows. */
html[data-theme="dark"] body #judge_table td[style*="background"],
html[data-theme="dark"] body #team_table td[style*="background"],
html[data-theme="dark"] body #special_field_table td[style*="background"],
html[data-theme="dark"] body #design_score_table td[style*="background"] {color: #1D1D1B !important;}
/* preliminary-schedule warning box (.judge-topbox, inline pink background):
   drop the background in dark mode, keep the red border, lift the red text */
html[data-theme="dark"] body .judge-topbox {background: transparent !important; color: var(--dm-danger-txt) !important;}
/* allocation-map import report modal (fsg Judge Backend.css, appended to
   <body> so no #maincol scope): white box -> dark */
html[data-theme="dark"] body .fsg-import-report-box {background: var(--dm-bg-surface); color: var(--dm-txt);}
html[data-theme="dark"] body .fsg-import-report-muted {color: var(--dm-txt-2nd);}
html[data-theme="dark"] body .fsg-import-report-table th,
html[data-theme="dark"] body .fsg-import-report-table td {border-color: var(--border);}
html[data-theme="dark"] body .fsg-import-report-table thead th {background: var(--dm-bg-raised);}
html[data-theme="dark"] body .fsg-import-report-errors {color: var(--dm-danger-txt);}
/* zebra grays from Smarty templates (asf/esf_form_list, teams_admin,
   registration_pdf, magazine, helpers …): recolor in dark instead of keeping them light */
html[data-theme="dark"] body [style*="background-color:#dcdcdc"] {background-color: var(--bg-team-even) !important; color: var(--dm-txt) !important;}
html[data-theme="dark"] body [style*="background-color:#eeeeee"] {background-color: var(--bg-team-odd) !important; color: var(--dm-txt) !important;}
html[data-theme="dark"] body [style*="background-color:#ededed"] {background-color: var(--bg-stripe-even) !important; color: var(--dm-txt) !important;}
/* amber/green status cells (userupload_admin, partly set via JS -> rgb form) */
html[data-theme="dark"] body [style*="background-color:#eeb912"],
html[data-theme="dark"] body [style*="background-color: rgb(238, 185, 18)"],
html[data-theme="dark"] body [style*="background-color:#0c0"],
html[data-theme="dark"] body [style*="background-color: rgb(0, 204, 0)"] {color: #1D1D1B !important;}
html[data-theme="dark"] body [style*="background-color:#eeb912"] a,
html[data-theme="dark"] body [style*="background-color: rgb(238, 185, 18)"] a {color: #00427A !important;}

/* ------------------------------------------------------------------ */
/* user_fsg issuetracker (rules questions): both templates carry style  */
/* blocks with a light status color system -> dark equivalents that     */
/* keep the hue semantics (mint=closed, green=published, cyan=internal, */
/* pink=feedback, orange=implementation)                                */
/* ------------------------------------------------------------------ */
/* issue view (ticket.html): addendum rows. Buttons stay untouched —
   main.css wins with the standard gold button styling in both themes */
html[data-theme="dark"] body tr.internal-message td {background-color: #1E3A42;}
html[data-theme="dark"] body tr.confidential-message td {background-color: #1C3D5C;}
html[data-theme="dark"] body tr.expert-request td {background: repeating-linear-gradient(135deg, #1E3A42, #1E3A42 10px, #24464F 10px, #24464F 20px), var(--dm-bg-surface);}
html[data-theme="dark"] body tr.feedback-request td {background: repeating-linear-gradient(135deg, #46243F, #46243F 10px, #542C4B 10px, #542C4B 20px), var(--dm-bg-surface);}
html[data-theme="dark"] body tr.closed td {background-color: #1F4633;}
html[data-theme="dark"] body tr.published td {background-color: #2E6B3A;}
html[data-theme="dark"] body tr.assigned td {background-color: var(--dm-bg-raised);}
html[data-theme="dark"] body tr.sel-implementation td {background-color: #5C3A10;}
/* ticket list (ticket_list.html): status cells + legend swatches.
   Pale pastels get dark equivalents, saturated signals keep their color
   and get dark text */
html[data-theme="dark"] body table.overview td.new,
html[data-theme="dark"] body #list-legend span.new {background-color: #4A282D;}
html[data-theme="dark"] body table.overview td.new-im-rec-owngroup,
html[data-theme="dark"] body #list-legend span.new-im-rec-owngroup {background-color: #1D4756;}
html[data-theme="dark"] body table.overview td.new-im-rec,
html[data-theme="dark"] body table.overview td.internal,
html[data-theme="dark"] body #list-legend span.new-im-rec {background-color: #1E3A42;}
html[data-theme="dark"] body table.overview td.feedback,
html[data-theme="dark"] body #list-legend span.feedback {background-color: #46243F;}
html[data-theme="dark"] body table.overview td.not-assigned,
html[data-theme="dark"] body table.overview td.answered,
html[data-theme="dark"] body #list-legend span.not-assigned,
html[data-theme="dark"] body #list-legend span.answered {background-color: var(--dm-bg-surface);}
html[data-theme="dark"] body table.overview td.closed,
html[data-theme="dark"] body #list-legend span.closed {background-color: #1F4633;}
html[data-theme="dark"] body table.overview td.published,
html[data-theme="dark"] body #list-legend span.published {background-color: #2E6B3A;}
html[data-theme="dark"] body table.overview td.new.has-hidden-messages {background: linear-gradient(to right, #4A282D 85%, #bf9bf8 15%);}
html[data-theme="dark"] body table.overview td.new-im-rec-owngroup.has-hidden-messages {background: linear-gradient(to right, #1D4756 85%, #bf9bf8 15%);}
html[data-theme="dark"] body table.overview td.new-im-rec.has-hidden-messages {background: linear-gradient(to right, #1E3A42 85%, #bf9bf8 15%);}
html[data-theme="dark"] body table.overview td.not-assigned.has-hidden-messages {background: linear-gradient(to right, var(--dm-bg-surface) 85%, #bf9bf8 15%);}
/* saturated signal cells stay loud, just with readable dark text */
html[data-theme="dark"] body table.overview td.new-owngroup,
html[data-theme="dark"] body table.overview td.overdue,
html[data-theme="dark"] body table.overview td.assigned,
html[data-theme="dark"] body table.overview td.soonoverdue,
html[data-theme="dark"] body table.overview td.confidential,
html[data-theme="dark"] body table.overview td.cv,
html[data-theme="dark"] body table.overview td.ev,
html[data-theme="dark"] body table.overview td.dv {color: #1D1D1B;}
html[data-theme="dark"] body table.overview td.new-owngroup a,
html[data-theme="dark"] body table.overview td.assigned a,
html[data-theme="dark"] body table.overview td.confidential a {color: #00427A;}
/* tags (both templates): black borders + semi-transparent discuss chip */
html[data-theme="dark"] body td .tag,
html[data-theme="dark"] body td.tag span {border-color: var(--dm-txt-2nd);}
html[data-theme="dark"] body td .tag.discuss,
html[data-theme="dark"] body td.tag .discuss {background-color: #46243F; border-color: #46243F; color: var(--dm-txt);}

/* hotel booking (user_fsg hotel_booking.html style block): submit panel,
   lock notice and monday separator are hardcoded light */
html[data-theme="dark"] body .submit-section {background-color: var(--dm-bg-raised); border-color: var(--border);}
html[data-theme="dark"] body .submit-section [style*="color: #666"] {color: var(--dm-txt-2nd) !important;}
html[data-theme="dark"] body .lock-notice {background-color: #3A3323; border-color: #6B5A25; color: #E8C55F;}
html[data-theme="dark"] body td.monday {border-left-color: var(--dm-txt-2nd);}

/* booking TODO (class-based tool style block, all hardcoded light) */
html[data-theme="dark"] body .todo-card {background: var(--dm-bg-surface); border-color: var(--border); border-left-color: var(--dm-txt-2nd); color: var(--dm-txt);}
html[data-theme="dark"] body .todo-card.row-error {border-left-color: var(--dm-danger-txt);}
html[data-theme="dark"] body .todo-card.row-pending {border-left-color: var(--fsg_gold);}
html[data-theme="dark"] body .todo-head .t-uid {color: var(--dm-txt-2nd);}
html[data-theme="dark"] body .todo-head .t-hotels,
html[data-theme="dark"] body .todo-head .t-wishes,
html[data-theme="dark"] body .todo-head .t-group,
html[data-theme="dark"] body .todo-head .t-sub {color: var(--dm-txt-2nd);}
html[data-theme="dark"] body .todo-head .t-cat {background: var(--dm-bg-raised); color: var(--dm-txt);}
html[data-theme="dark"] body .todo-head .t-cat.c-err {background: #3B2528; color: var(--dm-danger-txt);}
html[data-theme="dark"] body .todo-head .t-cat.c-pend {background: #3A3323; color: #E8C55F;}
html[data-theme="dark"] body .todo-head .t-job {background: #1C2C3A; color: var(--dm-link);}
/* day grid */
html[data-theme="dark"] body .day-cell {border-color: var(--border);}
html[data-theme="dark"] body .day-cell .d-lbl {background: var(--dm-bg-raised); color: var(--dm-txt-2nd); border-bottom-color: var(--border);}
html[data-theme="dark"] body .day-cell.filler-cell,
html[data-theme="dark"] body .day-cell.filler-cell .d-lbl {background: var(--dm-bg-page);}
html[data-theme="dark"] body .day-cell.monday {border-left-color: var(--dm-txt-2nd);}
/* value cells keep their status hue but need dark text */
html[data-theme="dark"] body .day-cell.day-chg .d-val,
html[data-theme="dark"] body .day-cell.day-err-over .d-val,
html[data-theme="dark"] body .day-cell.day-err-miss .d-val {color: #1D1D1B;}
/* hint / error boxes */
html[data-theme="dark"] body .todo-err {background: #3B2528; color: var(--dm-danger-txt);}
html[data-theme="dark"] body .todo-hint-partner {background: #16323B; color: #7FD4E6;}
html[data-theme="dark"] body .todo-hint-mate {background: var(--dm-bg-raised); color: var(--dm-txt);}
html[data-theme="dark"] body .todo-hint-none {background: var(--dm-bg-surface); color: var(--dm-txt-2nd); border-color: var(--border);}
/* filter pills */
html[data-theme="dark"] body .todo-filter a {border-color: var(--border); color: var(--dm-link);}
html[data-theme="dark"] body .todo-filter a.active {background: var(--fsg_gold); border-color: var(--dm-txt-2nd); color: #1D1D1B;}
/* submit panel */
html[data-theme="dark"] body .submit-selected-section {background-color: var(--dm-bg-raised); border-color: var(--border);}

/* ------------------------------------------------------------------ */
/* Mailing lists tool (user_fsgmaillists .fsgml scope, own light style   */
/* block). Lift brand palette for text, dark surfaces, dark tag chips.    */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] body .fsgml {
  --blue:  #4FA8DF; /* lightened for text/borders on dark */
  --cyan:  #3FB0D4;
  --cyanl: #5FC4E1;
  color: var(--dm-txt);
}
/* white surfaces -> dark */
html[data-theme="dark"] body .fsgml select,
html[data-theme="dark"] body .fsgml .btn,
html[data-theme="dark"] body .fsgml .fbtn,
html[data-theme="dark"] body .fsgml .node,
html[data-theme="dark"] body .fsgml .qfind .qres,
html[data-theme="dark"] body .fsgml .qfind .qres button,
html[data-theme="dark"] body .fsgml .tag-extunauth {background: var(--dm-bg-surface);}
html[data-theme="dark"] body .fsgml .node {border-color: var(--border);}
html[data-theme="dark"] body .fsgml .qfind .qres button:hover {background: var(--dm-bg-hover);}
html[data-theme="dark"] body .fsgml .newalias,
html[data-theme="dark"] body .fsgml .teamexcl-box,
html[data-theme="dark"] body .fsgml .fsgml-legend {background: var(--dm-bg-surface); border-color: var(--border);}
/* active brand-colored buttons: keep saturated bg, ensure readable text */
html[data-theme="dark"] body .fsgml .btn.active,
html[data-theme="dark"] body .fsgml .fauto.on {background: #1C5A8A; color: #fff; border-color: #1C5A8A;}
/* muted greys -> readable */
html[data-theme="dark"] body .fsgml .stats,
html[data-theme="dark"] body .fsgml .counts,
html[data-theme="dark"] body .fsgml .aliases,
html[data-theme="dark"] body .fsgml .teamexcl-hd,
html[data-theme="dark"] body .fsgml .detail-toggle,
html[data-theme="dark"] body .fsgml .addr-dom,
html[data-theme="dark"] body .fsgml .fsg-priv-icon,
html[data-theme="dark"] body .fsgml .fsg-list-icon {color: var(--dm-txt-2nd);}
html[data-theme="dark"] body .fsgml .filters .sep {background: var(--border);}
/* pale tag chips -> dark equivalents keeping the hue */
html[data-theme="dark"] body .fsgml .tag-cls,
html[data-theme="dark"] body .fsgml .tag-fwd-int {background: var(--dm-bg-raised); color: var(--dm-txt-2nd); border-color: var(--border);}
html[data-theme="dark"] body .fsgml .ftag {color: var(--dm-txt-2nd); border-color: var(--border);}
html[data-theme="dark"] body .fsgml .tag-mbox,
html[data-theme="dark"] body .fsgml .reload-ok {background: #1F3327; color: #8CCB4F;}
html[data-theme="dark"] body .fsgml .tag-list {background: #16323B; color: #5FC4E1;}
html[data-theme="dark"] body .fsgml .tag-dup,
html[data-theme="dark"] body .fsgml .tag-pending,
html[data-theme="dark"] body .fsgml .tag-stop,
html[data-theme="dark"] body .fsgml .reload-err {background: #3B2528; color: var(--dm-danger-txt);}
html[data-theme="dark"] body .fsgml details.node[data-broken="1"] {background: #3B2528;}
html[data-theme="dark"] body .fsgml .tag-official {background: #3A2440; color: #D9A8E6; border-color: #6B3A78;}
html[data-theme="dark"] body .fsgml .mem.official {color: #D9A8E6;}
html[data-theme="dark"] body .fsgml .tag-editing {background: #3A3323; color: #E8C55F;}
html[data-theme="dark"] body .fsgml .tag-auto {background: #1C2C3A; color: var(--dm-link);}
/* elements with hardcoded near-black text (#1a1a1a) -> light on dark */
html[data-theme="dark"] body .fsgml .alias,
html[data-theme="dark"] body .fsgml .ecbtn.fmb,
html[data-theme="dark"] body .fsgml .fteam,
html[data-theme="dark"] body .fsgml .mem.teamdom,
html[data-theme="dark"] body .fsgml .fsg-mb-icon,
html[data-theme="dark"] body .fsgml .fsg-mbox-icon {color: var(--dm-txt);}
html[data-theme="dark"] body .fsgml .fteam {border-color: var(--dm-txt-2nd);}
html[data-theme="dark"] body .fsgml .fteam.on,
html[data-theme="dark"] body .fsgml .tag-team,
html[data-theme="dark"] body .fsgml .tag-teamwarn,
html[data-theme="dark"] body .fsgml .tag-teamexcl,
html[data-theme="dark"] body .fsgml .ecbtn.fmb.on {background: #4A4D52; color: #fff; border-color: #4A4D52;}
html[data-theme="dark"] body .fsgml .mem.via-helper::before {color: var(--dm-txt) !important;}
/* strikethrough excluded members */
html[data-theme="dark"] body .fsgml .teamexcl-name,
html[data-theme="dark"] body .fsgml .teamexcl-mail,
html[data-theme="dark"] body .fsgml .teamexcl-list a {color: var(--dm-txt-2nd);}
html[data-theme="dark"] body .fsgml .nested-list-border {border-left-color: #16323B;}
html[data-theme="dark"] body .fsgml ul.nest ul.nest {border-left-color: #16323B;}

/* ------------------------------------------------------------------ */
/* Per-page styles from sys_template records ("+ext css wide left ...") */
/* Those records set light zebra/popup colors via <style> in the head — */
/* neutralized here via higher specificity (DB stays untouched)         */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] body table.contenttable tr:nth-child(even),
html[data-theme="dark"] body table.overview tr:nth-child(even) {background: var(--gray-f5);}
html[data-theme="dark"] body table.dataTable tbody tr.even {background-color: var(--gray-f5);}
html[data-theme="dark"] body .searchSQL label {color: var(--dm-txt-2nd);}

/* overlib popup (#olib comes from sys_template, bgcolor attributes from overlib itself) */
html[data-theme="dark"] body #olib td,
html[data-theme="dark"] body #olib th {border-color: var(--border);}
html[data-theme="dark"] body #olib tr:nth-child(even) {background-color: var(--dm-bg-raised);}
html[data-theme="dark"] body #overDiv font {color: var(--dm-txt);}

/* ------------------------------------------------------------------ */
/* user_fsgregister event profile (event_profile.css = pure light CSS)  */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] body .event-profile-current {background: linear-gradient(135deg, #26272A 0%, #2C2E31 100%);}
html[data-theme="dark"] body .magazine-section,
html[data-theme="dark"] body .upload-section,
html[data-theme="dark"] body .car-specs-section,
html[data-theme="dark"] body .timeline-card,
html[data-theme="dark"] body .card-content,
html[data-theme="dark"] body .magazine-section-compact,
html[data-theme="dark"] body .car-specs-section-compact,
html[data-theme="dark"] body .timeline-card-content,
html[data-theme="dark"] body .upload-section-compact {background: var(--dm-bg-surface);}
html[data-theme="dark"] body .event-year,
html[data-theme="dark"] body .event-title,
html[data-theme="dark"] body .timeline-header,
html[data-theme="dark"] body .magazine-section h4,
html[data-theme="dark"] body .magazine-section-compact h5,
html[data-theme="dark"] body .magazine-text,
html[data-theme="dark"] body .magazine-text-compact,
html[data-theme="dark"] body .upload-section h4,
html[data-theme="dark"] body .car-specs-section h4,
html[data-theme="dark"] body .car-specs-section-compact h5,
html[data-theme="dark"] body .specs-group h5,
html[data-theme="dark"] body .specs-table th,
html[data-theme="dark"] body .specs-table td,
html[data-theme="dark"] body .specs-table-compact th,
html[data-theme="dark"] body .specs-table-compact td,
html[data-theme="dark"] body .specs-collapsible summary {color: var(--dm-txt);}
html[data-theme="dark"] body .upload-date,
html[data-theme="dark"] body .upload-date-small,
html[data-theme="dark"] body .no-magazine-info,
html[data-theme="dark"] body .no-current-event,
html[data-theme="dark"] body .no-past-events {color: var(--dm-txt-2nd);}
html[data-theme="dark"] body .specs-table th,
html[data-theme="dark"] body .specs-collapsible summary,
html[data-theme="dark"] body .specs-table-compact th {background-color: var(--dm-bg-raised);}
html[data-theme="dark"] body .specs-table tr:hover,
html[data-theme="dark"] body .specs-collapsible summary:hover {background-color: var(--dm-bg-hover);}
/* expanded timeline card: replace the leftover light (#ecf0f1) dividers/borders */
html[data-theme="dark"] body .keywords-section-compact,
html[data-theme="dark"] body .specs-collapsible,
html[data-theme="dark"] body .specs-table-compact tr {border-color: var(--border);}
/* car magazine renders are studio shots on a white ground -> keep them on
   white in dark mode too (a dark frame around them looked mismatched) */
html[data-theme="dark"] body .car-photo-header,
html[data-theme="dark"] body .car-photo,
html[data-theme="dark"] body .card-car-photo,
html[data-theme="dark"] body .timeline-card-image {background-color: #fff;}

/* (issue tracker status cells: see the dedicated block further up —
   pale cells are recolored dark, saturated ones get dark text there) */
html[data-theme="dark"] body #list-legend {color: var(--dm-txt);}

/* fsg extension tool CSS (e.g. Review Volunteers): tone the bright status
   columns down to muted dark equivalents (light: #eeffaa / saturated green) */
html[data-theme="dark"] body #volunteers_table td.published {background-color: #3A4120; color: var(--dm-txt);}
html[data-theme="dark"] body #volunteers_table td.approved {background-color: #2F5D33; color: var(--dm-txt);}

/* switch FE user: icon on the gold "Switch back" button would otherwise inherit light text */
html[data-theme="dark"] body .btn-switchback-wrap::before {color: #1D1D1B;}

/* ------------------------------------------------------------------ */
/* CCBOM tool incl. mass import (user_fsg cost_bom_form: light <style>) */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] body .cbom-tool .cbom-intro strong,
html[data-theme="dark"] body .cbom-panel label,
html[data-theme="dark"] body .cbom-inline-form label,
html[data-theme="dark"] body #bom-sort-config > label,
html[data-theme="dark"] body #bom-roundtrip-export > strong,
html[data-theme="dark"] body .cbom-help > summary {color: var(--dm-txt);}
html[data-theme="dark"] body .cbom-panel .hint,
html[data-theme="dark"] body #bom-sort-config .prio,
html[data-theme="dark"] body .cbom-import-note,
html[data-theme="dark"] body .cbom-drop-hint {color: var(--dm-txt-2nd);}
html[data-theme="dark"] body .cbom-help,
html[data-theme="dark"] body .cbom-import {background: var(--dm-bg-surface); border-color: var(--border); color: var(--dm-txt-2nd);}
html[data-theme="dark"] body .cbom-help code {background: var(--dm-bg-raised); color: var(--dm-txt);}
html[data-theme="dark"] body .cbom-import > summary,
html[data-theme="dark"] body #bom-roundtrip-export a.btn-roundtrip {color: var(--st-info);}
html[data-theme="dark"] body .cbom-btn--ghost {background: var(--dm-bg-raised); color: var(--st-info); border-color: var(--border);}
html[data-theme="dark"] body .cbom-drop {background: var(--dm-bg-surface); border-color: var(--border);}
html[data-theme="dark"] body .cbom-drop.drag {background: var(--dm-bg-hover); border-color: var(--st-info);}
/* assembly group rows keep their pastel system colors -> force dark text */
html[data-theme="dark"] body #bom-table tr.grp-assembly td,
html[data-theme="dark"] body #bom-table tr.grp-assembly td a,
html[data-theme="dark"] body #bom-table tr.grp-assembly td .fa,
html[data-theme="dark"] body #missing-spa-table td.assembly {color: #1D1D1B;}
/* JS-built child table wrapper uses inline light gray */
html[data-theme="dark"] body [style*="background-color:#ddd"] {background-color: var(--dm-bg-raised) !important;}
/* DataTables Editor lightbox (CBOM edit/create popups): the envelope is
   hardcoded light (#fcfcfc / #e8e9eb) while labels inherit our light text
   -> recolor the whole dialog dark */
html[data-theme="dark"] body div.DTE {background: var(--dm-bg-surface); border-color: var(--border);}
html[data-theme="dark"] body div.DTE div.DTE_Body_Content {background: var(--dm-bg-surface);}
/* the lightbox display nests DTE in four wrappers and re-declares the
   light backgrounds with higher specificity -> mirror the full chain */
html[data-theme="dark"] body div.DTED_Lightbox_Wrapper div.DTED_Lightbox_Container div.DTED_Lightbox_Content_Wrapper div.DTED_Lightbox_Content div.DTE {background: var(--dm-bg-surface); border-color: var(--border);}
html[data-theme="dark"] body div.DTED_Lightbox_Wrapper div.DTED_Lightbox_Container div.DTED_Lightbox_Content_Wrapper div.DTED_Lightbox_Content div.DTE div.DTE_Body_Content {background: var(--dm-bg-surface);}
/* fields: inputs/selects/textareas are hardcoded white (white text in dark) */
html[data-theme="dark"] body div.DTE_Field input,
html[data-theme="dark"] body div.DTE_Field textarea,
html[data-theme="dark"] body div.DTE_Field select {background-color: var(--dm-bg-raised); border-color: var(--border); color: var(--dm-txt);}
html[data-theme="dark"] body div.DTE_Field input:focus,
html[data-theme="dark"] body div.DTE_Field textarea:focus {background-color: var(--dm-bg-hover);}
html[data-theme="dark"] body div.DTE_Field input::placeholder,
html[data-theme="dark"] body div.DTE_Field textarea::placeholder {color: var(--dm-txt-2nd);}
/* field-row hover is #f9f9f9 in the vendor css -> white bar in dark */
html[data-theme="dark"] body div.DTE_Field:hover,
html[data-theme="dark"] body div.DTE_Body div.DTE_Body_Content div.DTE_Field:hover {background-color: var(--dm-bg-hover); border-color: var(--border);}
html[data-theme="dark"] body div.DTE div.DTE_Header,
html[data-theme="dark"] body div.DTE div.DTE_Footer {background-color: var(--dm-bg-raised); border-color: var(--border); color: var(--dm-txt);}
html[data-theme="dark"] body div.DTE div.DTE_Field label,
html[data-theme="dark"] body div.DTE div.DTE_Field_Type_radio label {color: var(--dm-txt-2nd);}
html[data-theme="dark"] body div.DTE div.DTE_Form_Buttons button {background: var(--dm-bg-raised); background-image: none; border: 1px solid var(--border); color: var(--dm-txt); box-shadow: none;}
html[data-theme="dark"] body div.DTE div.DTE_Form_Buttons button:hover {background: var(--dm-bg-hover); border-color: var(--dm-txt-2nd);}
html[data-theme="dark"] body div.DTED_Lightbox_Close:after {color: var(--dm-txt);}

/* Leaflet maps: invert only the tile layer — markers, lines and popups
   live in separate panes and keep their original colors */
html[data-theme="dark"] body .leaflet-tile-pane {filter: invert(1) hue-rotate(180deg) brightness(0.91) contrast(0.9) saturate(0.6);}
html[data-theme="dark"] body .leaflet-container {background: #1D1D1B;}
html[data-theme="dark"] body .leaflet-control-zoom a {background: var(--dm-bg-raised); color: var(--dm-txt); border-color: var(--border);}
html[data-theme="dark"] body .leaflet-control-attribution {background: rgba(36, 37, 39, 0.8); color: var(--dm-txt-2nd);}
html[data-theme="dark"] body .leaflet-popup-content-wrapper,
html[data-theme="dark"] body .leaflet-popup-tip {background: var(--dm-bg-raised); color: var(--dm-txt);}

/* maps (teams/registered, /world/*): legend boxes come with white backgrounds */
html[data-theme="dark"] body .map-legend,
html[data-theme="dark"] body .connectivity-legend,
html[data-theme="dark"] body .legend-toggle-btn {background: var(--dm-bg-raised); color: var(--dm-txt); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);}
/* stats bar above the map (inline-styled HTML content element) */
html[data-theme="dark"] body [style*="background: #f8f9fa"],
html[data-theme="dark"] body [style*="background:#f8f9fa"] {background: var(--dm-bg-surface) !important; border-color: var(--border) !important; color: var(--dm-txt);}
/* social media icons in team tables are dark glyph images -> lighten */
/* QR codes are generated black-on-white (natively scannable). Inverting them for
   dark mode produced light-on-dark modules, which many scanners reject and which
   lose the quiet zone against the page. Keep the native code and just sit it on a
   padded white rounded card so it stays scannable but still fits the dark page. */
html[data-theme="dark"] body #maincol .images img[src^="data:image"] {background: #fff; padding: 8px; border-radius: 10px;}

/* ticket centre (/tc, user_fsgticketing): the view is styled by an inline
   <style> block with hardcoded dark text (#161213) on the header + ticket
   rows -> invisible on the dark zebra. Flip those to light. */
html[data-theme="dark"] body tr.row-even {background-color: var(--bg-team-even);}
html[data-theme="dark"] body tr.row-odd {background-color: var(--bg-team-odd);}
html[data-theme="dark"] body span.highlight {color: #1D1D1B;}
/* base text of the whole TC area is #161213 -> light (fixes header/rows,
   the "loading data" text and the ASCII logo that all inherit it) */
html[data-theme="dark"] body #offline-storage-area {color: var(--dm-txt);}
html[data-theme="dark"] body table#content-header th,
html[data-theme="dark"] body tbody#offline-content td {color: var(--dm-txt);}
html[data-theme="dark"] body table#content-header th {border-bottom-color: var(--border);}
/* ASCII loading logo: clearly visible instead of near-black */
html[data-theme="dark"] body #offline-content-continue,
html[data-theme="dark"] body #offline-content-continue pre {color: var(--dm-txt-2nd);}
/* action icons (print / print2 / edit / wlan) are #333 -> lighten; the
   deactivated .deact::before stays red via its higher specificity */
html[data-theme="dark"] body tbody#offline-content a.print::before,
html[data-theme="dark"] body tbody#offline-content a.print2::before,
html[data-theme="dark"] body tbody#offline-content a.edit::before,
html[data-theme="dark"] body tbody#offline-content a.wlan::before,
html[data-theme="dark"] body tbody#offline-content a.print2::after {color: var(--dm-txt);}
/* keep the deactivated (red) state — more specific so it wins over the above */
html[data-theme="dark"] body tbody#offline-content a.print.deact::before,
html[data-theme="dark"] body tbody#offline-content a.print2.deact::before,
html[data-theme="dark"] body tbody#offline-content a.print2.deact::after {color: var(--dm-danger-txt);}
/* status messages: keep semantics, lift the dark green for contrast */
html[data-theme="dark"] body div#updatemsg,
html[data-theme="dark"] body div#printupdatemsg,
html[data-theme="dark"] body div#pushupdatemsg,
html[data-theme="dark"] body .status-online {color: var(--st-ok);}
html[data-theme="dark"] body .user-fsgticketing-controller label,
html[data-theme="dark"] body .user-fsgticketing-controller h1,
html[data-theme="dark"] body .user-fsgticketing-controller h2,
html[data-theme="dark"] body #offline-content-edit label {color: var(--dm-txt);}

/* ------------------------------------------------------------------ */
/* jQuery UI (accordions in ASF/ESF/expenses forms, datepicker)         */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] body .ui-widget-content {background: var(--dm-bg-surface); color: var(--dm-txt); border-color: var(--border);}
html[data-theme="dark"] body .ui-widget-header {background: var(--dm-bg-raised); color: var(--dm-txt); border-color: var(--border);}
html[data-theme="dark"] body .ui-state-default,
html[data-theme="dark"] body .ui-widget-content .ui-state-default,
html[data-theme="dark"] body .ui-widget-header .ui-state-default {background: var(--dm-bg-raised); border-color: var(--border);}
html[data-theme="dark"] body .ui-state-hover,
html[data-theme="dark"] body .ui-widget-content .ui-state-hover,
html[data-theme="dark"] body .ui-state-focus,
html[data-theme="dark"] body .ui-widget-content .ui-state-focus {background: var(--dm-bg-hover); border-color: var(--border);}
html[data-theme="dark"] body .ui-state-active,
html[data-theme="dark"] body .ui-widget-content .ui-state-active {background: var(--dm-bg-hover); border-color: var(--border);}

/* DataTables: internal custom properties + sorted-column shading */
html[data-theme="dark"] body table.dataTable {
	--dt-html-background: var(--dm-bg-page);
	--dt-row-hover: 255, 255, 255;
	--dt-row-stripe: 255, 255, 255;
}
html[data-theme="dark"] body table.dataTable.order-column tbody tr > .sorting_1,
html[data-theme="dark"] body table.dataTable.order-column tbody tr > .sorting_2,
html[data-theme="dark"] body table.dataTable tbody tr > .dt-ordering-asc,
html[data-theme="dark"] body table.dataTable tbody tr > .dt-ordering-desc {background-color: rgba(255, 255, 255, 0.04);}

/* ------------------------------------------------------------------ */
/* OT Feedback DB (/fsg/feedback/db): rating cells keep their bright  */
/* semantic bg (yellow/green/red) — the dark remap flipped their text */
/* to light, unreadable on yellow. Mirror light mode: dark text.      */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] body #main-table td.rowNeutral,
html[data-theme="dark"] body #main-table td.rowPositive,
html[data-theme="dark"] body #main-table td.rowNegative {color: #2E2F3E !important;}
