/* ============================================
   SKELLIA DENTAL - DASHBOARD STYLES
   ============================================ */

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

@media (max-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard Content Layout */
.dashboard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
}

@media (max-width: 1200px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }
}

/* Today's Appointments */
.today-appointments {
    margin-bottom: var(--spacing-lg);
}

.appointment-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.appointment-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-inset);
}

.appointment-card:hover {
    background: var(--surface-2);
    border-color: var(--glass-border-strong);
    transform: translateX(5px);
    box-shadow: var(--shadow-sm), var(--shadow-glow-soft);
}

.appointment-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: var(--spacing-sm);
    background: linear-gradient(135deg, rgba(91, 141, 239, 0.15) 0%, rgba(232, 184, 109, 0.08) 100%);
    border: 1px solid rgba(91, 141, 239, 0.12);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-inset);
}

.appointment-hour {
    font-family: var(--font-heading);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--brand-blue-light);
    letter-spacing: -0.2px;
}

.appointment-period {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.appointment-info {
    flex: 1;
    min-width: 0;
}

.appointment-patient {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.appointment-type {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.appointment-status {
    padding: 4px 12px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
}

.appointment-status.confirmed {
    background: var(--success-bg);
    color: var(--success);
}

.appointment-status.pending {
    background: var(--warning-bg);
    color: var(--warning);
}

.appointment-status.in-progress {
    background: var(--info-bg);
    color: var(--info);
}

.appointment-status.completed {
    background: var(--surface-3);
    color: var(--text-secondary);
}

.appointment-status.cancelled {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Chart Container */
.chart-container {
    height: 300px;
    position: relative;
}

/* Quick Stats */
.quick-stats {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.quick-stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--surface-1);
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-md);
}

.quick-stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.quick-stat-icon svg {
    width: 20px;
    height: 20px;
}

.quick-stat-content {
    flex: 1;
}

.quick-stat-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.quick-stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

/* Recent Activity */
.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-muted);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.activity-icon svg {
    width: 16px;
    height: 16px;
    color: var(--brand-blue);
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    margin-bottom: 2px;
}

.activity-text strong {
    font-weight: 600;
}

.activity-time {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

/* Dashboard Welcome */
.welcome-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xl) var(--spacing-2xl);
    background:
        linear-gradient(135deg, rgba(91, 141, 239, 0.12) 0%, rgba(232, 184, 109, 0.06) 100%),
        var(--glass-bg);
    border: 1px solid var(--glass-border-strong);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-md), var(--shadow-inset);
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(91, 141, 239, 0.5) 35%, rgba(232, 184, 109, 0.4) 65%, transparent);
}

.welcome-content h1 {
    font-family: var(--font-heading);
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--brand-blue-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-content p {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
}

.welcome-actions {
    display: flex;
    gap: var(--spacing-md);
}

@media (max-width: 768px) {
    .welcome-section {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-lg);
    }

    .welcome-actions {
        width: 100%;
    }

    .welcome-actions .btn {
        flex: 1;
    }
}

/* Revenue Summary */
.revenue-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.revenue-item {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--surface-2);
    border-radius: var(--radius-md);
}

.revenue-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.revenue-value.income {
    color: var(--success);
}

.revenue-value.expense {
    color: var(--danger);
}

.revenue-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-top: 2px;
}

@media (max-width: 480px) {
    .revenue-summary {
        grid-template-columns: 1fr;
    }
}

/* Upcoming Reminders */
.reminder-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.reminder-card {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--surface-1);
    border-left: 3px solid var(--brand-blue);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.reminder-card.urgent {
    border-left-color: var(--danger);
}

.reminder-card.warning {
    border-left-color: var(--warning);
}

.reminder-content {
    flex: 1;
}

.reminder-title {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.reminder-time {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-top: 2px;
}

.reminder-dismiss {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.reminder-dismiss:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}

/* Day Tabs */
.appointment-day-tabs {
    display: flex;
    gap: var(--spacing-sm);
}

.day-tab {
    padding: var(--spacing-xs) var(--spacing-md);
    background: transparent;
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.day-tab:hover {
    background: var(--surface-2);
    border-color: var(--glass-border-strong);
    color: var(--text-primary);
}

.day-tab.active {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
    border-color: rgba(91, 141, 239, 0.5);
    color: white;
    box-shadow: 0 0 16px rgba(91, 141, 239, 0.35);
    font-weight: 600;
}

.tab-count {
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.day-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.3);
}

/* Appointment Date Groups (for week view) */
.appointment-date-group {
    margin-bottom: var(--spacing-lg);
}

.appointment-date-header {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--brand-gold);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-muted);
    text-transform: capitalize;
}

/* Clickable Appointment Card */
.appointment-card.clickable {
    cursor: pointer;
}

.appointment-card.clickable:hover {
    border-color: var(--brand-blue);
    box-shadow: 0 4px 12px rgba(79, 143, 186, 0.2);
}

/* Appointment Details Popup */
.appointment-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.appointment-popup.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: var(--surface-0);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    margin: var(--spacing-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: popupSlide 0.3s ease;
}

@keyframes popupSlide {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-muted);
}

.popup-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.popup-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.popup-close:hover {
    background: var(--danger);
    color: white;
}

.popup-body {
    padding: var(--spacing-lg);
}

.popup-info-row {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-muted);
}

.popup-info-row:last-child {
    border-bottom: none;
}

.popup-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(79, 143, 186, 0.15) 0%, rgba(201, 169, 98, 0.1) 100%);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.popup-icon svg {
    width: 18px;
    height: 18px;
    color: var(--brand-blue);
}

.popup-info {
    flex: 1;
}

.popup-label {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    margin-bottom: 2px;
}

.popup-value {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    font-weight: 500;
}

.popup-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-muted);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.popup-status-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.popup-status-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    white-space: nowrap;
}

.popup-status-section .form-select {
    flex: 1;
}

.popup-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

@media (max-width: 480px) {
    .appointment-day-tabs {
        flex-wrap: wrap;
    }

    .day-tab {
        flex: 1;
        justify-content: center;
    }

    .popup-content {
        margin: var(--spacing-sm);
    }

    .popup-header,
    .popup-body,
    .popup-footer {
        padding: var(--spacing-md);
    }
}

/* ============================================
   CAROUSEL STYLES
   ============================================ */

.carousel-card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    flex: 1;
}

.carousel-slides {
    display: flex;
    transition: transform 0.3s ease;
}

.carousel-slide {
    min-width: 100%;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.carousel-slide.active {
    display: flex;
}

.carousel-slide .stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.carousel-slide .stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
}

.carousel-slide .stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-md);
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--surface-3);
    cursor: pointer;
    transition: all var(--transition-base);
}

.carousel-dot:hover {
    background: var(--surface-4);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-gold) 100%);
    width: 20px;
    border-radius: var(--radius-full);
}

.carousel-label {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    text-align: center;
    margin-top: var(--spacing-sm);
}

/* Popup Appointments List */
.popup-appointments-list {
    max-height: 400px;
    overflow-y: auto;
}

.popup-appointment-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--surface-1);
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.popup-appointment-item:hover {
    background: var(--surface-2);
    border-color: var(--brand-blue);
    transform: translateX(4px);
}

.popup-apt-time {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--brand-blue);
    min-width: 50px;
}

.popup-apt-info {
    flex: 1;
}

.popup-apt-patient {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.popup-apt-type {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.popup-date-group {
    margin-bottom: var(--spacing-md);
}

.popup-date-header {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--brand-gold);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-muted);
    margin-bottom: var(--spacing-sm);
    text-transform: capitalize;
}

/* Stat icon colors for carousel */
.stat-icon.green {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
}

.stat-icon.green svg {
    color: var(--success);
}

/* Clickable Stat Cards */
.stat-card.clickable {
    cursor: pointer;
    transition: all var(--transition-base);
}

.stat-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.10);
    border-color: #C7D7F8;
}

.stat-card.clickable:active {
    transform: translateY(-2px);
}

/* Preview Modal Styles */
.preview-modal {
    width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-xl);
}

.preview-modal h2 {
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-xl);
}

.preview-search {
    margin-bottom: var(--spacing-lg);
}

.preview-search input {
    width: 100%;
}

.preview-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--surface-2);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.preview-total span {
    color: var(--text-secondary);
}

.preview-total strong {
    font-size: var(--font-size-xl);
}

.preview-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
}

.preview-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--surface-2);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.preview-item:hover {
    background: var(--surface-3);
    transform: translateX(4px);
}

.preview-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.preview-item-info {
    flex: 1;
    min-width: 0;
}

.preview-item-name {
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-item-detail {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.preview-item-action {
    color: var(--text-tertiary);
    font-size: var(--font-size-sm);
}

.preview-item-amount {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.preview-footer {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-muted);
}

@media (max-width: 600px) {
    .preview-modal {
        width: 100%;
        max-width: calc(100vw - 32px);
    }
}

/* ============================================
   LIGHT THEME — Dashboard Overrides (Medical Clean)
   Palette : #F8FAFC fond | #FFFFFF cards | #2563EB bleu | #14B8A6 teal
   ZÉRO dégradé — couleurs plates et propres
   ============================================ */

/* Welcome section : blanc pur, bordé proprement, radius 12px === */
.light-theme .welcome-section {
    background: #FFFFFF;
    border: 1px solid #E8EDF5;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    padding: 24px 28px;
}

.light-theme .welcome-content h1 {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: #0F172A;
    color: #0F172A;
}

/* Supprimer la ligne décorative du haut */
.light-theme .welcome-section::before {
    display: none;
}

/* Horaires des RDV : fond gris très léger */
.light-theme .appointment-time {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
}

.light-theme .appointment-hour {
    color: #2563EB;
}

/* Cards de RDV : blanc, bordures grises nettes */
.light-theme .appointment-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.light-theme .appointment-card:hover {
    background: #FFFFFF;
    border-color: #CBD5E1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transform: translateX(3px);
}

/* Overlay popup : sombre neutre */
.light-theme .appointment-popup {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Popup : blanc pur, ombre neutre */
.light-theme .popup-content {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.16), 0 6px 16px rgba(15, 23, 42, 0.08);
}

/* Day tab actif : bleu uni, pas de dégradé */
.light-theme .day-tab.active {
    background: #2563EB;
    border-color: #2563EB;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.30);
}

/* Quick stat items : fond gris très léger */
.light-theme .quick-stat-item {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
}

/* Reminder cards : blanc, accent bleu à gauche */
.light-theme .reminder-card {
    background: #FFFFFF;
    border-left-color: #2563EB;
}

/* Popup icon : fond gris très clair */
.light-theme .popup-icon {
    background: #F1F5F9;
}

/* ============================================
   PHASE 1 REDESIGN - FIGMA-INSPIRED DASHBOARD
   Scope: dashboard visual styling only.
   ============================================ */

body.light-theme .dashboard-page {
    max-width: 1480px;
    margin: 0 auto;
}

body.light-theme .welcome-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    padding: 22px 24px;
    background: #FFFFFF;
    border: 1px solid #E7EAF3;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

body.light-theme .welcome-section::before {
    display: none;
}

body.light-theme .welcome-content h1 {
    margin-bottom: 6px;
    color: #1F2937;
    background: none;
    background-clip: unset;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #1F2937;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

body.light-theme .welcome-content p {
    color: #667085;
    font-size: 14px;
}

body.light-theme .welcome-content strong {
    color: var(--brand-blue);
    font-weight: 700;
}

body.light-theme .welcome-actions {
    gap: 10px;
}

body.light-theme .dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

body.light-theme .dashboard-grid > .stat-card {
    min-height: 132px;
    padding: 18px;
    border: 0;
    border-radius: 14px;
    color: #FFFFFF;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.10);
}

body.light-theme .dashboard-grid > .stat-card:nth-child(1) {
    background: linear-gradient(135deg, #7367F0 0%, #5E50E6 100%);
}

body.light-theme .dashboard-grid > .stat-card:nth-child(2) {
    background: linear-gradient(135deg, #FF9F43 0%, #F27D1E 100%);
}

body.light-theme .dashboard-grid > .stat-card:nth-child(3) {
    background: linear-gradient(135deg, #28C76F 0%, #16A85A 100%);
}

body.light-theme .dashboard-grid > .stat-card:nth-child(4) {
    background: linear-gradient(135deg, #EA5455 0%, #D43B3C 100%);
}

body.light-theme .dashboard-grid > .stat-card:hover {
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.14);
    transform: translateY(-2px);
}

body.light-theme .dashboard-grid > .stat-card .stat-icon,
body.light-theme .dashboard-grid > .stat-card .stat-icon.blue,
body.light-theme .dashboard-grid > .stat-card .stat-icon.gold,
body.light-theme .dashboard-grid > .stat-card .stat-icon.green,
body.light-theme .dashboard-grid > .stat-card .stat-icon.red {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
}

body.light-theme .dashboard-grid > .stat-card .stat-icon svg {
    color: #FFFFFF;
}

body.light-theme .dashboard-grid > .stat-card .stat-value,
body.light-theme .dashboard-grid > .stat-card .stat-label,
body.light-theme .dashboard-grid > .stat-card .carousel-slide .stat-value,
body.light-theme .dashboard-grid > .stat-card .carousel-slide .stat-label,
body.light-theme .dashboard-grid > .stat-card .carousel-label {
    color: #FFFFFF;
}

body.light-theme .dashboard-grid > .stat-card .stat-label,
body.light-theme .dashboard-grid > .stat-card .carousel-label {
    opacity: 0.82;
}

body.light-theme .dashboard-grid > .stat-card .carousel-dot {
    background: rgba(255, 255, 255, 0.35);
}

body.light-theme .dashboard-grid > .stat-card .carousel-dot.active {
    background: #FFFFFF;
}

body.light-theme .dashboard-content {
    grid-template-columns: minmax(0, 1.72fr) minmax(330px, 0.82fr);
    gap: 22px;
}

body.light-theme .dashboard-left,
body.light-theme .dashboard-right {
    min-width: 0;
}

body.light-theme .today-appointments {
    margin-bottom: 22px;
}

body.light-theme .appointment-day-tabs {
    gap: 8px;
}

body.light-theme .day-tab {
    min-height: 32px;
    padding: 0 12px;
    background: #F8FAFC;
    border: 1px solid #E7EAF3;
    border-radius: 999px;
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}

body.light-theme .day-tab:hover {
    background: #F3F1FF;
    border-color: rgba(115, 103, 240, 0.26);
    color: var(--brand-blue);
}

body.light-theme .day-tab.active {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: #FFFFFF;
    box-shadow: 0 8px 18px rgba(115, 103, 240, 0.22);
}

body.light-theme .tab-count {
    background: rgba(255, 255, 255, 0.22);
    color: inherit;
}

body.light-theme .appointment-list {
    gap: 10px;
}

body.light-theme .appointment-card {
    min-height: 72px;
    padding: 12px;
    background: #FFFFFF;
    border: 1px solid #E7EAF3;
    border-radius: 12px;
    box-shadow: none;
}

body.light-theme .appointment-card:hover {
    background: #FAFBFE;
    border-color: #D9DEEA;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
    transform: translateX(2px);
}

body.light-theme .appointment-time {
    min-width: 68px;
    padding: 8px 10px;
    background: #F3F1FF;
    border: 1px solid rgba(115, 103, 240, 0.15);
    border-radius: 10px;
    box-shadow: none;
}

body.light-theme .appointment-hour {
    color: var(--brand-blue);
    font-size: 15px;
    font-weight: 800;
}

body.light-theme .appointment-period {
    color: #98A2B3;
    letter-spacing: 0.08em;
}

body.light-theme .appointment-patient {
    color: #1F2937;
    font-size: 14px;
    font-weight: 700;
}

body.light-theme .appointment-type {
    color: #667085;
}

body.light-theme .appointment-status {
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

body.light-theme .appointment-status.confirmed {
    background: var(--success-bg);
    color: #1F9D5B;
}

body.light-theme .appointment-status.pending {
    background: var(--brand-gold-subtle);
    color: #B76A16;
}

body.light-theme .appointment-status.in-progress {
    background: var(--brand-blue-subtle);
    color: var(--brand-blue);
}

body.light-theme .appointment-status.completed {
    background: #F1F4FA;
    color: #667085;
}

body.light-theme .appointment-status.cancelled {
    background: var(--danger-bg);
    color: #C83D3E;
}

body.light-theme .activity-list {
    gap: 0;
}

body.light-theme .activity-item {
    padding: 14px 0;
    border-bottom: 1px solid #EEF1F7;
}

body.light-theme .activity-icon {
    width: 38px;
    height: 38px;
    background: #F3F1FF;
    border-radius: 10px;
}

body.light-theme .activity-icon svg {
    color: var(--brand-blue);
}

body.light-theme .activity-text {
    color: #1F2937;
    font-size: 13px;
}

body.light-theme .activity-time {
    color: #98A2B3;
}

body.light-theme .revenue-summary {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 0;
}

body.light-theme .revenue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    background: #FAFBFE;
    border: 1px solid #E7EAF3;
    border-radius: 12px;
    text-align: left;
}

body.light-theme .revenue-value {
    color: #1F2937;
    font-size: 18px;
    font-weight: 800;
}

body.light-theme .revenue-value.income {
    color: #1F9D5B;
}

body.light-theme .revenue-value.expense {
    color: #C83D3E;
}

body.light-theme .revenue-label {
    margin-top: 0;
    color: #667085;
    font-size: 12px;
    font-weight: 600;
}

body.light-theme .stock-alerts-card .card-body {
    padding-top: 14px;
}

body.light-theme .quick-stat-item,
body.light-theme .reminder-card,
body.light-theme .popup-appointment-item,
body.light-theme .preview-item {
    background: #FAFBFE;
    border: 1px solid #E7EAF3;
    border-radius: 12px;
}

body.light-theme .quick-stat-item:hover,
body.light-theme .popup-appointment-item:hover,
body.light-theme .preview-item:hover {
    background: #F8FAFC;
    border-color: #D9DEEA;
}

body.light-theme .preview-item-avatar {
    background: linear-gradient(135deg, #7367F0 0%, #00CFE8 100%);
}

body.light-theme .appointment-popup {
    background: rgba(17, 24, 39, 0.48);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

body.light-theme .popup-content {
    background: #FFFFFF;
    border: 1px solid #E7EAF3;
    border-radius: 14px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

body.light-theme .popup-icon {
    background: #F3F1FF;
}

body.light-theme .popup-icon svg {
    color: var(--brand-blue);
}

body.light-theme .popup-date-header,
body.light-theme .appointment-date-header {
    color: var(--brand-blue);
}

@media (max-width: 1400px) {
    body.light-theme .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    body.light-theme .dashboard-content {
        grid-template-columns: 1fr;
    }

    body.light-theme .revenue-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    body.light-theme .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    body.light-theme .welcome-section {
        align-items: stretch;
        padding: 18px;
    }

    body.light-theme .welcome-content h1 {
        font-size: 21px;
    }

    body.light-theme .welcome-actions {
        flex-direction: column;
    }

    body.light-theme .welcome-actions .btn {
        width: 100%;
    }

    body.light-theme .dashboard-page .card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    body.light-theme .appointment-day-tabs {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    body.light-theme .day-tab {
        flex: 0 0 auto;
    }

    body.light-theme .revenue-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body.light-theme .appointment-card {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    body.light-theme .appointment-status {
        margin-left: 80px;
    }
}

.light-theme .popup-icon svg {
    color: #2563EB;
}

.light-theme .appointment-date-header {
    color: #2563EB;
    font-weight: 600;
}

.light-theme .appointment-card.clickable:hover {
    border-color: #CBD5E1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* Revenue items : fond blanc, bordure grise */
.light-theme .revenue-item {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
}

/* Stat icons : couleurs de fond plates (teal pour la santé) */
.light-theme .stat-icon.blue {
    background: #EFF6FF;
    color: #2563EB;
}

.light-theme .stat-icon.green {
    background: #F0FDFA;
    color: #14B8A6;
}

.light-theme .stat-icon.gold {
    background: #FFFBEB;
    color: #D97706;
}

.light-theme .stat-icon.red {
    background: #FEF2F2;
    color: #EF4444;
}

/* Preview items : fond gris neutre */
.light-theme .preview-item {
    background: #F8FAFC;
}

.light-theme .preview-item:hover {
    background: #F1F5F9;
}

/* Anciens overrides supprimés — remplacés par Medical Clean ci-dessus */
