/* --------------------------------------------------------------------------
   THEME DARK DECLARE EN AMONT
   Bloc transverse conserve ici pour la securite de la cascade.
   -------------------------------------------------------------------------- */

:root[data-theme="dark"] {
  color-scheme: dark;
  --text-primary: #edf3fb;
  --text-secondary: #b4c2d5;
  --text-muted: #8e9fb4;
  --color-ink: #edf3fb;
  --color-muted: #9cadc1;
  --color-soft: #72859a;
  --color-surface: #17212c;
  --color-day: #edf3fb;
  --color-service: #edf3fb;
  --color-time: #d1deed;
  --color-duration: #8fcb8f;
  --bg-body: #0d141c;
  --bg-card: #17212c;
  --card-border: #26384a;
  --card-shadow: 0 14px 30px rgba(0, 0, 0, 0.34);
  --border-color: #2b3d50;
  --input-bg: #101922;
  --surface-page: #0d141c;
  --surface-card: #17212c;
  --surface-subtle: #111a23;
  --surface-input: #101922;
  --border-subtle: #26384a;
  --border-default: #2b3d50;
  --border-strong: #385168;
  --shadow-1: 0 14px 30px rgba(0, 0, 0, 0.34);
  --shadow-2: 0 24px 46px rgba(0, 0, 0, 0.42);
  --state-active-bg: rgba(35, 134, 200, 0.2);
  --state-active-text: #7dc5ff;
  --state-active-border: rgba(84, 171, 235, 0.5);
  --state-focus-ring: rgba(84, 171, 235, 0.34);
  --state-disabled-bg: #202c38;
  --state-disabled-text: #71859a;
  --toggle-track-border: #3a4f65;
  --toggle-track-bg: linear-gradient(180deg, rgba(28, 39, 52, 0.98) 0%, rgba(21, 30, 40, 0.96) 100%);
  --toggle-track-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 2px 6px rgba(0, 0, 0, 0.22);
  --toggle-knob-bg: linear-gradient(180deg, #f5f8fc 0%, #dce7f5 100%);
  --toggle-knob-shadow:
    0 2px 6px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
  --menu-section-separator: rgba(180, 194, 213, 0.14);
  --menu-panel-bg: #111a23;
  --menu-item-hover-bg: rgba(180, 194, 213, 0.08);
  --menu-item-active-bg: rgba(35, 134, 200, 0.18);
  --menu-item-active-border: rgba(84, 171, 235, 0.24);
  --menu-focus-ring: rgba(84, 171, 235, 0.26);
  --menu-close-hover-bg: rgba(180, 194, 213, 0.1);
  --menu-close-active-bg: rgba(180, 194, 213, 0.16);
  --settings-hub-toggle-color: var(--text-primary);
  --settings-hub-toggle-subtext-color: var(--text-secondary);
  --menu-icon-passive: #b4c2d5;
  --menu-footer-color: #8ea0b4;
  --menu-title-color: #edf3fb;
  --menu-close-color: #b4c2d5;
}

:root[data-theme="dark"] .day-header-day {
  color: #edf3fb;
  text-shadow: none;
}

:root[data-theme="dark"] .day-header-month {
  color: #7dc5ff;
  text-shadow: none;
}

:root[data-theme="dark"] .day-header-year {
  color: #a8bad1;
  text-shadow: none;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  :root[data-theme="dark"] .day-header-day {
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    color: #edf3fb;
    -webkit-text-fill-color: currentColor;
  }

  :root[data-theme="dark"] .day-header-month {
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    color: #7dc5ff;
    -webkit-text-fill-color: currentColor;
  }

  :root[data-theme="dark"] .day-header-year {
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    color: #a8bad1;
    -webkit-text-fill-color: currentColor;
  }
}

:root[data-theme="dark"] .home-service-edit-btn {
  color: #c9d7e6;
  text-decoration-color: rgba(201, 215, 230, 0.34);
}

@media (hover: hover) {
  :root[data-theme="dark"] .home-service-edit-btn:hover {
    color: #edf3fb;
    text-decoration-color: currentColor;
  }
}

:root[data-theme="dark"] #view-home .day-header-service.home-service-title,
:root[data-theme="dark"] .day-header-service.repos,
:root[data-theme="dark"] .day-header-service.conges,
:root[data-theme="dark"] .day-header-time {
  color: var(--text-primary);
}

:root[data-theme="dark"] #side-menu {
  background: var(--menu-panel-bg);
  border-right-color: rgba(180, 194, 213, 0.12);
  box-shadow: 14px 0 32px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] #side-menu::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
}

:root[data-theme="dark"] #view-consult-date .consult-date-view .settings-card input[type="date"] {
  color-scheme: light;
  color: #111111;
  -webkit-text-fill-color: #111111;
}

:root[data-theme="dark"] #view-consult-date .consult-date-view .settings-card label {
  color: #c9d7e6;
}

:root[data-theme="dark"] #view-consult-date .consult-date-view .settings-subtitle {
  color: var(--text-secondary);
}

:root[data-theme="dark"] #view-suggestions .suggestions-view .settings-subtitle {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .summary-view .settings-date-field input[type="date"],
:root[data-theme="dark"] .summary-view .settings-date-field input[type="month"] {
  color-scheme: light;
  color: #111111;
  -webkit-text-fill-color: #111111;
}

:root[data-theme="dark"] #view-conges .settings-period .settings-date-field input[type="date"] {
  color-scheme: light;
  color: #111111;
  -webkit-text-fill-color: #111111;
}

:root[data-theme="dark"] #view-conges .settings-period {
  border-color: rgba(180, 194, 213, 0.16);
  background: linear-gradient(180deg, rgba(28, 39, 52, 0.98) 0%, rgba(22, 32, 43, 0.96) 100%);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] #view-conges .settings-period-title {
  color: #c9d7e6;
}

:root[data-theme="dark"] #view-conges .settings-period-title::after {
  background: rgba(180, 194, 213, 0.18);
}

:root[data-theme="dark"] #view-conges .settings-card label {
  color: #c9d7e6;
}

:root[data-theme="dark"] #view-conges .conges-balance-title {
  color: #edf3fb;
}

:root[data-theme="dark"] #view-conges .conges-balance-row {
  color: #c9d7e6;
}

:root[data-theme="dark"] #view-conges .conges-balance-row strong {
  color: #edf3fb;
}

:root[data-theme="dark"] #view-conges .conges-balance-row--remaining {
  border-top-color: rgba(180, 194, 213, 0.16);
}

:root[data-theme="dark"] #view-season .settings-date-field input[type="date"] {
  color-scheme: light;
  color: #111111;
  -webkit-text-fill-color: #111111;
}

:root[data-theme="dark"] #view-season .settings-card label {
  color: #c9d7e6;
}

:root[data-theme="dark"] .phone-change-view .settings-note {
  color: #c9d7e6;
}

:root[data-theme="dark"] .reset-view .settings-card label,
:root[data-theme="dark"] .reset-view .settings-note,
:root[data-theme="dark"] .reset-view .settings-status {
  color: #c9d7e6;
}

:root[data-theme="dark"] .edit-day-view .edit-day-card,
:root[data-theme="dark"] .edit-day-view .edit-day-summary-block,
:root[data-theme="dark"] .edit-day-view .edit-day-disclosure {
  border-color: rgba(180, 194, 213, 0.16);
  background: linear-gradient(180deg, rgba(28, 39, 52, 0.98) 0%, rgba(22, 32, 43, 0.96) 100%);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .edit-day-view .settings-subtitle,
:root[data-theme="dark"] .edit-day-view .edit-day-summary-line-meta,
:root[data-theme="dark"] .edit-day-view .edit-day-disclosure-title,
:root[data-theme="dark"] .edit-day-view .edit-day-disclosure-state,
:root[data-theme="dark"] .edit-day-view .edit-day-section-title,
:root[data-theme="dark"] .edit-day-view .edit-day-label,
:root[data-theme="dark"] .edit-day-view .edit-day-help,
:root[data-theme="dark"] .edit-day-view .settings-note {
  color: #c9d7e6;
}

:root[data-theme="dark"] .edit-day-view .edit-day-summary-line-primary,
:root[data-theme="dark"] .edit-day-view .edit-day-summary-line-meta strong {
  color: #edf3fb;
}

:root[data-theme="dark"] .edit-day-view .edit-day-disclosure-state {
  text-decoration-color: rgba(180, 194, 213, 0.34);
}

:root[data-theme="dark"] .edit-day-view .edit-day-chip {
  color: #b4c2d5;
}

:root[data-theme="dark"] .edit-day-view .settings-card .edit-day-section input.settings-input {
  color-scheme: light;
  color: #111111;
  -webkit-text-fill-color: #111111;
}

:root[data-theme="dark"] .alarm-view .alarm-section {
  border-color: rgba(180, 194, 213, 0.16);
  background: linear-gradient(180deg, rgba(28, 39, 52, 0.98) 0%, rgba(22, 32, 43, 0.96) 100%);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .alarm-view .alarm-section-title,
:root[data-theme="dark"] .alarm-view .alarm-section label,
:root[data-theme="dark"] .alarm-view .settings-note {
  color: #c9d7e6;
}

:root[data-theme="dark"] .alarm-view .alarm-diagnostics-toggle,
:root[data-theme="dark"] .alarm-view .alarm-install-toggle,
:root[data-theme="dark"] .alarm-view .alarm-checks-toggle,
:root[data-theme="dark"] .alarm-view .alarm-settings-toggle {
  color: #b4c2d5;
  text-decoration-color: rgba(180, 194, 213, 0.34);
}

:root[data-theme="dark"] .alarm-view .alarm-section input:not([type="checkbox"]) {
  color-scheme: light;
  color: #111111;
  -webkit-text-fill-color: #111111;
}

:root[data-theme="dark"] .developer-metrics-card {
  border-color: rgba(180, 194, 213, 0.16);
  background: linear-gradient(180deg, rgba(28, 39, 52, 0.98) 0%, rgba(22, 32, 43, 0.96) 100%);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .developer-metrics-card-title,
:root[data-theme="dark"] .developer-metrics-value {
  color: #edf3fb;
}

:root[data-theme="dark"] .developer-metrics-card-subtitle,
:root[data-theme="dark"] .developer-metrics-label,
:root[data-theme="dark"] .developer-metrics-updated-at {
  color: #c9d7e6;
}

:root[data-theme="dark"] .developer-metrics-row,
:root[data-theme="dark"] .developer-metrics-meta {
  border-top-color: rgba(180, 194, 213, 0.14);
}

:root[data-theme="dark"] .developer-metrics-status[data-state="loading"] {
  color: #b4c2d5;
}

:root[data-theme="dark"] .developer-metrics-status[data-state="ok"] {
  color: #8fcb8f;
}

:root[data-theme="dark"] .developer-metrics-status[data-state="error"] {
  color: #ef8b8b;
}

:root[data-theme="dark"] .swaps-page {
  --swaps-label-color: #c9d7e6;
  --swaps-placeholder-color: #8ea0b4;
}

:root[data-theme="dark"] .swaps-card,
:root[data-theme="dark"] .swaps-card.swaps-card-secondary,
:root[data-theme="dark"] .swaps-item,
:root[data-theme="dark"] .swaps-search-panel,
:root[data-theme="dark"] .swaps-transform,
:root[data-theme="dark"] .swaps-offer-proposal {
  border-color: rgba(180, 194, 213, 0.16);
  background: linear-gradient(180deg, rgba(28, 39, 52, 0.98) 0%, rgba(22, 32, 43, 0.96) 100%);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .swaps-card.swaps-card-priority,
:root[data-theme="dark"] .swaps-open-offer-new-since-visit {
  border-color: rgba(84, 171, 235, 0.24);
  background: linear-gradient(180deg, rgba(18, 49, 72, 0.98) 0%, rgba(16, 39, 58, 0.96) 100%);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"] .swaps-create-preview-section + .swaps-create-preview-section,
:root[data-theme="dark"] .swaps-offer-final {
  border-top-color: rgba(180, 194, 213, 0.14);
}

:root[data-theme="dark"] .swaps-dashboard-label,
:root[data-theme="dark"] .swaps-search-panel label,
:root[data-theme="dark"] .swaps-search-feedback,
:root[data-theme="dark"] .swaps-last-activity,
:root[data-theme="dark"] .swaps-offer-key,
:root[data-theme="dark"] .swaps-create-preview-section-title,
:root[data-theme="dark"] .swaps-offer-proposal-title,
:root[data-theme="dark"] .swaps-open-impact-title,
:root[data-theme="dark"] .swaps-open-choices-title,
:root[data-theme="dark"] .swaps-transform-title,
:root[data-theme="dark"] .swaps-transform-date,
:root[data-theme="dark"] .swaps-create-preview-choice-date,
:root[data-theme="dark"] .swaps-open-section-label,
:root[data-theme="dark"] .swaps-open-offer-age,
:root[data-theme="dark"] .swaps-empty,
:root[data-theme="dark"] .swaps-status-line {
  color: #b4c2d5;
}

:root[data-theme="dark"] .swaps-global-status,
:root[data-theme="dark"] .swaps-offer-title,
:root[data-theme="dark"] .swaps-offer-value,
:root[data-theme="dark"] .swaps-transform-before,
:root[data-theme="dark"] .swaps-transform-after,
:root[data-theme="dark"] .swaps-offer-proposal-text,
:root[data-theme="dark"] .swaps-create-preview-single-line,
:root[data-theme="dark"] .swaps-create-preview-choice-line,
:root[data-theme="dark"] .swaps-offer-final {
  color: #edf3fb;
}

:root[data-theme="dark"] .swaps-new-offers-since-visit {
  color: #7dc5ff;
}

:root[data-theme="dark"] .swaps-search-clear,
:root[data-theme="dark"] .swaps-collapsible-back-label,
:root[data-theme="dark"] .swaps-collapsible-icon {
  color: #b4c2d5;
}

:root[data-theme="dark"] .swaps-collapsible-priority-label {
  border-color: rgba(84, 171, 235, 0.22);
  background: rgba(35, 134, 200, 0.18);
  color: #b9ddff;
}

:root[data-theme="dark"] .swaps-collapsible-badge {
  border-color: rgba(180, 194, 213, 0.16);
  background: rgba(180, 194, 213, 0.1);
  color: #c9d7e6;
}

:root[data-theme="dark"] .swaps-collapsible-badge.is-error {
  border-color: rgba(239, 139, 139, 0.24);
  background: rgba(120, 34, 34, 0.22);
  color: #efb4b4;
}

:root[data-theme="dark"] .swaps-offer-final.is-success {
  color: #8fcb8f;
}

:root[data-theme="dark"] .swaps-open-impact-secondary {
  opacity: 1;
}

:root[data-theme="dark"] .exchanges-view .settings-period {
  border-color: rgba(180, 194, 213, 0.16);
  background: linear-gradient(180deg, rgba(28, 39, 52, 0.98) 0%, rgba(22, 32, 43, 0.96) 100%);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .exchanges-view .settings-period-title,
:root[data-theme="dark"] .exchanges-view .settings-note,
:root[data-theme="dark"] .exchanges-view .settings-status {
  color: #c9d7e6;
}

:root[data-theme="dark"] .reset-view .settings-card input[type="month"] {
  color-scheme: light;
  color: #111111;
  -webkit-text-fill-color: #111111;
}

:root[data-theme="dark"] .alarm-notice-body p {
  color: #c9d7e6;
}

:root[data-theme="dark"] .alarm-notice-body strong {
  color: #edf3fb;
}

:root[data-theme="dark"] .legal-text {
  color: #c9d7e6;
  background: linear-gradient(180deg, rgba(23, 33, 44, 0.98) 0%, rgba(17, 26, 35, 0.96) 100%);
  border-color: rgba(180, 194, 213, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  scrollbar-color: rgba(180, 194, 213, 0.28) transparent;
}

:root[data-theme="dark"] .home-weekdays,
:root[data-theme="dark"] .home-weekdays div:last-child {
  color: #ffffff;
}

:root[data-theme="dark"] #view-legal .legal-text::-webkit-scrollbar-thumb {
  background: rgba(180, 194, 213, 0.28);
}

:root[data-theme="dark"] .summary-view .summary-mode-option {
  border-color: rgba(84, 171, 235, 0.22);
  background: linear-gradient(180deg, rgba(23, 33, 44, 0.98) 0%, rgba(17, 26, 35, 0.96) 100%);
  color: #b4c2d5;
}

:root[data-theme="dark"] .summary-view .summary-mode-option.is-active {
  border-color: rgba(79, 96, 118, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 246, 250, 0.96) 100%);
  color: #31475f;
}

:root[data-theme="dark"] .summary-view .summary-mode-option input[type="radio"] {
  border-color: rgba(180, 194, 213, 0.5);
  background: rgba(17, 26, 35, 0.9);
}

:root[data-theme="dark"] .summary-view .summary-mode-option.is-active input[type="radio"] {
  border-color: rgba(35, 134, 200, 0.55);
  background: #ffffff;
}

:root[data-theme="dark"] .summary-view .summary-mode-legend,
:root[data-theme="dark"] .summary-view .settings-card label {
  color: #c9d7e6;
}

:root[data-theme="dark"] #summary-results {
  border-color: rgba(180, 194, 213, 0.14);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] #summary-results .summary-card-title {
  color: #edf3fb;
}

:root[data-theme="dark"] #summary-results .summary-row span {
  color: #c9d7e6;
}

:root[data-theme="dark"] #summary-results .summary-row strong {
  color: #edf3fb;
}

:root[data-theme="dark"] #summary-results .summary-row.summary-total {
  border-top-color: rgba(180, 194, 213, 0.14);
}

:root[data-theme="dark"] #summary-results .summary-row.summary-total span,
:root[data-theme="dark"] #summary-results .summary-row.summary-total strong {
  color: #edf3fb;
}

:root[data-theme="dark"] .tax-real-card-title {
  color: #edf3fb;
}

:root[data-theme="dark"] .tax-real-card-main {
  border-color: rgba(180, 194, 213, 0.14);
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .tax-real-row {
  border-top-color: rgba(180, 194, 213, 0.14);
  color: #c9d7e6;
}

:root[data-theme="dark"] .tax-real-value {
  color: #edf3fb;
}

:root[data-theme="dark"] .tax-real-step-btn {
  color: #b4c2d5;
}

:root[data-theme="dark"] .tax-real-card-projection {
  border-color: rgba(180, 194, 213, 0.14);
  box-shadow:
    0 14px 26px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .tax-real-projection-row {
  color: #c9d7e6;
}

:root[data-theme="dark"] .tax-real-projection-row strong {
  color: #edf3fb;
}

:root[data-theme="dark"] .tax-real-progress-title {
  color: #c9d7e6;
}

:root[data-theme="dark"] #view-guided-month .guided-btn:not(.active):not(.ghost):not(:disabled) {
  color: #31475f;
}

:root[data-theme="dark"] #view-guided-month .guided-cancel-btn {
  border-color: rgba(180, 194, 213, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(243, 246, 250, 0.88) 100%);
  color: #31475f;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

:root[data-theme="dark"] #view-guided-month .guided-cancel-btn:active {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(235, 240, 246, 0.86) 100%);
}
