/* Thème sombre (classe .dark sur <html>, activée par défaut — voir includes/head.php) */
.theme-icon-sun { display: none; }
html.dark .theme-icon-sun { display: block; }
html.dark .theme-icon-moon { display: none; }

html.dark { color-scheme: dark; }
html.dark body, html.dark .bg-surface { background-color: #0B0D12; }
html.dark .bg-surface\/60 { background-color: rgba(11,13,18,.6); }

/* Surfaces */
html.dark .bg-white, html.dark .card, html.dark .step-card, html.dark .pay-badge { background-color: #161A22; }
html.dark .bg-white\/90 { background-color: rgba(17,20,27,.9); }
html.dark .bg-white\/95 { background-color: rgba(17,20,27,.95); }
html.dark .bg-white\/70 { background-color: rgba(17,20,27,.7); }
html.dark .bg-gray-50, html.dark .hover\:bg-gray-50:hover, html.dark .table th { background-color: #1C212B; }
html.dark .bg-gray-100, html.dark .hover\:bg-gray-100:hover, html.dark .step-num { background-color: #232936; }
html.dark .bg-gray-200 { background-color: #2D3443; }
html.dark .table tbody tr:hover { background-color: #1A1F28; }
html.dark .card, html.dark .step-card { outline-color: rgba(255,255,255,.07); box-shadow: none; }

/* Textes */
html.dark .text-ink, html.dark .hover\:text-ink:hover, html.dark .text-gray-900 { color: #F3F4F6; }
html.dark .text-ink-soft, html.dark .text-gray-600, html.dark .field > span, html.dark .btn-ghost, html.dark .cal-nav,
html.dark .side-link, html.dark .pay-badge { color: #C7CCD6; }
html.dark .text-ink-muted, html.dark .step-kicker, html.dark .field .hint, html.dark .table th { color: #8D95A5; }
html.dark .side-link:hover { background-color: #232936; color: #F3F4F6; }
html.dark .side-link.is-active { background-color: rgba(227,10,19,.15); color: #FF9DA1; }
html.dark .text-brand-700, html.dark .text-brand-800, html.dark .hover\:text-brand-700:hover, html.dark .step-edit { color: #FF7A80; }
html.dark .text-brand-600 { color: #FF5A61; }
html.dark .text-emerald-700, html.dark .text-emerald-800 { color: #6EE7B7; }
html.dark .text-amber-700, html.dark .text-amber-800, html.dark .text-amber-900 { color: #FCD34D; }
html.dark .text-sky-700, html.dark .text-sky-800 { color: #7DD3FC; }

/* Teintes pastel → teintes sombres */
html.dark .bg-brand-50, html.dark .bg-brand-50\/70, html.dark .bg-brand-50\/60, html.dark .bg-brand-50\/50, html.dark .bg-brand-50\/40,
html.dark .hover\:bg-brand-50:hover { background-color: rgba(227,10,19,.12); }
html.dark .hover\:bg-brand-100:hover { background-color: rgba(227,10,19,.2); }
html.dark .bg-emerald-50, html.dark .step-num.is-done { background-color: rgba(16,185,129,.12); }
html.dark .bg-amber-50 { background-color: rgba(245,158,11,.12); }
html.dark .bg-sky-50 { background-color: rgba(14,165,233,.12); }
html.dark .bg-ink { background-color: #2D3443; }

/* Bordures et anneaux */
html.dark .border-gray-100, html.dark .border-gray-200, html.dark .border-gray-200\/70, html.dark .divide-gray-100 > * + *,
html.dark .table th, html.dark .table td, html.dark .pay-badge { border-color: rgba(255,255,255,.08); }
html.dark .border-gray-300, html.dark .hover\:border-gray-300:hover { border-color: rgba(255,255,255,.16); }
html.dark .ring-gray-200, html.dark .ring-gray-200\/70, html.dark .ring-black\/5, html.dark .ring-brand-100, html.dark .ring-brand-50,
html.dark .ring-amber-100, html.dark .ring-emerald-100, html.dark .ring-sky-100 { --tw-ring-color: rgba(255,255,255,.08); }
html.dark .ring-emerald-200, html.dark .ring-amber-200, html.dark .ring-sky-200, html.dark .ring-brand-200 { --tw-ring-color: rgba(255,255,255,.14); }

/* Formulaires et boutons */
html.dark input:not([type=checkbox]):not([type=radio]):not([type=submit]), html.dark select, html.dark textarea {
    background-color: #11141B; border-color: rgba(255,255,255,.14); color: #F3F4F6; }
html.dark input::placeholder, html.dark textarea::placeholder { color: #6B7280; }
html.dark .btn-secondary { background-color: #1C212B; color: #F3F4F6; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
html.dark .btn-secondary:hover { background-color: #232936; }
html.dark .btn-danger { background-color: #1C212B; color: #FCA5A5; box-shadow: inset 0 0 0 1px rgba(239,68,68,.35); }
html.dark .btn-ghost:hover, html.dark .cal-nav:hover:not(:disabled) { background-color: #232936; }

/* FullCalendar */
html.dark .fc { --fc-border-color: rgba(255,255,255,.08); --fc-today-bg-color: rgba(227,10,19,.12); --fc-page-bg-color: #161A22;
    --fc-neutral-bg-color: #1C212B; --fc-button-bg-color: #1C212B; --fc-button-text-color: #F3F4F6;
    --fc-button-border-color: rgba(255,255,255,.12); --fc-button-hover-bg-color: #232936; --fc-button-hover-border-color: rgba(255,255,255,.12); }
html.dark .fc .fc-col-header-cell-cushion, html.dark .fc .fc-daygrid-day-number { color: #C7CCD6; }
