/* THRS Dashboard — Midnight Sapphire / Champagne Gold (dark only).
   Cosmetic release: no layout, sizing, data, auth, or interaction changes.
   Exclusive to dark dashboard plus the shared dark navigation shell. */
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard {
  --lux-dark-canvas: #071725;
  --lux-dark-ink: #f1f6ff;
  --lux-dark-muted: #bfcedf;
  --lux-dark-muted-soft: #aebfd3;
  --lux-dark-gold: #efd28a;
  --lux-dark-stroke: rgba(180, 208, 237, .19);
  --lux-dark-card-shadow: 0 16px 46px rgba(0, 8, 19, .21), inset 0 1px 0 rgba(239, 247, 255, .065);
  --v6-bg: #0a1e31;
  --v6-paper: #112b42;
  --v6-paper-2: #17334b;
  --v6-ink: var(--lux-dark-ink);
  --v6-muted: var(--lux-dark-muted);
  --v6-line: var(--lux-dark-stroke);
  --v7-paper: #11283b;
  --v7-paper-strong: #19344a;
  --v7-ink: var(--lux-dark-ink);
  --v7-muted: var(--lux-dark-muted);
  --v7-line: var(--lux-dark-stroke);
  --main-db-bg: #091b2e;
  --main-db-panel: #152f47;
  --main-db-panel-soft: #19374f;
  --main-db-text: var(--lux-dark-ink);
  --main-db-muted: var(--lux-dark-muted);
  --lux21-panel: #132b42;
  --lux21-panel-soft: #18374d;
  --lux21-text: var(--lux-dark-ink);
  --lux21-muted: var(--lux-dark-muted);
  --p3-ink: var(--lux-dark-ink);
  --p3-muted: var(--lux-dark-muted);
  --p3-border: var(--lux-dark-stroke);
  --p3-readable-gold: var(--lux-dark-gold);
  color: var(--lux-dark-ink);
  background:
    radial-gradient(ellipse at 84% 1%, rgba(205, 161, 78, .125), transparent 29%),
    radial-gradient(ellipse at 12% 15%, rgba(55, 112, 173, .15), transparent 29%),
    linear-gradient(180deg, #0b1d30 0%, #081a2b 40%, #071522 100%) !important;
}

/* Header & navigation: visibly separate the chrome without moving controls. */
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-header {
  background: rgba(9, 26, 45, .965) !important;
  border-bottom-color: rgba(198, 169, 101, .23) !important;
  box-shadow: 0 8px 30px rgba(0, 7, 18, .24) !important;
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-sidebar {
  background:
    radial-gradient(ellipse at 78% 0%, rgba(199, 159, 82, .13), transparent 33%),
    linear-gradient(180deg, #0d2b48 0%, #0a2340 52%, #07182c 100%) !important;
  border-color: rgba(201, 169, 98, .21) !important;
  box-shadow: 12px 0 38px rgba(0, 8, 21, .16);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-sidebar-section-label {
  color: #bfcee0 !important;
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-sidebar-link {
  color: #d8e3f1;
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-sidebar-link.sidebar-active-link {
  background: linear-gradient(100deg, rgba(226, 188, 103, .19), rgba(66, 106, 151, .13)) !important;
  border-color: rgba(234, 194, 110, .55) !important;
  box-shadow: inset 0 1px 0 rgba(255, 249, 224, .12), 0 7px 23px rgba(0, 8, 21, .17);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-sidebar-footer-summary small {
  color: #c4d1df;
}

/* Headline and toolbar: white primary, readable secondary, warm accents. */
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__page-heading h1 {
  color: var(--lux-dark-ink);
  text-shadow: 0 3px 28px rgba(30, 84, 134, .13);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard :is(
  .thrs-main-dashboard__page-heading > p:last-child,
  .thrs-main-dashboard__v7-briefing-copy > p,
  .thrs-main-dashboard__v7-health-copy small,
  .thrs-main-dashboard__v7-1-source small,
  .thrs-main-dashboard__v7-1-coverage span,
  .thrs-main-dashboard__v7-1-coverage small
) {
  color: var(--lux-dark-muted);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard :is(
  .thrs-main-dashboard__date,
  .thrs-main-dashboard__v7-briefing-copy > span,
  .thrs-main-dashboard__v6-section-intro > div:first-child > span,
  .thrs-main-dashboard__v6-decision-heading > span
) {
  color: var(--lux-dark-gold);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__customize {
  color: #e6f0fc !important;
  background: rgba(23, 52, 77, .94) !important;
  border-color: rgba(192, 214, 235, .21) !important;
  box-shadow: inset 0 1px 0 rgba(239, 247, 255, .07), 0 8px 22px rgba(0, 10, 24, .12);
}

/* Attendance date and source strip: prominent glass rather than near-black. */
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v7-1-datebar {
  background: linear-gradient(125deg, rgba(20, 46, 69, .98), rgba(15, 36, 56, .97)) !important;
  border-color: var(--lux-dark-stroke) !important;
  box-shadow: var(--lux-dark-card-shadow);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard :is(
  .thrs-main-dashboard__v7-1-date-nav label,
  .thrs-main-dashboard__v7-1-date-nav > button,
  .thrs-main-dashboard__v7-1-presets button,
  .thrs-main-dashboard__v7-range-switch,
  .thrs-main-dashboard__v7-focus-nav
) {
  color: #e4effc;
  background-color: rgba(219, 233, 247, .055);
  border-color: rgba(195, 216, 237, .18);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v7-1-presets button.is-active {
  color: #f4daa0;
  background: rgba(218, 169, 72, .19) !important;
  border-color: rgba(228, 186, 99, .43);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v7-1-no-data {
  background: linear-gradient(110deg, rgba(117, 51, 56, .23), rgba(23, 46, 61, .96)) !important;
  border-color: rgba(237, 133, 117, .29);
  box-shadow: inset 0 1px 0 rgba(247, 201, 189, .045);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v7-1-no-data small {
  color: #c6d5e7;
}

/* Executive command, the primary visual focal point. */
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v6-command-deck {
  background: linear-gradient(118deg, #113b5b 0%, #0e2b47 50%, #0a1d31 100%) !important;
  border-color: rgba(228, 185, 99, .31) !important;
  box-shadow: 0 19px 56px rgba(0, 7, 21, .27), inset 0 1px 0 rgba(248, 223, 173, .08);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v6-command-main {
  background:
    radial-gradient(ellipse at 78% 43%, rgba(207, 168, 91, .20), transparent 33%),
    linear-gradient(115deg, #154668 0%, #103452 48%, #09213b 100%) !important;
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v3-attention {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(219, 103, 90, .14), transparent 47%),
    linear-gradient(150deg, #122c43 0%, #0d243a 100%) !important;
  border-color: rgba(204, 165, 101, .17);
}

/* KPI signal deck: lift the backing sheet, preserve status colors and numbers. */
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v6-signal-deck {
  background: linear-gradient(125deg, #142e45, #10283e) !important;
  border-color: var(--lux-dark-stroke);
  box-shadow: var(--lux-dark-card-shadow);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v6-critical-signal {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(220, 105, 92, .18), transparent 48%),
    linear-gradient(128deg, #1a344a, #132a40) !important;
  border-color: rgba(229, 126, 109, .29);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v6-signal-rail .thrs-main-dashboard__stat-card {
  border-color: rgba(184, 208, 235, .115) !important;
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard :is(
  .thrs-main-dashboard__stat-title,
  .thrs-main-dashboard__stat-subtitle,
  .thrs-main-dashboard__v6-critical-value span
) {
  color: var(--lux-dark-muted);
}

/* Analytics: distinct elevation from page, gentle inner separation. */
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v6-intelligence {
  background: linear-gradient(140deg, #122d43 0%, #0e2539 63%, #10293c 100%) !important;
  border-color: var(--lux-dark-stroke);
  box-shadow: var(--lux-dark-card-shadow);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v6-section-intro {
  border-bottom-color: rgba(184, 209, 234, .18);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v6-intelligence-canvas > .thrs-main-dashboard__panel + .thrs-main-dashboard__panel {
  border-inline-start-color: rgba(185, 212, 239, .19) !important;
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard :is(
  .thrs-main-dashboard__panel-header h2,
  .thrs-main-dashboard__v6-section-intro h2,
  .thrs-main-dashboard__department-row strong
) {
  color: #eef5ff;
}

/* Decisions: clear hierarchy and readable helper copy. */
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v6-decision-console {
  background:
    radial-gradient(ellipse at 95% 0%, rgba(215, 172, 90, .15), transparent 34%),
    linear-gradient(120deg, #10324c 0%, #0e293f 53%, #0b2238 100%) !important;
  border-color: rgba(191, 215, 240, .17) !important;
  box-shadow: var(--lux-dark-card-shadow);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard :is(
  .thrs-main-dashboard__v6-decision-heading p,
  .thrs-main-dashboard__v6-decision-summary small
) {
  color: #c6d4e6;
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v6-decision-console :is(
  .thrs-main-dashboard__approval-item,
  .thrs-main-dashboard__quick-action
) {
  background: rgba(222, 236, 249, .085) !important;
  border-color: rgba(204, 223, 240, .14) !important;
  box-shadow: inset 0 1px 0 rgba(245, 249, 255, .045);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v6-decision-console :is(
  .thrs-main-dashboard__approval-copy small,
  .thrs-main-dashboard__quick-copy small,
  .thrs-integration-widget__subtitle
) {
  color: #c0d0e2 !important;
}

/* Business intelligence: confident sapphire surface, legible external status. */
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v6-business-pulse {
  background: linear-gradient(140deg, #112b42 0%, #10263a 65%, #102c40 100%) !important;
  border-color: rgba(194, 216, 238, .2);
  box-shadow: var(--lux-dark-card-shadow);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v6-business-grid .thrs-integration-widget__badge {
  color: #f1d792 !important;
  background: rgba(216, 168, 74, .13) !important;
  border-color: rgba(224, 183, 99, .32) !important;
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-main-dashboard__v6-business-grid :is(
  .thrs-integration-widget__subtitle,
  .thrs-integration-widget__metric-label,
  .thrs-integration-widget__satisfaction-list
) {
  color: #bfd0e2 !important;
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-integration-widget__unavailable {
  background: linear-gradient(140deg, #1b3651, #172f47) !important;
  border-color: rgba(182, 211, 237, .21) !important;
  color: #e8f2fd !important;
  box-shadow: inset 0 1px 0 rgba(244, 249, 255, .04);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard :is(
  .thrs-main-dashboard__v7-range-switch button,
  .thrs-main-dashboard__v7-focus-button,
  .thrs-main-dashboard__v7-selection-chip
):not(.is-active) {
  color: #c2d1e3;
}

/* Error-state CTA: distinguish the retry action without changing its handler. */
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-integration-widget__unavailable > button {
  color: #f8fbff !important;
  background: linear-gradient(140deg, #235e93, #1b4b7a) !important;
  box-shadow: 0 6px 18px rgba(4, 15, 34, .24), inset 0 1px 0 rgba(255, 255, 255, .11);
}
:is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard .thrs-integration-widget__unavailable > button:focus-visible {
  outline: 2px solid #efd28a !important;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  :is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard :is(
    .thrs-main-dashboard__v6-command-deck,
    .thrs-main-dashboard__v6-intelligence,
    .thrs-main-dashboard__v6-decision-console,
    .thrs-main-dashboard__v6-business-pulse
  ) { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  :is(html[data-theme="dark"], .dark, body.dark-mode) .thrs-shell .thrs-main-dashboard :is(
    button, a, input, select
  ):focus-visible { outline: 2px solid Highlight !important; }
}
