/* ===============================
   MODE SOMBRE - PropFlow
   Actif quand html[data-theme="dark"]
   =============================== */

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

html[data-theme="dark"] body {
    background: #0f172a;
    color: #e2e8f0;
}

html[data-theme="dark"] .app-container {
    background: #0f172a;
}

html[data-theme="dark"] .content {
    background: transparent;
}

/* Cartes et blocs - ombre légère tout autour (cohérent avec le thème clair) */
html[data-theme="dark"] .card,
html[data-theme="dark"] .enhanced-card,
html[data-theme="dark"] .overview-master-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.2),
        0 12px 28px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .card:hover,
html[data-theme="dark"] .enhanced-card:hover,
html[data-theme="dark"] .overview-master-card:hover {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.25),
        0 20px 40px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .card-title,
html[data-theme="dark"] .card-subtitle,
html[data-theme="dark"] .overview-master-card .card-title {
    color: #f1f5f9;
}

html[data-theme="dark"] .card-subtitle {
    color: #94a3b8;
}

/* Header mobile */
html[data-theme="dark"] .header.mobile-only {
    background: linear-gradient(145deg, #1e293b 0%, #334155 50%, #475569 100%) !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255,255,255,0.06) inset !important;
}

/* Navigation */
html[data-theme="dark"] .nav {
    background: rgba(30, 41, 59, 0.98);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(51, 65, 85, 0.8);
}

html[data-theme="dark"] .nav-tab {
    color: #94a3b8;
}

html[data-theme="dark"] .nav-tab.active {
    color: #a5b4fc;
    background: rgba(102, 126, 234, 0.25);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

/* FAB flottant (mode sombre) */
html[data-theme="dark"] .fab-floating {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #e5e7eb;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.9);
}

html[data-theme="dark"] .fab-floating:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

/* Header PC */
html[data-theme="dark"] .pc-header-modern {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%) !important;
    border-bottom-color: rgba(51, 65, 85, 0.8) !important;
    box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 4px 24px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .pc-brand-text h1 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .pc-brand-tagline {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .pc-nav-item {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .pc-nav-item:hover {
    background: rgba(102, 126, 234, 0.2) !important;
    color: #a5b4fc !important;
}

html[data-theme="dark"] .pc-nav-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
}

html[data-theme="dark"] .pc-settings-modern {
    background: rgba(102, 126, 234, 0.2) !important;
    color: #a5b4fc !important;
}

html[data-theme="dark"] .pc-settings-modern:hover {
    background: rgba(102, 126, 234, 0.3) !important;
}

/* Formulaires et champs */
html[data-theme="dark"] .quick-form-input,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] select.quick-form-input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .quick-form-input::placeholder {
    color: #64748b;
}

/* Boutons */
html[data-theme="dark"] .submit-btn {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
}

html[data-theme="dark"] .submit-btn.reset-btn {
    background: #334155 !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

/* Data cards (Export, Import, etc.) */
html[data-theme="dark"] .data-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .data-card-title {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .data-card-subtitle {
    color: #94a3b8 !important;
}

/* Bouton Paramètres accueil */
html[data-theme="dark"] .home-settings-button {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

html[data-theme="dark"] .home-settings-button:hover {
    background: #334155;
    border-color: #475569;
}

/* Stats - filtres et chiffres */
html[data-theme="dark"] .filter-btn {
    background: #1e293b !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .filter-btn.active {
    background: rgba(102, 126, 234, 0.3) !important;
    color: #a5b4fc !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
}

html[data-theme="dark"] .stats-year-bar,
html[data-theme="dark"] .stats-year-filter {
    color: #e2e8f0;
}

/* Métriques et valeurs */
html[data-theme="dark"] .metric-value,
html[data-theme="dark"] .metric-label,
html[data-theme="dark"] .recent-activity-content,
html[data-theme="dark"] .description-text {
    color: #e2e8f0;
}

html[data-theme="dark"] .metric-label,
html[data-theme="dark"] .summary-content {
    color: #94a3b8;
}

/* Historique */
html[data-theme="dark"] .simple-history-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0;
}

html[data-theme="dark"] .transaction-card,
html[data-theme="dark"] .history-entry {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0;
}

/* Modales */
html[data-theme="dark"] .modal {
    background: rgba(0, 0, 0, 0.85) !important;
}

html[data-theme="dark"] .modal-content {
    background: #1e293b !important;
    border: 1px solid #334155;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .modal-title,
html[data-theme="dark"] .modal-header h3 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .close-btn {
    color: #94a3b8 !important;
    background: transparent !important;
}

html[data-theme="dark"] .close-btn:hover {
    color: #f1f5f9 !important;
    background: #334155 !important;
}

/* Mode toggle container (texte) */
html[data-theme="dark"] .mode-title {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .mode-description {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

/* Header block (page titre) */
html[data-theme="dark"] .header-block.enhanced-card {
    background: #1e293b !important;
    border-color: rgba(102, 126, 234, 0.2) !important;
}

html[data-theme="dark"] .header-block .card-title {
    color: #f1f5f9 !important;
}

/* Nav brand (desktop) */
html[data-theme="dark"] .nav-brand h1 {
    color: #f1f5f9;
}

/* Promo / Deals */
html[data-theme="dark"] .promo-card,
html[data-theme="dark"] .promo-card-new {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0;
}

/* Widget customize - reste transparent */
html[data-theme="dark"] .enhanced-card[data-widget-id="widget-customize"] {
    background: transparent !important;
    border: none !important;
}
