* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00d4ff;
    --primary-dark: #0099cc;
    --secondary: #ff6b6b;
    --success: #51cf66;
    --warning: #ffd43b;
    --danger: #ff6b6b;
    --dark: #0a0e27;
    --light: #f8f9fa;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 30px 60px rgba(0, 0, 0, 0.15);
    --gradient: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Stars Animation */
.stars, .twinkling {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.stars {
    background: #000 url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000"%3E%3Ccircle fill="white" cx="100" cy="100" r="2"/%3E%3Ccircle fill="white" cx="500" cy="300" r="1.5"/%3E%3Ccircle fill="white" cx="800" cy="700" r="2"/%3E%3Ccircle fill="white" cx="1200" cy="400" r="1"/%3E%3Ccircle fill="white" cx="1500" cy="900" r="2"/%3E%3Ccircle fill="white" cx="1800" cy="500" r="1.5"/%3E%3C/svg%3E') repeat;
    background-size: 200px 200px;
    animation: stars 200s linear infinite;
}

.twinkling {
    background: transparent url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000"%3E%3Ccircle fill="rgba(255,255,255,0.3)" cx="200" cy="200" r="1"/%3E%3Ccircle fill="rgba(255,255,255,0.3)" cx="600" cy="800" r="1.2"/%3E%3Ccircle fill="rgba(255,255,255,0.3)" cx="1000" cy="500" r="0.8"/%3E%3Ccircle fill="rgba(255,255,255,0.3)" cx="1400" cy="1200" r="1"/%3E%3Ccircle fill="rgba(255,255,255,0.3)" cx="1800" cy="300" r="1.1"/%3E%3C/svg%3E') repeat;
    background-size: 300px 300px;
    animation: twinkle 4s ease-in-out infinite;
}

@keyframes stars {
    from { transform: translateY(0px); }
    to { transform: translateY(-2000px); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Container responsive - utilise clamp pour les marges */
.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: clamp(10px, 2vw, 20px) auto;
    background: transparent;
    width: calc(100% - clamp(10px, 4vw, 40px));
}

/* Premium Header */
.premium-header {
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: clamp(15px, 3vw, 30px) clamp(15px, 3vw, 30px) 0 0;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

.header-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.header-content {
    position: relative;
    padding: clamp(20px, 5vw, 40px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(15px, 3vw, 30px);
    z-index: 2;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2vw, 20px);
    flex-wrap: wrap;
    justify-content: center;
}

.logo-animation {
    position: relative;
    width: clamp(50px, 10vw, 70px);
    height: clamp(50px, 10vw, 70px);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 153, 204, 0.2));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(0, 212, 255, 0.3);
}

.jirama-logo {
    width: 60px;
    height: 60px;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.4);
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(0, 212, 255, 0); }
}

.logo-text h1 {
    font-size: clamp(20px, 5vw, 32px);
    color: white;
    margin-bottom: 5px;
    font-weight: 800;
    background: linear-gradient(135deg, #00d4ff, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text h1 span {
    font-weight: 300;
    background: none;
    -webkit-text-fill-color: white;
    color: white;
}

.logo-text p {
    color: rgba(255, 255, 255, 0.8);
    font-size: clamp(10px, 3vw, 14px);
}

.header-stats {
    display: flex;
    gap: clamp(10px, 2vw, 20px);
    flex-wrap: wrap;
    justify-content: center;
}

.header-stat {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 12px);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 20px);
    border-radius: 15px;
    transition: all 0.3s;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.header-stat i {
    font-size: clamp(18px, 4vw, 28px);
    color: #00d4ff;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: clamp(9px, 2.5vw, 11px);
    color: rgba(255, 255, 255, 0.7);
}

.stat-value {
    font-size: clamp(12px, 3.5vw, 18px);
    font-weight: bold;
    color: white;
}

.period-select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: white;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: clamp(11px, 3vw, 14px);
}

.period-select option {
    background: #1e293b;
    color: white;
}

.header-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    line-height: 0;
}

/* Glass Navigation - responsive avec scroll horizontal sur mobile */
.glass-nav {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    padding: 0 clamp(10px, 3vw, 20px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-container {
    display: flex;
    justify-content: center;
    gap: clamp(5px, 1.5vw, 10px);
    max-width: 1200px;
    margin: 0 auto;
    min-width: max-content;
}

.nav-btn {
    position: relative;
    padding: clamp(10px, 3vw, 15px) clamp(12px, 3vw, 25px);
    background: none;
    border: none;
    cursor: pointer;
    font-size: clamp(12px, 3vw, 14px);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s;
    overflow: hidden;
    white-space: nowrap;
}

.nav-btn i {
    margin-right: 8px;
    font-size: clamp(14px, 3.5vw, 16px);
}

.nav-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, #0099cc);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.nav-btn.active {
    color: #00d4ff;
}

.nav-btn.active .nav-indicator {
    transform: scaleX(1);
}

/* Main Content */
.main-content {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    padding: clamp(15px, 4vw, 30px);
}

.tab-content {
    display: none;
    animation: fadeInUp 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stats Grid - responsive */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: clamp(12px, 3vw, 25px);
    margin-bottom: clamp(20px, 4vw, 30px);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: clamp(12px, 3vw, 20px);
    padding: clamp(15px, 4vw, 25px);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 153, 204, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.stat-icon {
    width: clamp(45px, 10vw, 60px);
    height: clamp(45px, 10vw, 60px);
    background: rgba(0, 212, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: clamp(22px, 5vw, 30px);
    color: #00d4ff;
}

.stat-details h3 {
    font-size: clamp(11px, 3vw, 14px);
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.7);
}

.stat-details p {
    font-size: clamp(20px, 6vw, 32px);
    font-weight: bold;
    margin-bottom: 5px;
    color: white;
}

.stat-trend {
    font-size: clamp(10px, 2.5vw, 12px);
    color: rgba(255, 255, 255, 0.5);
}

/* Quick Actions - empilage vertical sur mobile */
.quick-actions {
    display: flex;
    gap: clamp(10px, 2vw, 15px);
    margin-bottom: clamp(20px, 4vw, 30px);
    flex-wrap: wrap;
}

.action-btn {
    padding: clamp(10px, 3vw, 12px) clamp(15px, 4vw, 25px);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: clamp(12px, 3vw, 14px);
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    flex: 1 1 auto;
    justify-content: center;
}

.action-btn.primary { background: linear-gradient(135deg, #00d4ff, #0099cc); color: white; }
.action-btn.secondary { background: linear-gradient(135deg, #51cf66, #40c057); color: white; }
.action-btn.tertiary { background: linear-gradient(135deg, #ff6b6b, #fa5252); color: white; }
.action-btn.info { background: linear-gradient(135deg, #339af0, #228be6); color: white; }
.action-btn.warning { background: linear-gradient(135deg, #ffa94d, #fd7e14); color: white; }

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: clamp(15px, 3vw, 30px);
    margin-bottom: clamp(20px, 4vw, 30px);
}

.chart-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: clamp(15px, 4vw, 20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: all 0.3s;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h3 {
    font-size: clamp(14px, 4vw, 18px);
    color: #00d4ff;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
    color: #00d4ff;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: clamp(15px, 3vw, 30px);
}

.alerts-card, .tips-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: clamp(15px, 4vw, 20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.alerts-card { border-left: 4px solid #ff6b6b; }
.tips-card { border-left: 4px solid #00d4ff; }

.alerts-card p, .tips-card p {
    padding: 10px;
    margin: 5px 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: clamp(12px, 3vw, 14px);
}

.alerts-card p { background: rgba(255, 107, 107, 0.1); }
.tips-card p { background: rgba(0, 212, 255, 0.1); }

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(20px, 5vw, 30px);
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: clamp(18px, 5vw, 24px);
    color: #00d4ff;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn-glow, .btn-outline {
    padding: clamp(8px, 2.5vw, 12px) clamp(16px, 4vw, 24px);
    border-radius: 12px;
    cursor: pointer;
    font-size: clamp(12px, 3vw, 14px);
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-glow {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-glow:hover::before {
    width: 300px;
    height: 300px;
}

.btn-outline {
    background: transparent;
    border: 2px solid #00d4ff;
    color: #00d4ff;
}

.full-width {
    width: 100%;
    justify-content: center;
}

/* Persons & Appliances Grid */
.persons-grid, .appliances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: clamp(15px, 3vw, 25px);
}

.person-card, .appliance-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: clamp(15px, 4vw, 20px);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.person-card::before, .appliance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00d4ff, #0099cc);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.person-card:hover::before, .appliance-card:hover::before {
    transform: scaleX(1);
}

.person-card h3, .appliance-card h3 {
    color: #00d4ff;
    margin-bottom: 12px;
    font-size: clamp(16px, 4vw, 20px);
}

.person-card p, .appliance-card p {
    color: rgba(255, 255, 255, 0.7);
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(12px, 3vw, 14px);
}

.card-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: clamp(11px, 2.5vw, 13px);
    flex: 1;
}

.btn-icon.edit { color: #51cf66; border: 1px solid #51cf66; }
.btn-icon.delete { color: #ff6b6b; border: 1px solid #ff6b6b; }

/* Billing */
.billing-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.total-card {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: white;
    padding: clamp(20px, 5vw, 30px);
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: clamp(15px, 4vw, 20px);
    flex: 1;
    min-width: 200px;
}

.total-icon {
    width: clamp(50px, 10vw, 70px);
    height: clamp(50px, 10vw, 70px);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.total-icon i { font-size: clamp(25px, 6vw, 35px); }

.total-details h3 { font-size: clamp(12px, 3.5vw, 16px); margin-bottom: 5px; opacity: 0.9; }
.total-details p { font-size: clamp(24px, 8vw, 42px); font-weight: bold; }
.period-badge { font-size: clamp(10px, 2.5vw, 12px); background: rgba(255,255,255,0.2); padding: 5px 12px; border-radius: 20px; }

.bill-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.billing-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.billing-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    min-width: 500px;
}

.billing-table th, .billing-table td {
    padding: clamp(10px, 3vw, 15px);
    text-align: left;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    color: white;
    font-size: clamp(11px, 3vw, 14px);
}

.billing-table th { background: rgba(0, 212, 255, 0.2); color: #00d4ff; }

.paid-badge, .unpaid-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: clamp(10px, 2.5vw, 12px);
    display: inline-block;
}
.paid-badge { background: #51cf66; color: white; }
.unpaid-badge { background: #ff6b6b; color: white; }

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: clamp(15px, 3vw, 25px);
    margin-bottom: 30px;
}

.settings-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: clamp(15px, 4vw, 25px);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.form-group { margin-bottom: 20px; }
.form-group label { font-size: clamp(12px, 3vw, 14px); margin-bottom: 8px; display: block; color: rgba(255, 255, 255, 0.8); }
.form-group small { font-size: clamp(10px, 2.5vw, 12px); display: block; margin-top: 5px; color: rgba(255,255,255,0.5); }

.premium-input, .premium-select {
    width: 100%;
    padding: clamp(10px, 3vw, 12px);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    font-size: clamp(12px, 3vw, 14px);
    color: white;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-container input { flex: 1; background: rgba(0, 212, 255, 0.1); }
.slider-container span { min-width: 50px; font-weight: bold; color: #00d4ff; }

.settings-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* History Timeline */
.history-timeline { position: relative; padding: 20px 0; }

.history-item {
    padding: clamp(12px, 3vw, 20px);
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid #00d4ff;
    border-radius: 12px;
    transition: all 0.3s;
}

.history-item p { margin: 5px 0; color: white; font-size: clamp(11px, 3vw, 13px); }

/* Modal */
/* ============================================================ */
/* MODALS — NOUVEAU STYLE SPECTACULAIRE                        */
/* ============================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    inset: 0;
    background: rgba(0, 0, 10, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: modal-bg-in .3s ease forwards;
    overflow-y: auto;
    padding: 20px;
}
@keyframes modal-bg-in {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to   { opacity: 1; backdrop-filter: blur(10px); }
}

.modal-content {
    background: linear-gradient(145deg, #0d1635 0%, #131c3e 60%, #0a1228 100%);
    margin: 0 auto;
    border-radius: 26px;
    width: 100%;
    max-width: 560px;
    position: relative;
    animation: modal-card-in .38s cubic-bezier(.34,1.2,.64,1) forwards;
    border: 1px solid rgba(0,212,255,0.35);
    box-shadow: 0 0 0 1px rgba(0,212,255,0.08),
                0 30px 60px rgba(0,0,0,0.5),
                0 0 80px rgba(0,212,255,0.06);
    overflow: hidden;
    margin-top: 3vh;
    margin-bottom: 3vh;
}
@keyframes modal-card-in {
    from { transform: translateY(-30px) scale(.96); opacity: 0; }
    to   { transform: translateY(0) scale(1);   opacity: 1; }
}

/* Bande lumineuse en haut */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
    opacity: .7;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 28px;
    background: linear-gradient(135deg, rgba(0,212,255,0.18), rgba(0,153,204,0.12));
    border-bottom: 1px solid rgba(0,212,255,0.2);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(6px);
}
.modal-header h3 {
    margin: 0;
    color: white;
    font-size: clamp(14px, 4vw, 17px);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-header h3 i { color: #00d4ff; font-size: 16px; }

.close {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    transition: all .28s cubic-bezier(.34,1.56,.64,1);
    flex-shrink: 0;
}
.close:hover {
    transform: rotate(90deg) scale(1.1);
    color: white;
    background: rgba(255,100,100,0.2);
    border-color: rgba(255,100,100,0.4);
}

.modal-body {
    padding: 24px 28px;
    max-height: 70vh;
    overflow-y: auto;
}
.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); border-radius: 10px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(0,212,255,0.3); border-radius: 10px; }
.modal-body h4 { color: #00d4ff; margin-top: 15px; font-size: clamp(14px,4vw,16px); }
.modal-body h5 { color: #00d4ff; margin-top: 15px; font-size: clamp(12px,3.5vw,14px); }
.modal-body p  { color: rgba(255,255,255,0.8); font-size: clamp(11px,3vw,13px); line-height: 1.5; }

/* Footer Premium */
.premium-footer {
    background: #0a0e27;
    color: white;
    border-radius: 0 0 clamp(15px, 3vw, 30px) clamp(15px, 3vw, 30px);
    overflow: hidden;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: clamp(20px, 5vw, 30px);
    padding: clamp(25px, 5vw, 40px);
}

.jirama-logo-small { width: 30px; height: 30px; }

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-logo h3 { font-size: clamp(14px, 4vw, 18px); color: white; }

.footer-section p {
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: clamp(11px, 3vw, 13px);
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: clamp(12px, 3.5vw, 14px);
    color: #00d4ff;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
    font-size: clamp(10px, 2.8vw, 12px);
    color: rgba(255, 255, 255, 0.6);
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(10px, 2.8vw, 12px);
    cursor: pointer;
}

.social-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.social-link {
    width: clamp(28px, 7vw, 32px);
    height: clamp(28px, 7vw, 32px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s;
    text-decoration: none;
    font-size: clamp(12px, 3vw, 14px);
}

.app-badges {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: clamp(9px, 2.5vw, 11px);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s;
}

.badge:hover {
    background: #00d4ff;
    color: #0a0e27;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding: clamp(12px, 3vw, 15px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: clamp(9px, 2.5vw, 11px);
}

.footer-links {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    gap: clamp(10px, 3vw, 15px);
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: clamp(9px, 2.5vw, 10px);
    cursor: pointer;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    min-width: 250px;
    max-width: 90vw;
    overflow: hidden;
    animation: slideInRight 0.3s ease;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.toast-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.toast-notification.success .toast-icon { background: rgba(81, 207, 102, 0.2); color: #51cf66; }
.toast-notification.info .toast-icon { background: rgba(0, 212, 255, 0.2); color: #00d4ff; }

.toast-content { flex: 1; padding: 10px 0; }
.toast-content strong { display: block; margin-bottom: 3px; font-size: 12px; color: white; }
.toast-content p { margin: 0; font-size: 11px; color: rgba(255, 255, 255, 0.7); }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: #00d4ff;
    width: 100%;
    animation: progress 3s linear;
}

/* Animations */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes progress {
    from { width: 100%; }
    to { width: 0%; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ======================================== */
/* RESPONSIVE DESIGN - MEDIA QUERIES */
/* ======================================== */

/* Smartphones (portrait et paysage) */
@media (max-width: 768px) {
    .container {
        margin: 0;
        width: 100%;
    }
    
    .premium-header {
        border-radius: 0;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .logo-wrapper {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo-animation {
        width: 60px;
        height: 60px;
    }
    
    .jirama-logo {
        width: 50px;
        height: 50px;
    }
    
    .header-stats {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .header-stat {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
    
    /* Navigation - icônes seulement sur mobile */
    .nav-btn span {
        display: none;
    }
    
    .nav-btn i {
        margin-right: 0;
        font-size: 20px;
    }
    
    .nav-btn {
        padding: 12px 18px;
    }
    
    /* Stats cards en colonne sur mobile */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: row;
        text-align: left;
    }
    
    /* Quick actions en colonne */
    .quick-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Charts en colonne */
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    /* Personnes et appareils en colonne */
    .persons-grid, .appliances-grid {
        grid-template-columns: 1fr;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .btn-icon {
        width: 100%;
        text-align: center;
    }
    
    /* Section header en colonne */
    .section-header {
        flex-direction: column;
        text-align: center;
    }
    
    .header-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .header-actions button {
        width: 100%;
    }
    
    /* Billing */
    .billing-hero {
        flex-direction: column;
    }
    
    .total-card {
        width: 100%;
        justify-content: center;
    }
    
    .bill-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .bill-actions button {
        width: 100%;
    }
    
    /* Tableau avec scroll horizontal */
    .billing-table-container {
        overflow-x: auto;
    }
    
    .billing-table {
        min-width: 600px;
    }
    
    /* Settings */
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .settings-actions {
        flex-direction: column;
    }
    
    .settings-actions button {
        width: 100%;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .app-badges {
        justify-content: center;
    }
    
    .footer-section ul li a {
        justify-content: center;
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    /* Toast */
    .toast-notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
}

/* Tablettes (portrait) */
@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .persons-grid, .appliances-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Petits smartphones (moins de 480px) */
@media (max-width: 480px) {
    .header-stat {
        width: 100%;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin-bottom: 10px;
    }
    
    .billing-table th,
    .billing-table td {
        padding: 8px;
        font-size: 10px;
    }
    
    .btn-glow, .btn-outline {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .premium-input, .premium-select {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Orientation paysage sur mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .header-stats {
        flex-direction: row;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        max-height: 90vh;
        margin: 2% auto;
    }
}

/* Grands écrans (desktop) */
@media (min-width: 1400px) {
    .container {
        max-width: 1600px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Impression */
@media print {
    .glass-nav, .quick-actions, .premium-footer, .action-btn, .bill-actions, .icon-btn {
        display: none !important;
    }
    
    .container {
        margin: 0;
        padding: 0;
        width: 100%;
    }
    
    .premium-header {
        background: white;
        color: black;
    }
    
    .main-content {
        background: white;
        padding: 0;
    }
    
    .stat-card, .chart-card, .alerts-card, .tips-card {
        break-inside: avoid;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0e27;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #00d4ff;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0099cc;
}

/* Footer Premium - Version améliorée avec meilleur espacement */
.premium-footer {
    background: #0a0e27;
    color: white;
    border-radius: 0 0 clamp(15px, 3vw, 30px) clamp(15px, 3vw, 30px);
    overflow: hidden;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    margin-top: 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: clamp(30px, 5vw, 50px);
    padding: clamp(40px, 6vw, 60px) clamp(30px, 5vw, 50px);
}

/* Chaque section du footer */
.footer-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Logo et titre avec meilleur espacement */
.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.jirama-logo-small {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(0, 212, 255, 0.3);
}

.footer-logo h3 {
    font-size: clamp(16px, 4vw, 20px);
    color: white;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(135deg, #00d4ff, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Description */
.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 5px;
    font-size: clamp(12px, 3vw, 14px);
}

/* Titres des sections */
.footer-section h4 {
    margin-bottom: 5px;
    font-size: clamp(14px, 3.5vw, 16px);
    color: #00d4ff;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, transparent);
}

/* Liste des liens */
.footer-section ul {
    list-style: none;
    margin-top: 5px;
}

.footer-section ul li {
    margin-bottom: 12px;
    font-size: clamp(11px, 2.8vw, 13px);
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.2s;
}

.footer-section ul li:hover {
    transform: translateX(5px);
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.footer-section ul li a:hover {
    color: #00d4ff;
}

.footer-section ul li i {
    width: 20px;
    color: #00d4ff;
}

/* Réseaux sociaux */
.social-links {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.social-link {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s;
    text-decoration: none;
    font-size: 16px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.social-link:hover {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: white;
    transform: translateY(-3px);
    border-color: transparent;
}

/* Badges d'applications */
.app-badges {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 14px;
    border-radius: 25px;
    font-size: clamp(11px, 2.5vw, 12px);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(0, 212, 255, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.badge i {
    font-size: 14px;
}

.badge:hover {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: white;
    transform: translateY(-2px);
    border-color: transparent;
}

/* Footer bottom */
.footer-bottom {
    text-align: center;
    padding: clamp(20px, 4vw, 25px) clamp(20px, 4vw, 30px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    font-size: clamp(11px, 2.8vw, 12px);
}

.footer-bottom p {
    margin-bottom: 12px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: clamp(20px, 4vw, 30px);
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: clamp(10px, 2.5vw, 11px);
    transition: color 0.3s;
    cursor: pointer;
}

.footer-links a:hover {
    color: #00d4ff;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-content {
        gap: 20px;
        padding: 0px 25px;
    }
    
    .footer-section {
        text-align: center;
        align-items: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .footer-section h4::after {
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .app-badges {
        justify-content: center;
    }
    
    .footer-section ul li a {
        justify-content: center;
    }
    
    .footer-section ul li:hover {
        transform: translateX(0);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .footer-content {
        gap: 40px;
        padding: 45px 35px;
    }
}
/* Séparateur entre les sections */
.footer-section + .footer-section {
    position: relative;
}

@media (min-width: 769px) {
    .footer-section + .footer-section::before {
        content: '';
        position: absolute;
        left: -20px;
        top: 0;
        height: 100%;
        width: 1px;
        background: linear-gradient(to bottom, transparent, rgba(0, 212, 255, 0.3), transparent);
    }
}

@media (max-width: 768px) {
    .footer-section + .footer-section {
        padding-top: 25px;
        border-top: 1px solid rgba(0, 212, 255, 0.15);
    }
}

/* ======================================== */
/* MODALS AMÉLIORÉS - AÉRÉS ET CONFORTABLES */
/* ======================================== */

/* ── Modal form styles (unified) ── */
.modal-content form {
    padding: 24px 28px 28px;
}
.modal-content .form-group { margin-bottom: 20px; }
.modal-content .form-group label {
    display: block;
    margin-bottom: 9px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    font-size: 13px;
}
.modal-content .form-group label i { margin-right: 8px; color: #00d4ff; width: 18px; }
.modal-content .premium-input,
.modal-content .premium-select {
    width: 100%;
    padding: 11px 15px;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(0,212,255,0.35);
    border-radius: 13px;
    font-size: 14px;
    color: white;
    transition: all .28s;
    font-family: inherit;
    outline: none;
}
.modal-content .premium-input:focus,
.modal-content .premium-select:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 0 4px rgba(0,212,255,0.14);
    background: rgba(255,255,255,0.11);
}
.modal-content .premium-input::placeholder { color: rgba(255,255,255,0.36); }
.modal-content .premium-select {
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2300d4ff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 17px;
}
.modal-content .premium-select option { background: #1a1f3a; color: white; }
.modal-content .form-group small { display: block; margin-top: 7px; color: rgba(255,255,255,0.48); font-size: 11px; line-height: 1.4; }
.modal-content .slider-container {
    display: flex; align-items: center; gap: 16px;
    background: rgba(255,255,255,0.06);
    padding: 10px 14px; border-radius: 16px;
    border: 1px solid rgba(0,212,255,0.24);
}
.modal-content .slider-container input {
    flex: 1; height: 5px; -webkit-appearance: none;
    background: rgba(0,212,255,0.28); border-radius: 3px; outline: none;
}
.modal-content .slider-container input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    background: #00d4ff; border-radius: 50%;
    cursor: pointer; box-shadow: 0 0 8px rgba(0,212,255,0.5);
    border: 2px solid white;
}
.modal-content .slider-container span {
    min-width: 52px; font-weight: 700; color: #00d4ff;
    background: rgba(0,212,255,0.18); padding: 5px 10px;
    border-radius: 20px; text-align: center; font-size: 13px;
}
.modal-content .form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 4px;
}
.modal-content .btn-glow.full-width {
    width: 100%; justify-content: center;
    padding: 13px 20px; font-size: 14px; font-weight: 600;
    margin-top: 18px; border-radius: 13px;
}
.form-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.form-actions button { flex: 1; min-width: 100px; justify-content: center; }
/* Consumption preview */
.consumption-preview {
    display: flex; align-items: center; gap: 14px;
    background: rgba(0,212,255,0.08);
    border: 1px solid rgba(0,212,255,0.22);
    border-radius: 13px; padding: 12px 16px; margin-top: 4px;
}
.preview-icon { color: #00d4ff; font-size: 22px; }
.preview-text span { font-size: 11px; color: rgba(255,255,255,0.5); display: block; }
.preview-text strong { color: #00d4ff; font-size: 16px; }
@media (max-width: 640px) {
    .modal-content { width: 96%; border-radius: 20px; }
    .modal { padding: 10px; }
    .modal-header { padding: 16px 18px; }
    .modal-content form { padding: 16px 18px 20px; }
    .modal-content .form-row { grid-template-columns: 1fr; gap: 12px; }
    .modal-body { padding: 16px 18px; max-height: 72vh; }
    .form-actions { flex-direction: column; }
    .form-actions button { flex: none; width: 100%; }
}

label, .form-group label {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Cartes et conteneurs */
.person-card p, .appliance-card p {
    color: rgba(255, 255, 255, 0.8) !important;
}

.person-card h3, .appliance-card h3 {
    color: #00d4ff !important;
}

/* Statistiques */
.stat-details h3, .stat-details p, .stat-trend {
    color: white !important;
}

.stat-details h3 {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Tableaux */
.billing-table th, .billing-table td {
    color: white !important;
}

/* Alertes et conseils */
.alerts-card p, .tips-card p {
    color: white !important;
}

/* Historique */
.history-item p {
    color: white !important;
}

/* Boutons texte */
.btn-outline {
    color: #00d4ff !important;
}

.btn-glow {
    color: white !important;
}

/* Liens du footer */
.footer-section ul li a {
    color: rgba(255, 255, 255, 0.7) !important;
}

.footer-section ul li a:hover {
    color: #00d4ff !important;
}

.footer-section p, .footer-bottom p {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Badges */
.badge {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Small text */
small, .form-group small {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Slider value */
.slider-container span {
    color: #00d4ff !important;
}

/* Tranche labels */
.tranche-inputs span {
    color: white !important;
}

/* Settings card text */
.settings-card .card-header h3 {
    color: #00d4ff !important;
}

.settings-card .form-group label {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Modal body text */
.modal-body h4, .modal-body h5 {
    color: #00d4ff !important;
}

.modal-body p {
    color: rgba(255, 255, 255, 0.9) !important;
}

.modal-body li {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Alert dans modals */
.alert p, .alert {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Correction des textes noirs résiduels */
.text-dark, .text-black, [style*="color: black"], [style*="color:#000"], [style*="color: #000"] {
    color: white !important;
}

/* Liens dans le contenu */
a:not(.social-link):not(.footer-links a) {
    color: #00d4ff !important;
}

a:not(.social-link):not(.footer-links a):hover {
    color: #33ddff !important;
}
/* ======================================== */
/* UNIFORMISATION DES GRAPHIQUES */
/* ======================================== */

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.chart-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.chart-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 212, 255, 0.5);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.card-header h3 {
    font-size: 18px;
    color: #00d4ff;
    margin: 0;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
    color: #00d4ff;
}

/* Conteneur des graphiques - taille identique */
.chart-card canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 300px;
    min-height: 250px;
    flex-shrink: 1;
}

/* Pour le graphique en barres (Top Consommateurs) */
#appliancesChart {
    width: 100% !important;
    height: auto !important;
    max-height: 300px;
    min-height: 250px;
}

/* Pour le graphique circulaire (Répartition Électricité) */
#elecChart {
    width: 100% !important;
    height: auto !important;
    max-height: 300px;
    min-height: 250px;
}

/* Responsive - sur mobile, les graphiques restent bien dimensionnés */
@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .chart-card canvas {
        max-height: 280px;
        min-height: 230px;
    }
}

/* ======================================== */
/* MODAL TARIFS JIRAMA - DESIGN CENTRÉ ET ÉLÉGANT */
/* ======================================== */

.tarifs-modal .modal-content {
    max-width: 650px;
}

.tarifs-body {
    padding: 30px !important;
}

.tarifs-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 25px;
}

.tarif-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 153, 204, 0.05));
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    transition: all 0.3s;
    text-align: center;
}

.tarif-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 10px 25px rgba(0, 212, 255, 0.2);
}

.tarif-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
}

.tarif-header i {
    font-size: 28px;
    color: #00d4ff;
}

.tarif-header h4 {
    font-size: 1.3rem;
    margin: 0;
    color: white;
    font-weight: 600;
}

.tarif-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tarif-range {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.2s;
}

.tarif-range:hover {
    background: rgba(0, 212, 255, 0.15);
    transform: translateX(5px);
}

.range-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.range-price {
    font-size: 1rem;
    font-weight: bold;
    color: #00d4ff;
}

.tarif-note {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 16px;
    padding: 15px 20px;
    margin-top: 10px;
    border-left: 4px solid #00d4ff;
}

.tarif-note i {
    font-size: 20px;
    color: #00d4ff;
}

.tarif-note p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    text-align: left;
}

/* Responsive tarifs modal */
@media (max-width: 600px) {
    .tarifs-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tarif-range {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .tarif-note {
        flex-direction: column;
        text-align: center;
    }
    
    .tarif-note i {
        font-size: 24px;
    }
}

/* ======================================== */
/* ANIMATIONS DES STATISTIQUES (cartes) */
/* ======================================== */

.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.6);
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card .stat-icon {
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
}

.stat-card .stat-details p {
    transition: all 0.3s ease;
}

.stat-card:hover .stat-details p {
    transform: scale(1.05);
    color: #00d4ff;
}

/* ======================================== */
/* ANIMATIONS DES GRAPHIQUES */
/* ======================================== */

.chart-card {
    transition: all 0.3s ease;
    overflow: hidden;
}

.chart-card canvas {
    transition: all 0.5s ease;
    animation: chartFadeIn 0.8s ease-out;
}

@keyframes chartFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation pour les barres du graphique */
.chart-card canvas {
    animation: chartScale 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes chartScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Effet de brillance au survol du graphique */
.chart-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.15);
}

.chart-card:hover canvas {
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.3));
}

/* ======================================== */
/* STYLES COMMUNS POUR TOUS LES MODALS */
/* ======================================== */

.modal-content {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: 28px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    padding: 24px 28px;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    margin: 0;
}

.modal-header h3 i {
    font-size: 1.3rem;
}

.modal-body {
    padding: 28px;
}

/* Formulaires dans les modals */
.modal-content form {
    padding: 28px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
}

.form-actions button {
    padding: 12px 24px;
    font-size: 0.9rem;
}

/* Preview consommation */
.consumption-preview {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 153, 204, 0.05));
    border-radius: 16px;
    padding: 15px 20px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.preview-icon i {
    font-size: 28px;
    color: #00d4ff;
}

.preview-text {
    display: flex;
    flex-direction: column;
}

.preview-text span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.preview-text strong {
    font-size: 1.3rem;
    color: #00d4ff;
    font-weight: bold;
}

/* Guide modal */
.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.guide-step {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
}

.step-content h4 {
    margin: 0 0 8px 0;
    color: #00d4ff;
    font-size: 1rem;
}

.step-content p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    font-size: 0.9rem;
}

.guide-tip {
    background: rgba(0, 212, 255, 0.1);
    border-radius: 16px;
    padding: 15px 20px;
    display: flex;
    gap: 12px;
    border-left: 4px solid #00d4ff;
}

.guide-tip i {
    font-size: 24px;
    color: #00d4ff;
}

.guide-tip div {
    flex: 1;
}

.guide-tip strong {
    color: #00d4ff;
    display: block;
    margin-bottom: 5px;
}

/* Support modal */
.support-contact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.contact-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: all 0.3s;
}

.contact-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 212, 255, 0.5);
}

.contact-card i {
    font-size: 32px;
    color: #00d4ff;
    margin-bottom: 12px;
    display: inline-block;
}

.contact-card h4 {
    margin: 0 0 8px 0;
    color: white;
    font-size: 1rem;
}

.contact-card p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: bold;
    color: #00d4ff;
}

.contact-card small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

.agencies-section {
    margin-bottom: 25px;
}

.agencies-section h4 {
    margin-bottom: 15px;
    color: #00d4ff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agencies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.agency {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.agency i {
    color: #00d4ff;
    font-size: 16px;
}

.agency strong {
    display: block;
    font-size: 0.85rem;
    color: white;
}

.agency span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.emergency-alert {
    background: rgba(255, 107, 107, 0.15);
    border-radius: 16px;
    padding: 15px 20px;
    display: flex;
    gap: 15px;
    border-left: 4px solid #ff6b6b;
}

.emergency-alert i {
    font-size: 28px;
    color: #ff6b6b;
}

.emergency-alert strong {
    color: #ff6b6b;
    display: block;
    margin-bottom: 5px;
}

.emergency-alert p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

/* FAQ Styles */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(0, 212, 255, 0.5);
}

.faq-question {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    background: rgba(0, 212, 255, 0.05);
    transition: background 0.2s;
}

.faq-question:hover {
    background: rgba(0, 212, 255, 0.1);
}

.faq-question i:first-child {
    color: #00d4ff;
    font-size: 18px;
    width: 24px;
}

.faq-question span {
    flex: 1;
    font-weight: 500;
    color: white;
    font-size: 14px;
}

.faq-question i:last-child {
    color: #00d4ff;
    transition: transform 0.3s ease;
    font-size: 14px;
}

.faq-item.active .faq-question i:last-child {
    transform: rotate(180deg);
}

.faq-answer {
    display: none;
    padding: 0 20px 20px 56px;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.2);
}

.faq-item.active .faq-answer {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-answer p {
    margin: 0;
    padding: 5px 0;
}

.faq-answer strong {
    color: #00d4ff;
}

/* Responsive */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-header {
        padding: 18px 20px;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-content form {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions button {
        width: 100%;
        justify-content: center;
    }
    
    .support-contact {
        grid-template-columns: 1fr;
    }
    
    .agencies-grid {
        grid-template-columns: 1fr;
    }
    
    .guide-step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .faq-question {
        padding: 12px 15px;
    }
    
    .faq-answer {
        padding: 0 15px 15px 15px;
    }
}

/* ======================================== */
/* MODAL SUPPORT TECHNIQUE AMÉLIORÉ */
/* ======================================== */

.support-modal .modal-content {
    max-width: 750px;
}

.support-body {
    padding: 0 !important;
    max-height: 80vh;
    overflow-y: auto;
}

.support-hero {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 153, 204, 0.1));
    padding: 25px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.support-icon i {
    font-size: 48px;
    color: #00d4ff;
}

.support-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.3rem;
    color: white;
}

.support-info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Cartes de contact */
.support-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 25px 30px;
    background: rgba(255, 255, 255, 0.03);
}

.support-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: all 0.3s;
}

.support-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 212, 255, 0.5);
    background: rgba(0, 212, 255, 0.05);
}

.card-icon i {
    font-size: 36px;
    color: #00d4ff;
    margin-bottom: 12px;
}

.card-content h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: white;
}

.card-content .phone-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00d4ff;
    margin: 5px 0;
}

.card-content .email {
    font-size: 0.85rem;
    color: #00d4ff;
    word-break: break-all;
}

.card-content .hours {
    font-size: 1.1rem;
    font-weight: bold;
    color: #00d4ff;
}

.card-content .small {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
}

/* Agences */
.agencies-section {
    padding: 20px 30px;
    border-top: 1px solid rgba(0, 212, 255, 0.1);
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.agencies-section h4 {
    margin-bottom: 15px;
    color: #00d4ff;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.agencies-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.agency-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 15px;
    border-radius: 12px;
    transition: all 0.3s;
}

.agency-card:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateX(5px);
}

.agency-card i {
    color: #00d4ff;
    font-size: 18px;
}

.agency-card strong {
    display: block;
    font-size: 0.85rem;
    color: white;
}

.agency-card span {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Urgence */
.emergency-box {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 107, 107, 0.05));
    margin: 20px 30px;
    padding: 20px;
    border-radius: 20px;
    display: flex;
    gap: 20px;
    border-left: 4px solid #ff6b6b;
}

.emergency-icon i {
    font-size: 40px;
    color: #ff6b6b;
}

.emergency-content strong {
    color: #ff6b6b;
    font-size: 1rem;
    display: block;
    margin-bottom: 5px;
}

.emergency-content p {
    margin: 0 0 10px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.emergency-number {
    background: rgba(255, 107, 107, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 40px;
}

.emergency-number i {
    color: #ff6b6b;
    font-size: 18px;
}

.emergency-number span {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ff6b6b;
}

/* Formulaire rapide */
.quick-contact {
    padding: 20px 30px 30px;
}

.quick-contact h4 {
    margin-bottom: 15px;
    color: #00d4ff;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.quick-contact .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.quick-contact textarea {
    margin-bottom: 15px;
}

.quick-contact button {
    width: 100%;
}

.form-note {
    text-align: center;
    margin-top: 12px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.form-note i {
    margin-right: 5px;
}

/* Responsive support modal */
@media (max-width: 700px) {
    .support-cards {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px;
    }
    
    .agencies-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-contact .form-row {
        grid-template-columns: 1fr;
    }
    
    .emergency-box {
        flex-direction: column;
        text-align: center;
        margin: 15px 20px;
    }
    
    .support-hero {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
}

/* Scroll pour tous les modals */
.modal-content {
    max-height: 85vh;
    overflow-y: auto;
}

/* Personnalisation de la scrollbar dans les modals */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #00d4ff;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #0099cc;
}

/* ======================================== */
/* FOOTER - ALIGNEMENT À GAUCHE SUR MOBILE */
/* ======================================== */

@media (max-width: 768px) {
    .premium-footer {
        margin-top: 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px 20px 25px;
    }
    
    /* ESPACE ENTRE LE BORD ET LE TITRE */
    .footer-section:first-child {
        margin-top: 0;
        padding-top: 0;
    }
    
    /* ALIGNEMENT À GAUCHE POUR TOUS LES ÉLÉMENTS */
    .footer-section {
        text-align: left;
    }
    
    .footer-logo {
        justify-content: flex-start;
    }
    
    .footer-section h4 {
        text-align: left;
        font-size: 15px;
        margin-bottom: 12px;
        display: inline-block;
    }
    
    .footer-section h4::after {
        left: 0;
        transform: none;
        width: 40px;
    }
    
    .footer-section p {
        text-align: left;
        font-size: 12px;
    }
    
    .footer-section ul {
        text-align: left;
        padding-left: 0;
    }
    
    .footer-section ul li {
        text-align: left;
    }
    
    .footer-section ul li a {
        justify-content: flex-start;
    }
    
    .social-links {
        justify-content: flex-start;
    }
    
    .app-badges {
        justify-content: flex-start;
    }
    
    .footer-bottom {
        padding: 15px 20px;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
        gap: 15px;
    }
}
@media (max-width: 768px) {
    /* Ajoute un espace entre le bord et le contenu du footer */
    .footer-content {
        padding-top: 35px;  /* Augmente l'espace en haut */
    }
    
    /* Ou si vous voulez plus d'espace pour la première section */
    .footer-section:first-child {
        margin-top: 5px;
    }
}

/* ======================================== */
/* HEADER - ALIGNEMENT À GAUCHE SUR SMARTPHONES */
/* ======================================== */

@media (max-width: 768px) {
    /* Header - trois boîtes identiques empilées */
    .header-stats {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    
    /* Chaque boîte - alignement à gauche */
    .header-stat {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        padding: 12px 16px;
        border-radius: 15px;
        border: 1px solid rgba(0, 212, 255, 0.2);
        width: 100%;
    }
    
    /* Icône dans chaque boîte - alignée à gauche */
    .header-stat i {
        font-size: 22px;
        color: #00d4ff;
        width: 32px;
        text-align: left;
    }
    
    /* Conteneur du texte/select */
    .stat-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    /* Label commun - aligné à gauche */
    .stat-label {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.7);
        margin-bottom: 2px;
        text-align: left;
        width: 100%;
    }
    
    /* Valeur commune - alignée à gauche */
    .stat-value {
        font-size: 16px;
        font-weight: bold;
        color: white;
        text-align: left;
        width: 100%;
    }
    
    /* STYLE SPÉCIFIQUE POUR LE SELECT - ALIGNÉ À GAUCHE */
    .period-select {
        background: transparent;
        border: none;
        color: white;
        font-size: 16px;
        font-weight: bold;
        padding: 0;
        cursor: pointer;
        width: auto;
        font-family: inherit;
        text-align: left;
    }
    
    .period-select:focus {
        outline: none;
    }
    
    .period-select option {
        background: #1e293b;
        color: white;
        font-size: 14px;
        padding: 8px;
        text-align: left;
    }
}
@media (max-width: 480px) {
    .header-stat {
        padding: 10px 14px;
    }
    
    .header-stat i {
        font-size: 20px;
        width: 28px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .stat-value, .period-select {
        font-size: 14px;
    }
} 

/* ======================================== */
/* HEADER - RÉDUCTION DES MARGES DES PREMIÈRES BOÎTES SUR MOBILE */
/* ======================================== */

@media (max-width: 768px) {
    /* Conteneur principal du header */
    .header-content {
        padding: 10px;
        flex-direction: column;
        gap: 5px;
    }
    
    /* Logo et titre */
    .logo-wrapper {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .logo-animation {
        width: 55px;
        height: 55px;
    }
    
    .logo-text h1 {
        font-size: 24px;
    }
    
    .logo-text p {
        font-size: 11px;
    }
    
    /* Trois boîtes de statistiques */
    .header-stats {
        display: flex;
        flex-direction: column;
        width: 50%;
        gap: 12px;
        margin-top: 5px;
    }
    
    /* Style commun pour toutes les boîtes */
    .header-stat {
        display: flex;
        align-items: center;
        gap: 14px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        border-radius: 16px;
        border: 1px solid rgba(0, 212, 255, 0.25);
        width: 100%;
        transition: all 0.3s;
    }
    
    /* PREMIÈRE BOÎTE (Période) - RÉDUCTION DES MARGES LATÉRALES */
    .header-stat:first-child {
        padding: 4px 5px;
    }
    
    /* DEUXIÈME BOÎTE (Colocataires) - RÉDUCTION DES MARGES LATÉRALES */
    .header-stat:nth-child(2) {
        padding: 4px 5px;
    }
    
    /* TROISIÈME BOÎTE (Budget total) - GARDE SES MARGES ORIGINALES */
    .header-stat:last-child {
        padding: 14px 18px;
    }
    
    /* Icônes dans toutes les boîtes */
    .header-stat i {
        font-size: 22px;
        color: #00d4ff;
        width: 32px;
        text-align: center;
    }
    
    /* Conteneur du texte */
    .stat-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    /* Label dans toutes les boîtes */
    .stat-label {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.7);
        font-weight: 500;
    }
    
    /* Valeur dans toutes les boîtes */
    .stat-value {
        font-size: 18px;
        font-weight: 700;
        color: white;
        line-height: 1.2;
    }
    
    /* Style spécifique pour le select période */
    .period-select {
        background: transparent;
        border: none;
        color: white;
        font-size: 18px;
        font-weight: 700;
        padding: 0;
        cursor: pointer;
        font-family: inherit;
        width: auto;
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2300d4ff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right center;
        background-size: 14px;
        padding-right: 5px;
    }
    
    .period-select:focus {
        outline: none;
    }
    
    .period-select option {
        background: #1e293b;
        color: white;
        font-size: 14px;
        padding: 4px;
    }
}

/* Pour les très petits écrans (moins de 480px) */
@media (max-width: 480px) {
    /* Deux premières boîtes - marges encore plus réduites */
    .header-stat:first-child,
    .header-stat:nth-child(2) {
        padding: 10px 10px;
    }
    
    /* Troisième boîte garde ses marges */
    .header-stat:last-child {
        padding: 12px 16px;
    }
    
    .header-stat i {
        font-size: 20px;
        width: 28px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .period-select {
        font-size: 16px;
        background-size: 12px;
        padding-right: 12px;
    }
}

/* ======================================== */
/* STATISTIQUES - 2x2 GRILLE SUR MOBILE */
/* ======================================== */

@media (max-width: 768px) {
    /* Conteneur des 4 boîtes de statistiques - grille 2x2 */
    .stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 25px;
    }
    
    /* Chaque boîte de statistique - style identique */
    .stat-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 153, 204, 0.05));
        border: 1px solid rgba(0, 212, 255, 0.25);
        border-radius: 16px;
        padding: 14px 10px;
        transition: all 0.3s;
    }
    
    /* Icône dans chaque boîte */
    .stat-icon {
        width: 45px;
        height: 45px;
        background: rgba(0, 212, 255, 0.15);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .stat-icon i {
        font-size: 22px;
        color: #00d4ff;
    }
    
    /* Conteneur du texte */
    .stat-details {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
    
    /* Titre (Colocataires, Appareils, etc.) */
    .stat-details h3 {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.7);
        font-weight: 500;
        margin: 0;
    }
    
    /* Valeur (nombre) */
    .stat-details p {
        font-size: 20px;
        font-weight: 700;
        color: white;
        margin: 0;
        line-height: 1.2;
    }
    
    /* Petit texte (Actifs, Enregistrés, Ce mois) */
    .stat-trend {
        font-size: 10px;
        color: rgba(255, 255, 255, 0.5);
        margin-top: 2px;
    }
}

/* Pour les très petits écrans (moins de 480px) */
@media (max-width: 480px) {
    .stats-grid {
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px 8px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .stat-icon i {
        font-size: 20px;
    }
    
    .stat-details h3 {
        font-size: 11px;
    }
    
    .stat-details p {
        font-size: 18px;
    }
    
    .stat-trend {
        font-size: 9px;
    }
}
   

/* ======================================== */
/* DASHBOARD - 5 BOUTONS EN GRILLE SUR MOBILE */
/* ======================================== */

@media (max-width: 768px) {
    /* Conteneur des 5 boutons */
    .quick-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 25px;
    }
    
    /* Chaque bouton */
    .action-btn {
        padding: 12px 8px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 500;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
    }
}

/* Pour les très petits écrans (moins de 480px) */
@media (max-width: 480px) {
    .quick-actions {
        gap: 8px;
    }
    
    .action-btn {
        padding: 10px 6px;
        font-size: 11px;
    }
    
    .action-btn i {
        font-size: 12px;
    }
}

/* ======================================== */
/* STATISTIQUES - 4 BOÎTES EN GRILLE 2x2 SUR MOBILE */
/* ======================================== */

@media (max-width: 768px) {
    /* Conteneur des 4 boîtes de statistiques */
    .stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 25px;
    }
    
    /* Chaque boîte de statistique */
    .stat-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 153, 204, 0.05));
        border: 1px solid rgba(0, 212, 255, 0.25);
        border-radius: 16px;
        padding: 14px 10px;
    }
    
    /* Icône */
    .stat-icon {
        width: 45px;
        height: 45px;
        background: rgba(0, 212, 255, 0.15);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .stat-icon i {
        font-size: 22px;
        color: #00d4ff;
    }
    
    /* Texte */
    .stat-details {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
    
    .stat-details h3 {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.7);
        font-weight: 500;
        margin: 0;
    }
    
    .stat-details p {
        font-size: 20px;
        font-weight: 700;
        color: white;
        margin: 0;
    }
    
    .stat-trend {
        font-size: 10px;
        color: rgba(255, 255, 255, 0.5);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px 8px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .stat-icon i {
        font-size: 20px;
    }
    
    .stat-details h3 {
        font-size: 11px;
    }
    
    .stat-details p {
        font-size: 18px;
    }
    
    .stat-trend {
        font-size: 9px;
    }
}

/* ======================================== */
/* HEADER - 3 BOÎTES COMME LES 5 BOUTONS */
/* DISPOSITION : 2 EN HAUT, 1 EN BAS (PLEINE LARGEUR) */
/* STYLE : ICÔNE À GAUCHE, TEXTE À CÔTÉ, PADDING RÉDUIT */
/* ======================================== */

@media (max-width: 768px) {
    /* Conteneur des 3 boîtes du header - grille 2 colonnes */
    .header-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        width: 100%;
        margin-top: 5px;
    }
    
    /* La troisième boîte (Budget total) prend toute la largeur - COMME LE 5ÈME BOUTON */
    .header-stat:last-child {
        grid-column: span 2;
    }
    
    /* Style des boîtes - PADDING RÉDUIT, ICÔNE À GAUCHE */
    .header-stat {
        display: flex;
        align-items: center;
        gap: 12px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        padding: 8px 16px;
        border-radius: 15px;
        border: 1px solid rgba(0, 212, 255, 0.2);
        width: 100%;
    }
    
    /* Icône - À GAUCHE */
    .header-stat i {
        font-size: 22px;
        color: #00d4ff;
        width: 32px;
        flex-shrink: 0;
    }
    
    /* Conteneur du texte - JUSTE À CÔTÉ DE L'ICÔNE */
    .stat-info {
        display: flex;
        flex-direction: column;
        flex: 1;
    }
    
    /* Label - en haut */
    .stat-label {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.7);
        margin-bottom: 2px;
    }
    
    /* Valeur - en dessous du label */
    .stat-value {
        font-size: 16px;
        font-weight: bold;
        color: white;
    }
    
    /* Select période - même style que la valeur */
    .period-select {
        background: transparent;
        border: none;
        color: white;
        font-size: 16px;
        font-weight: bold;
        padding: 0;
        cursor: pointer;
        font-family: inherit;
        width: auto;
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2300d4ff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right center;
        background-size: 14px;
        padding-right: 18px;
    }
}

/* Pour les très petits écrans (moins de 480px) */
@media (max-width: 480px) {
    .header-stats {
        gap: 10px;
    }
    
    .header-stat {
        padding: 6px 14px;
    }
    
    .header-stat i {
        font-size: 20px;
        width: 28px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .stat-value, .period-select {
        font-size: 14px;
    }
    
    .period-select {
        background-size: 12px;
        padding-right: 16px;
    }
}
/* ======================================== */
/* FOOTER - MODIFICATIONS UNIQUEMENT */
/* ======================================== */

    /* Texte de description - CENTRÉ */
    .footer-section:first-child p {
        text-align: center;
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;
    }
 
    /* Contact officiel (4ème section) - en bas, centré extérieur, contenu aligné à gauche */
    .footer-section:nth-child(4) {
        text-align: center;
        order: 2;
        margin-top: 10px;
    }
    
    /* Contenu de Contact officiel - aligné à gauche */
    .footer-section:nth-child(4) ul {
        text-align: left;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 0;
    }
    
    .footer-section:nth-child(4) ul li {
        text-align: left;
        display: flex;
        align-items: center;
        gap: 10px;
        justify-content: flex-start;
    }
    
    .footer-section:nth-child(4) ul li i {
        width: 24px;
        text-align: left;
    }
    
    .footer-section:nth-child(4) h4 {
        text-align: center;
    }
    
    .footer-section:nth-child(4) h4::after {
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
    }
    
    .app-badges {
        justify-content: center;
        margin-top: 15px;
    }
}

/* ======================================== */
/* FOOTER - TOUTES LES SECTIONS CENTRÉES */
/* ======================================== */

@media (max-width: 768px) {
    /* Conteneur principal du footer */
    .footer-content {
        display: flex;
        flex-direction: column;
        gap: 35px;
        padding: 30px 20px 25px;
    }
    
    /* Toutes les sections - centrées extérieurement */
    .footer-section {
        text-align: center;
        width: 100%;
    }
    
    /* Première section (logo + description) */
    .footer-section:first-child {
        text-align: center;
    }
    
    .footer-section:first-child p {
        text-align: center;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Navigation et Ressources - centrées */
    .footer-section:nth-child(2),
    .footer-section:nth-child(3) {
        text-align: center;
    }
    
    /* Contenu des sections centrées - mais texte aligné à gauche à l'intérieur */
    .footer-section:nth-child(2) h4,
    .footer-section:nth-child(3) h4 {
        text-align: center;
    }
    
    .footer-section:nth-child(2) h4::after,
    .footer-section:nth-child(3) h4::after {
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
    }
    
    /* Liste des liens - centrée extérieurement, contenu aligné à gauche */
    .footer-section:nth-child(2) ul,
    .footer-section:nth-child(3) ul {
        text-align: left;
        max-width: 200px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 0;
    }
    
    .footer-section:nth-child(2) ul li,
    .footer-section:nth-child(3) ul li {
        text-align: left;
    }
    
    .footer-section:nth-child(2) ul li a,
    .footer-section:nth-child(3) ul li a {
        justify-content: flex-start;
    }
    
    /* Contact officiel - centré */
    .footer-section:nth-child(4) {
        text-align: center;
    }
    
    .footer-section:nth-child(4) h4 {
        text-align: center;
    }
    
    .footer-section:nth-child(4) h4::after {
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
    }
    
    /* Contenu de Contact officiel - centré extérieurement, aligné à gauche */
    .footer-section:nth-child(4) ul {
        text-align: left;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 0;
    }
    
    .footer-section:nth-child(4) ul li {
        text-align: left;
        display: flex;
        align-items: center;
        gap: 10px;
        justify-content: flex-start;
    }
    
    .footer-section:nth-child(4) ul li i {
        width: 24px;
        text-align: left;
    }
    
    .app-badges {
        justify-content: center;
        margin-top: 15px;
    }
}

/* Styles pour les tranches */
.tranche-item {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    padding-bottom: 15px;
}

.tranche-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tranche-title {
    font-weight: bold;
    color: #00d4ff;
}

.tranche-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.tranche-range {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tranche-range label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}
/* Style de base pour les boutons supprimer dans les tranches */
.tranche-delete {
    background: transparent;
    border: 1.5px solid #ff6b6b;
    color: #ff6b6b;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    font-weight: 500;
    
    /* Taille réduite par rapport aux boutons des appareils */
    padding: 4px 5px;
    font-size: 12px;
    min-width: 40px;
}

.tranche-delete i {
    font-size: 10px;
}

.tranche-delete:hover {
    background: #ff6b6b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
}

.tranche-delete:active {
    transform: translateY(0);
}

/* Ajustement du conteneur pour aligner le bouton à droite */
.tranche-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tranche-title {
    font-weight: bold;
    color: #00d4ff;
    font-size: 13px;
}
@media (max-width: 768px) {
    .tranche-inputs {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ======================================== */
/* ALIGNEMENT DES BOÎTES DE TARIFS */
/* ======================================== */

/* Disposition en grille pour les 5 cartes */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* Pour que les deux dernières cartes (tarifs électricité et eau) soient côte à côte */
@media (min-width: 1200px) {
    .settings-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Les deux cartes de tarifs prennent les 2 dernières colonnes sur la deuxième ligne */
    .settings-card:nth-child(4),
    .settings-card:nth-child(5) {
        grid-column: span 1;
    }
}

/* Version responsive pour les écrans moyens */
@media (min-width: 768px) and (max-width: 1199px) {
    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .settings-card:nth-child(4),
    .settings-card:nth-child(5) {
        grid-column: span 1;
    }
}

/* Version mobile : les cartes s'empilent */
@media (max-width: 767px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* ======================================== */
/* VERSION SIMPLIFIÉE - TARIFS CÔTE À CÔTE */
/* ======================================== */

/* Disposition des cartes de paramètres */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

/* Les 3 premières cartes */
.settings-card:nth-child(1),
.settings-card:nth-child(2),
.settings-card:nth-child(3) {
    grid-row: 1;
}

/* Les 2 cartes de tarifs - 2ème ligne */
.settings-card:nth-child(4),
.settings-card:nth-child(5) {
    grid-row: 2;
    grid-column: span 1;
}

/* Responsive - tablette */
@media (max-width: 1024px) {
    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .settings-card:nth-child(3) {
        grid-row: 2;
    }
    
    .settings-card:nth-child(4),
    .settings-card:nth-child(5) {
        grid-row: 3;
    }
}

/* Responsive - mobile */
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-card {
        grid-row: auto !important;
    }
}

/* ======================================== */
/* TRANCHES - ESPACEMENT ET BOUTONS OPTIMISÉS */
/* ======================================== */

/* Structure de chaque tranche */
.tranche-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
}

/* En-tête de la tranche (titre + bouton supprimer) */
.tranche-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* Espacement entre le titre et le bouton supprimer */
.tranche-title {
    font-weight: bold;
    color: #00d4ff;
    font-size: 13px;
    flex: 1;
}

/* BOUTON SUPPRIMER - PADDING RÉDUIT GAUCHE/DROITE */
.tranche-delete {
    background: transparent;
    border: 1.5px solid #ff6b6b;
    color: #ff6b6b;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    font-weight: 500;
    
    /* Padding réduit à gauche et à droite */
    padding: 5px 12px;
    font-size: 12px;
    min-width: auto;
}

.tranche-delete i {
    font-size: 11px;
    margin: 0;
}

.tranche-delete:hover {
    background: #ff6b6b;
    color: white;
    transform: translateY(-2px);
}

/* Conteneur des inputs */
.tranche-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-top: 5px;
}

.tranche-range {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tranche-range label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
}

.tranche-range input {
    padding: 8px 10px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: white;
}

/* Version mobile */
@media (max-width: 768px) {
    .tranche-inputs {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 10px;
    }
    
    .tranche-header {
        margin-bottom: 15px;
    }
    
    .tranche-delete {
        padding: 4px 10px;
        font-size: 11px;
    }
}

.tranche-delete {
    background: transparent;
    border: 1.5px solid #ff6b6b;
    color: #ff6b6b;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: inherit;
    font-weight: 500;
    
    /* Padding très réduit */
    padding: 4px 8px;
    font-size: 11px;
    min-width: auto;
}

.tranche-delete i {
    font-size: 10px;
}

/* Les deux cartes de tarifs - centrées et plus larges */
.settings-card:nth-child(4),
.settings-card:nth-child(5) {
    grid-row: 2;
    grid-column: span 1;
    justify-self: center;
    width: 90%;
    max-width: 500px;
}

/* Pour tablette, les deux cartes prennent toute la largeur */
@media (max-width: 1024px) and (min-width: 769px) {
    .settings-card:nth-child(4),
    .settings-card:nth-child(5) {
        width: 100%;
        max-width: none;
    }
}

.action-btn.excel {
    background: linear-gradient(135deg, #1e7e34, #28a745);
    color: white;
}

.action-btn.excel:hover {
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.3);
}

/* ======================================== */
/* ESPACEMENT ENTRE LES BOÎTES DU DASHBOARD */
/* ======================================== */

/* Espace entre les graphiques et les alertes */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 40px; /* Augmenté de 30px à 40px */
}

/* Espace entre le graphique d'évolution et les alertes */
.evolution-card {
    margin-bottom: 40px; /* Ajout d'espace en dessous */
}

/* Grille des alertes et éco-conseils */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 40px; /* Ajout d'espace en dessous */
}

/* Carte des dépenses communes */
.common-expenses-card {
    margin-top: 40px; /* Espace au-dessus */
}

/* Version responsive pour mobile */
@media (max-width: 768px) {
    .charts-grid {
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .evolution-card {
        margin-bottom: 30px;
    }
    
    .info-grid {
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .common-expenses-card {
        margin-top: 30px;
    }
}

/* ======================================== */
/* GRILLES DES PARAMÈTRES */
/* ======================================== */

/* Première grille pour les 6 premières cartes */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* Deuxième grille pour les cartes du bas */
.settings-grid-bottom {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

/* Style pour la carte d'actions */
.action-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 153, 204, 0.05));
    border: 1px solid rgba(0, 212, 255, 0.4);
}

.action-card .settings-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.action-card .settings-actions button {
    padding: 14px 20px;
    font-size: 15px;
}

/* Responsive */
@media (max-width: 1024px) {
    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .settings-grid-bottom {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-grid-bottom {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .action-card .settings-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .action-card .settings-actions button {
        width: 100%;
    }
}

/* ======================================== */
/* FAQ ACCORDÉON - STYLES COMPLETS */
/* ======================================== */

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(0, 212, 255, 0.5);
}

.faq-question {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    background: rgba(0, 212, 255, 0.05);
    transition: background 0.2s;
}

.faq-question:hover {
    background: rgba(0, 212, 255, 0.1);
}

.faq-question i:first-child {
    color: #00d4ff;
    font-size: 18px;
    width: 24px;
}

.faq-question span {
    flex: 1;
    font-weight: 500;
    color: white;
    font-size: 14px;
}

.faq-question i:last-child {
    color: #00d4ff;
    transition: transform 0.3s ease;
    font-size: 14px;
}

.faq-item.active .faq-question i:last-child {
    transform: rotate(180deg);
}

.faq-answer {
    display: none;
    padding: 0 20px 20px 56px;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.2);
}

.faq-item.active .faq-answer {
    display: block;
    animation: slideDown 0.3s ease;
}


    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-answer p {
    margin: 0;
    padding: 5px 0;
}

.faq-answer strong {
    color: #00d4ff;
}

/* Animation d'entrée pour le modal FAQ */
#faqModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Prévision */
.forecast-card {
    margin-bottom: 30px;
}

.forecast-stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
}

.forecast-item {
    background: rgba(0, 212, 255, 0.1);
    border-radius: 16px;
    padding: 15px 20px;
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.forecast-item .label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.forecast-item .value {
    font-size: 24px;
    font-weight: bold;
    color: #00d4ff;
}

.forecast-item .trend-up {
    color: #ff6b6b;
}

.forecast-item .trend-down {
    color: #51cf66;
}

.forecast-warning {
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 107, 107, 0.2);
    border-radius: 12px;
    text-align: center;
    color: #ff6b6b;
}

/* Scan de factures */
.action-btn.scan {
    background: linear-gradient(135deg, #6f42c1, #8b5cf6);
    color: white;
}

.scan-area {
    border: 2px dashed rgba(0, 212, 255, 0.5);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin: 20px 0;
}

.scan-area:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.05);
}

.scan-area i {
    font-size: 48px;
    color: #00d4ff;
    margin-bottom: 15px;
}

.scan-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    margin-top: 15px;
}

.scan-result {
    background: rgba(0, 212, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
}

.scan-result h4 {
    margin: 0 0 10px;
    color: #00d4ff;
}

.scan-result p {
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
}

/* Widgets */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.widget-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s;
}

.widget-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 212, 255, 0.5);
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(0, 212, 255, 0.1);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.widget-header i {
    font-size: 20px;
    color: #00d4ff;
}

.widget-header h4 {
    margin: 0;
    font-size: 14px;
    color: white;
}

.widget-content {
    padding: 15px 20px;
}

.widget-loading {
    text-align: center;
    padding: 20px;
    color: rgba(255,255,255,0.5);
}

.widget-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.widget-item:last-child {
    border-bottom: none;
}

.widget-item .label {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

.widget-item .value {
    font-weight: bold;
    color: #00d4ff;
}

.widget-item .urgent {
    color: #ff6b6b;
}

.widget-progress {
    margin-top: 10px;
}

.widget-progress-bar {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.widget-progress-fill {
    background: linear-gradient(90deg, #00d4ff, #0099cc);
    height: 100%;
    border-radius: 10px;
    width: 0%;
}

/* ======================================== */
/* RESPONSIVE MOBILE - DASHBOARD */
/* ======================================== */

@media (max-width: 768px) {
    /* Graphiques : disposition en colonne */
    .charts-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .charts-grid .chart-card {
        width: 100%;
    }
    
    /* Graphique d'évolution */
    .evolution-card {
        margin-bottom: 30px;
    }
    
    /* Alertes et Éco-Conseils : disposition en colonne */
    .info-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .info-grid .alerts-card,
    .info-grid .tips-card {
        width: 100%;
    }
    
    /* Tableau de facturation - police adaptée */
    .billing-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .billing-table {
        min-width: 100%;
        font-size: 12px;
    }
    
    .billing-table th,
    .billing-table td {
        padding: 10px 8px;
        font-size: 11px;
    }
    
    .billing-table th {
        font-size: 11px;
    }
    
    /* Boutons d'action dans le tableau */
    .billing-table .btn-glow {
        padding: 4px 10px;
        font-size: 10px;
    }
    
    /* Badges de statut */
    .paid-badge, .unpaid-badge {
        padding: 3px 8px;
        font-size: 9px;
    }
}

/* Pour les très petits écrans (moins de 480px) */
@media (max-width: 480px) {
    .billing-table th,
    .billing-table td {
        padding: 8px 5px;
        font-size: 10px;
    }
    
    .billing-table .btn-glow {
        padding: 3px 8px;
        font-size: 9px;
    }
    
    .paid-badge, .unpaid-badge {
        padding: 2px 6px;
        font-size: 8px;
    }
}

/* ======================================== */
/* TABLEAU DE FACTURATION - RESPONSIVE */
/* ======================================== */

/* Styles normaux pour ordinateur (inchangés) */
.billing-table-container {
    overflow-x: visible;
}

.billing-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
}

.billing-table th,
.billing-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    color: white;
    font-size: 14px;
}

.billing-table th {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    font-weight: 600;
}

/* Mobile et petites écrans - scroll horizontal uniquement */
@media (max-width: 768px) {
    .billing-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -5px;
        padding: 0 5px;
    }
    
    .billing-table {
        min-width: 700px;
        width: auto;
        font-size: 14px; /* Taille normale conservée */
    }
    
    .billing-table th,
    .billing-table td {
        padding: 12px 15px;
        font-size: 14px; /* Taille normale conservée */
        white-space: nowrap;
    }
    
    .billing-table .btn-glow {
        padding: 5px 15px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .paid-badge, .unpaid-badge {
        padding: 4px 10px;
        font-size: 11px;
        white-space: nowrap;
    }
}

/* Pour les très petits écrans, largeur minimale légèrement réduite */
@media (max-width: 480px) {
    .billing-table {
        min-width: 620px;
    }
    
    .billing-table th,
    .billing-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ======================================== */
/* HEADER - RÉDUCTION DES BORDES SUR MOBILE */
/* ======================================== */

@media (max-width: 768px) {
    /* Conteneur des statistiques du header */
    .header-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        width: 100%;
        margin-top: 10px;
    }
    
    /* Style commun pour toutes les boîtes */
    .header-stat,
    #userInfo {
        display: flex;
        align-items: center;
        gap: 10px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        border-radius: 15px;
        border: 1px solid rgba(0, 212, 255, 0.2);
        width: 100%;
        box-sizing: border-box;
    }
    
    /* PREMIÈRE LIGNE : Période et Colocataires (bords normaux) */
    .header-stat:nth-child(1),
    .header-stat:nth-child(2) {
        padding: 10px 16px;
    }
    
    /* DEUXIÈME LIGNE : Budget total et Admin (bords réduits) */
    .header-stat:nth-child(3),
    #userInfo {
        padding: 10px 10px;
    }
    
    /* Icônes */
    .header-stat i,
    #userInfo i {
        font-size: 18px;
        color: #00d4ff;
        width: 28px;
        text-align: center;
        flex-shrink: 0;
    }
    
    /* Conteneur du texte */
    .stat-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    
    /* Label */
    .stat-label {
        font-size: 10px;
        color: rgba(255, 255, 255, 0.7);
        margin-bottom: 2px;
    }
    
    /* Valeur */
    .stat-value {
        font-size: 13px;
        font-weight: bold;
        color: white;
    }
    
    /* Style pour le select période */
    .period-select {
        background: transparent;
        border: none;
        color: white;
        font-size: 13px;
        font-weight: bold;
        padding: 0;
        cursor: pointer;
        font-family: inherit;
        width: auto;
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2300d4ff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right center;
        background-size: 12px;
        padding-right: 16px;
    }
    
    /* Boîte Admin spécifique */
    #userInfo {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 10px;  /* Bords réduits */
    }
    
    #userInfo .stat-info {
        flex: 1;
    }
    
    #userInfo .stat-label {
        font-size: 10px;
    }
    
    #userInfo .stat-value {
        font-size: 13px;
    }
    
    /* Bouton de déconnexion */
    #userInfo button {
        background: rgba(255, 107, 107, 0.2);
        border: none;
        color: #ff6b6b;
        padding: 4px 8px;
        border-radius: 8px;
        cursor: pointer;
        font-size: 10px;
        transition: all 0.3s;
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
    }
    
    #userInfo button i {
        font-size: 10px;
        width: auto;
    }
    
    #userInfo button:hover {
        background: #ff6b6b;
        color: white;
    }
}

/* Pour les très petits écrans (moins de 480px) */
@media (max-width: 480px) {
    .header-stats {
        gap: 8px;
    }
    
    /* Première ligne : bords normaux */
    .header-stat:nth-child(1),
    .header-stat:nth-child(2) {
        padding: 8px 14px;
    }
    
    /* Deuxième ligne : bords encore plus réduits */
    .header-stat:nth-child(3),
    #userInfo {
        padding: 4px 4px;
    }
    
    .header-stat i,
    #userInfo i {
        font-size: 16px;
        width: 24px;
    }
    
    .stat-label {
        font-size: 9px;
    }
    
    .stat-value,
    .period-select {
        font-size: 12px;
    }
    
    .period-select {
        background-size: 10px;
        padding-right: 14px;
    }
    
    #userInfo button {
        padding: 3px 6px;
        font-size: 9px;
    }
}


/* ======================================== */
/* INDICATEUR DE CONNEXION */
/* ======================================== */

.connection-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    padding: 10px 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 12px;
    z-index: 10000;
    transition: all 0.3s;
    display: none;
}

.connection-status.online {
    background: rgba(81, 207, 102, 0.9);
    color: white;
    display: block;
}

.connection-status.offline {
    background: rgba(255, 107, 107, 0.9);
    color: white;
    display: block;
}

.connection-status i {
    margin-right: 8px;
}

/* ======================================== */
/* ACCORDÉON DES PARAMÈTRES */
/* ======================================== */

/* ============================================================ */
/* ACCORDION PARAMÈTRES — DESIGN COMPLET                       */
/* ============================================================ */
.settings-accordion {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.18);
    background: rgba(8, 12, 35, 0.7);
    backdrop-filter: blur(12px);
}

.settings-accordion-item {
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
    transition: background 0.3s ease;
}
.settings-accordion-item:last-child { border-bottom: none; }

/* Couleurs par section via CSS custom properties */
.settings-accordion-item:nth-child(1) { --ac: #00d4ff; --ar: 0,212,255; }
.settings-accordion-item:nth-child(2) { --ac: #51cf66; --ar: 81,207,102; }
.settings-accordion-item:nth-child(3) { --ac: #ff922b; --ar: 255,146,43; }
.settings-accordion-item:nth-child(4) { --ac: #cc5de8; --ar: 204,93,232; }
.settings-accordion-item:nth-child(5) { --ac: #f06595; --ar: 240,101,149; }

/* Header */
.settings-accordion-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 26px;
    cursor: pointer;
    user-select: none;
    border-left: 4px solid transparent;
    transition: background .28s ease, border-color .28s ease,
                padding-left .32s cubic-bezier(.34,1.56,.64,1);
}
.settings-accordion-header:hover {
    background: rgba(var(--ar), 0.06);
    border-left-color: rgba(var(--ar), 0.4);
    padding-left: 30px;
}
.settings-accordion-item.active .settings-accordion-header {
    background: rgba(var(--ar), 0.09);
    border-left-color: var(--ac);
    padding-left: 30px;
}

/* Icône */
.settings-accordion-header i:first-child {
    width: 42px; height: 42px; min-width: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 13px;
    font-size: 17px;
    color: var(--ac);
    background: rgba(var(--ar), 0.14);
    border: 1px solid rgba(var(--ar), 0.25);
    transition: transform .38s cubic-bezier(.34,1.56,.64,1),
                box-shadow .3s ease, background .3s ease;
}
.settings-accordion-item.active .settings-accordion-header i:first-child {
    transform: scale(1.1) rotate(-6deg);
    background: rgba(var(--ar), 0.22);
    box-shadow: 0 0 20px rgba(var(--ar), 0.38);
}

/* Titre */
.settings-accordion-header span {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
    color: rgba(255,255,255,0.72);
    transition: color .25s ease;
}
.settings-accordion-item.active .settings-accordion-header span {
    color: var(--ac);
}

/* Chevron */
.settings-accordion-header i:last-child {
    width: 30px; height: 30px; min-width: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform .44s cubic-bezier(.34,1.56,.64,1),
                background .25s, color .25s, border-color .25s;
}
.settings-accordion-item.active .settings-accordion-header i:last-child {
    transform: rotate(180deg);
    color: var(--ac);
    background: rgba(var(--ar), 0.15);
    border-color: rgba(var(--ar), 0.3);
}

/* Contenu — grid trick pour animation fluide */
.settings-accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows .46s cubic-bezier(.4,0,.2,1),
                opacity .38s ease;
    border-top: 1px solid transparent;
    background: rgba(0,0,0,0.15);
}
.settings-accordion-item.active .settings-accordion-content {
    grid-template-rows: 1fr;
    opacity: 1;
    border-top-color: rgba(var(--ar), 0.15);
}
.settings-accordion-content > div { overflow: hidden; }

/* Padding intérieur */
.settings-accordion-content .settings-grid-accordion,
.settings-accordion-content .settings-single-card {
    padding: 26px 28px 28px;
}
@keyframes acc-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.settings-accordion-item.active .settings-accordion-content > div > * {
    animation: acc-in .42s ease forwards;
}

/* ── JCM Grid ── */
.settings-grid-accordion {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}
/* Tranche cards: 2 colonnes centrées, pleine largeur */
.jcm-grid {
    grid-template-columns: repeat(3, 1fr);
}
.jcm-grid .settings-card:nth-child(4),
.jcm-grid .settings-card:nth-child(5) {
    grid-column: span 1;
}
/* 4+5 = rangée du bas, centrée sur 2 colonnes */
.jcm-grid .settings-card:nth-child(4):last-of-type ~ .settings-card,
.jcm-grid .settings-card:nth-child(n+4) {
    /* handled by last row centering below */
}
/* Centrage de la dernière rangée (cartes 4 et 5) */
.jcm-grid::after {
    content: '';
    grid-column: span 1;
    display: none;
}
/* Force 2 colonnes pour les tranches + action card */
@media (min-width: 900px) {
    .jcm-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .jcm-grid .settings-card:nth-child(4),
    .jcm-grid .settings-card:nth-child(5) {
        grid-column: span 1;
    }
    /* Tranche cards + action: groupe de 3 sur la 2ème rangée, centré */
    .jcm-grid .settings-card:nth-child(1),
    .jcm-grid .settings-card:nth-child(2),
    .jcm-grid .settings-card:nth-child(3) {
        grid-row: 1;
    }
    .jcm-grid .settings-card:nth-child(4),
    .jcm-grid .settings-card:nth-child(5),
    .jcm-grid .settings-card:nth-child(6) {
        grid-row: 2;
    }
}

.settings-single-card { max-width: 560px; margin: 0 auto; width: 100%; }

/* ── Settings card redesign ── */
.settings-accordion .settings-card {
    background: rgba(255,255,255,0.04);
    border-radius: 18px;
    padding: 22px 24px;
    border: 1px solid rgba(0,212,255,0.15);
    transition: border-color .3s, background .3s, transform .3s;
    display: flex;
    flex-direction: column;
}
.settings-accordion .settings-card:hover {
    border-color: rgba(0,212,255,0.3);
    background: rgba(255,255,255,0.06);
    transform: translateY(-2px);
}
.settings-accordion .settings-card .card-header {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0,212,255,0.12);
}
.settings-accordion .settings-card .card-header h3 {
    font-size: 12px !important;
    font-weight: 700;
    color: #00d4ff !important;
    text-transform: uppercase;
    letter-spacing: .06em;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.settings-accordion .form-group { margin-bottom: 16px; }
.settings-accordion .form-group:last-child { margin-bottom: 0; }
.settings-accordion .form-group label {
    font-size: 11px !important;
    font-weight: 600;
    color: rgba(255,255,255,0.55) !important;
    margin-bottom: 6px;
    display: block;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.settings-accordion .form-group small {
    font-size: 11px !important;
    color: rgba(255,255,255,0.38) !important;
    margin-top: 5px;
    display: block;
    line-height: 1.5;
}
.settings-accordion .premium-input,
.settings-accordion .premium-select {
    width: 100%;
    padding: 10px 13px;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(0,212,255,0.22);
    border-radius: 11px;
    font-size: 13px;
    color: white;
    transition: border-color .25s, background .25s, box-shadow .25s;
    outline: none;
    font-family: inherit;
}
.settings-accordion .premium-input:focus,
.settings-accordion .premium-select:focus {
    border-color: rgba(0,212,255,0.65);
    background: rgba(0,212,255,0.07);
    box-shadow: 0 0 0 3px rgba(0,212,255,0.14);
}
.settings-accordion .premium-input::placeholder { color: rgba(255,255,255,0.28); }
.settings-accordion .premium-select option { background: #1a1f3a; }
.settings-accordion .result-display {
    background: rgba(0,212,255,0.1);
    border: 1.5px solid rgba(0,212,255,0.3);
    border-radius: 11px;
    padding: 10px 14px;
    font-size: 20px;
    font-weight: 700;
    color: #00d4ff;
    text-align: center;
}
.settings-accordion .btn-glow {
    background: linear-gradient(135deg,#00d4ff,#0099cc);
    color: white; border: none;
    padding: 10px 18px; border-radius: 11px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: all .3s; font-family: inherit; justify-content: center;
}
.settings-accordion .btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,212,255,0.35);
}
.settings-accordion .btn-glow:disabled { opacity: .38; cursor: not-allowed; transform: none; box-shadow: none; }
.settings-accordion .btn-outline {
    background: transparent;
    border: 1.5px solid rgba(0,212,255,0.45);
    color: #00d4ff;
    padding: 10px 18px; border-radius: 11px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: all .3s; font-family: inherit; justify-content: center;
}
.settings-accordion .btn-outline:hover {
    background: rgba(0,212,255,0.1);
    border-color: #00d4ff;
    transform: translateY(-2px);
}
.settings-accordion .btn-outline:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.settings-accordion .settings-actions {
    display: flex; gap: 12px; flex-wrap: wrap;
}
.settings-accordion .settings-actions .btn-glow,
.settings-accordion .settings-actions .btn-outline { flex: 1; min-width: 110px; }
.settings-accordion .action-card { background: rgba(0,212,255,0.04); border-color: rgba(0,212,255,0.2); }

/* Info note (outside card) */
.acc-info-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 11px 16px;
    background: rgba(0,212,255,0.06);
    border: 1px solid rgba(0,212,255,0.18);
    border-radius: 12px;
    font-size: 12px;
    color: rgba(255,255,255,0.58);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.acc-info-note i { color: #00d4ff; font-size: 13px; flex-shrink: 0; }
.acc-info-note span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-info-note strong { color: rgba(255,255,255,0.8); }

/* Legacy info-message kept for other uses */
.info-message {
    background: rgba(0,212,255,0.08);
    border: 1px solid rgba(0,212,255,0.18);
    border-radius: 12px;
    padding: 13px 16px;
    margin-top: 15px;
    display: flex; align-items: flex-start; gap: 11px;
}
.info-message i { color: #00d4ff; font-size: 14px; margin-top: 2px; flex-shrink: 0; }
.info-message small { color: rgba(255,255,255,0.62) !important; line-height: 1.55; font-size: 12px !important; }

/* Tranche items */
.settings-accordion .tranche-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(0,212,255,0.15);
    border-radius: 13px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: border-color .25s;
}
.settings-accordion .tranche-item:hover { border-color: rgba(0,212,255,0.3); }
.settings-accordion .tranche-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}
.settings-accordion .tranche-range label {
    font-size: 10px !important;
    color: rgba(255,255,255,0.45) !important;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 4px;
}

/* Cloud + users */
.settings-accordion #cloudUserInfo { margin-bottom: 16px; }
.settings-accordion #usersListPreview {
    max-height: 260px; overflow-y: auto;
    border-radius: 11px; background: rgba(0,0,0,0.2);
    padding: 4px; margin-bottom: 12px;
}

/* Responsive */
@media (max-width: 1024px) {
    .jcm-grid { grid-template-columns: repeat(2, 1fr); }
    .jcm-grid .settings-card:nth-child(1),
    .jcm-grid .settings-card:nth-child(2),
    .jcm-grid .settings-card:nth-child(3) { grid-row: auto; }
    .jcm-grid .settings-card:nth-child(4),
    .jcm-grid .settings-card:nth-child(5),
    .jcm-grid .settings-card:nth-child(6) { grid-row: auto; }
}
@media (max-width: 900px) {
    .settings-accordion-header { padding: 17px 20px; gap: 13px; }
    .settings-accordion-header:hover,
    .settings-accordion-item.active .settings-accordion-header { padding-left: 22px; }
    .settings-accordion-content .settings-grid-accordion,
    .settings-accordion-content .settings-single-card { padding: 18px; }
    .settings-grid-accordion { grid-template-columns: 1fr; gap: 14px; }
    .jcm-grid { grid-template-columns: 1fr; }
    .settings-single-card { max-width: 100%; }
    .acc-info-note { white-space: normal; }
}
@media (max-width: 600px) {
    .settings-accordion-header { padding: 14px 15px; gap: 10px; }
    .settings-accordion-header i:first-child { width: 36px; height: 36px; min-width: 36px; font-size: 14px; border-radius: 10px; }
    .settings-accordion-header span { font-size: 13px; }
    .settings-accordion-header i:last-child { width: 26px; height: 26px; min-width: 26px; font-size: 10px; }
    .settings-accordion-content .settings-grid-accordion,
    .settings-accordion-content .settings-single-card { padding: 13px; }
    .settings-accordion .settings-card { padding: 15px; border-radius: 14px; }
    .settings-accordion .tranche-inputs { grid-template-columns: 1fr; }
    .settings-accordion .settings-actions { flex-direction: column; }
    .settings-accordion .settings-actions .btn-glow,
    .settings-accordion .settings-actions .btn-outline { flex: none; width: 100%; }
}

/* ======================================== */
/* LISTE DES UTILISATEURS - STYLE AMÉLIORÉ */
/* ======================================== */

/* Conteneur de la liste des utilisateurs */
#usersListPreview {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 15px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
}

/* Élément utilisateur individuel */
.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all 0.2s;
    border: 1px solid rgba(0, 212, 255, 0.15);
}

.user-item:hover {
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.3);
}

/* Informations de l'utilisateur */
.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    color: #00d4ff;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-username {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 20px;
}

.user-role {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
}

.user-email {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-email i {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
}

/* Bouton de réinitialisation - STYLE COMPACT */
.btn-reset-password {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-reset-password i {
    font-size: 11px;
}

.btn-reset-password:hover {
    background: #ff6b6b;
    color: white;
    transform: translateY(-1px);
    border-color: transparent;
}

.btn-reset-password:active {
    transform: translateY(0);
}

/* Style pour le bouton supprimer (si utilisé) */
.btn-delete-user {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-delete-user:hover {
    background: #ff6b6b;
    color: white;
}

/* Actions groupées */
.user-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Scrollbar personnalisée pour la liste */
#usersListPreview::-webkit-scrollbar {
    width: 4px;
}

#usersListPreview::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

#usersListPreview::-webkit-scrollbar-thumb {
    background: #00d4ff;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 480px) {
    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }
    
    .user-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .btn-reset-password {
        padding: 5px 10px;
        font-size: 10px;
    }
}

/* ============================================================ */
/* LOGIN MODAL — DESIGN EXCLUSIF                               */
/* ============================================================ */
.login-modal-overlay {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-modal-overlay.modal { display: none; }
.login-modal-overlay.modal[style*="block"] { display: flex !important; }

.login-modal-card {
    background: linear-gradient(150deg, #0d1635 0%, #131c40 50%, #0a1228 100%);
    border-radius: 28px;
    width: 100%;
    max-width: 440px;
    border: 1px solid rgba(0,212,255,0.3);
    box-shadow: 0 0 0 1px rgba(0,212,255,0.07),
                0 40px 80px rgba(0,0,0,0.6),
                0 0 100px rgba(0,212,255,0.08);
    overflow: hidden;
    animation: modal-card-in .42s cubic-bezier(.34,1.2,.64,1) forwards;
    position: relative;
}
.login-modal-card::before {
    content: '';
    position: absolute;
    top: 0; left: 15%; right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
}

/* Hero section */
.login-modal-hero {
    text-align: center;
    padding: 36px 28px 22px;
    background: linear-gradient(180deg, rgba(0,212,255,0.08) 0%, transparent 100%);
}
.login-logo-ring {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0,212,255,0.2), rgba(0,153,204,0.1));
    border: 2px solid rgba(0,212,255,0.4);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
    box-shadow: 0 0 30px rgba(0,212,255,0.25);
    animation: logo-pulse 3s ease-in-out infinite;
}
@keyframes logo-pulse {
    0%,100% { box-shadow: 0 0 20px rgba(0,212,255,0.2); }
    50%      { box-shadow: 0 0 40px rgba(0,212,255,0.4); }
}
.login-modal-title {
    font-size: 20px; font-weight: 700;
    color: white; margin: 0 0 6px;
    letter-spacing: .02em;
}
.login-modal-sub {
    font-size: 13px; color: rgba(255,255,255,0.5); margin: 0;
}

/* Tabs */
.login-tabs {
    display: flex;
    margin: 0 24px;
    background: rgba(255,255,255,0.05);
    border-radius: 14px;
    padding: 4px;
    gap: 4px;
}
.login-tab {
    flex: 1;
    padding: 9px 14px;
    border-radius: 11px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    transition: all .25s;
    font-family: inherit;
}
.login-tab.active {
    background: rgba(0,212,255,0.18);
    color: #00d4ff;
    box-shadow: 0 2px 8px rgba(0,212,255,0.2);
}
.login-tab i { font-size: 12px; }

/* Panels */
.login-panel { padding: 22px 24px 28px; }

/* Form groups */
.login-form-group { margin-bottom: 16px; }
.login-form-group label {
    display: block;
    font-size: 12px; font-weight: 600;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase; letter-spacing: .06em;
    margin-bottom: 7px;
    display: flex; align-items: center; gap: 6px;
}
.login-form-group label i { color: #00d4ff; font-size: 11px; }
.login-input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(0,212,255,0.25);
    border-radius: 13px;
    font-size: 15px; color: white;
    transition: all .28s; outline: none; font-family: inherit;
}
.login-input:focus {
    border-color: #00d4ff;
    background: rgba(0,212,255,0.07);
    box-shadow: 0 0 0 4px rgba(0,212,255,0.14);
}
.login-input::placeholder { color: rgba(255,255,255,0.3); }

/* Password toggle */
.login-pass-wrap { position: relative; }
.login-pass-wrap .login-input { padding-right: 44px; }
.login-eye {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: rgba(255,255,255,0.35);
    cursor: pointer; font-size: 14px; padding: 4px;
    transition: color .2s;
}
.login-eye:hover { color: #00d4ff; }

/* Error */
.login-error {
    background: rgba(255,100,100,0.12);
    border: 1px solid rgba(255,100,100,0.3);
    border-radius: 11px;
    padding: 10px 14px;
    font-size: 12px; color: #ff8a8a;
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 14px;
    animation: shake .4s ease;
}
@keyframes shake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Primary button */
.login-btn-primary {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: white; border: none;
    border-radius: 13px; font-size: 15px; font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 9px;
    transition: all .3s; font-family: inherit;
    box-shadow: 0 4px 20px rgba(0,212,255,0.3);
}
.login-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,212,255,0.45);
}
.login-btn-primary:active { transform: translateY(0); }

/* Demo accounts */
.login-demo-accounts {
    margin-top: 20px;
    text-align: center;
}
.login-demo-label {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: .08em;
    display: block;
    margin-bottom: 10px;
}
.login-demo-list {
    display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.login-demo-chip {
    padding: 6px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    font-size: 12px; color: rgba(255,255,255,0.6);
    cursor: pointer;
    display: flex; align-items: center; gap: 5px;
    transition: all .22s; font-family: inherit;
}
.login-demo-chip:hover {
    background: rgba(0,212,255,0.12);
    border-color: rgba(0,212,255,0.3);
    color: #00d4ff;
}
.login-demo-chip i { font-size: 10px; }

/* Guest panel */
.login-guest-info {
    text-align: center; margin-bottom: 20px;
}
.login-guest-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(255,146,43,0.15);
    border: 2px solid rgba(255,146,43,0.35);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px; color: #ff922b;
    margin-bottom: 14px;
}
.login-guest-info h4 { color: white; font-size: 16px; margin: 0 0 8px; }
.login-guest-info p { color: rgba(255,255,255,0.55); font-size: 13px; line-height: 1.5; margin: 0 0 14px; }
.login-guest-features {
    list-style: none; padding: 0; text-align: left;
    background: rgba(255,255,255,0.04);
    border-radius: 13px; padding: 14px 18px;
    margin: 0;
}
.login-guest-features li {
    font-size: 12px; color: rgba(255,255,255,0.65);
    padding: 4px 0;
    display: flex; align-items: center; gap: 9px;
}
.login-guest-features li i { font-size: 11px; color: #51cf66; flex-shrink: 0; }
.login-btn-guest {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #ff922b, #e67700);
    color: white; border: none;
    border-radius: 13px; font-size: 15px; font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 9px;
    transition: all .3s; font-family: inherit;
    box-shadow: 0 4px 20px rgba(255,146,43,0.3);
}
.login-btn-guest:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255,146,43,0.45);
}

/* Guide modal */
.guide-modal-content { max-width: 640px; }
.guide-body { padding: 24px 28px 28px; }
.guide-intro { color: rgba(255,255,255,0.6); font-size: 13px; margin-bottom: 20px; }
.guide-steps { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.guide-step {
    display: flex; gap: 16px; align-items: flex-start;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(0,212,255,0.12);
    border-radius: 14px; padding: 16px 18px;
    transition: border-color .25s, background .25s;
}
.guide-step:hover { border-color: rgba(0,212,255,0.28); background: rgba(255,255,255,0.06); }
.step-number {
    width: 32px; height: 32px; min-width: 32px;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: white;
    flex-shrink: 0;
}
.step-content h4 {
    color: white; font-size: 14px; margin: 0 0 6px;
    display: flex; align-items: center; gap: 7px;
}
.step-content h4 i { color: #00d4ff; font-size: 13px; }
.step-content p { color: rgba(255,255,255,0.6); font-size: 12px; line-height: 1.6; margin: 0; }
.step-content strong { color: rgba(255,255,255,0.9); }
.step-content em { color: #00d4ff; font-style: normal; }
.guide-tips-section { background: rgba(255,200,0,0.06); border: 1px solid rgba(255,200,0,0.18); border-radius: 14px; padding: 18px 20px; }
.guide-tips-title { color: #ffd43b; font-size: 13px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.guide-tips-title i { font-size: 14px; }
.guide-tip { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; font-size: 12px; color: rgba(255,255,255,0.65); line-height: 1.5; }
.guide-tip:last-child { margin-bottom: 0; }
.guide-tip i { color: #51cf66; font-size: 12px; margin-top: 2px; flex-shrink: 0; }
.guide-tip strong { color: rgba(255,255,255,0.85); }

/* Responsive small screens — global */
@media (max-width: 480px) {
    .login-modal-hero { padding: 24px 20px 16px; }
    .login-modal-title { font-size: 17px; }
    .login-tabs { margin: 0 16px; }
    .login-panel { padding: 18px 16px 22px; }
    .step-number { width: 28px; height: 28px; min-width: 28px; font-size: 12px; }
}

/* ============================================================ */
/* RESPONSIVE MOBILE — SMARTPHONES (≤ 480px)                   */
/* ============================================================ */

@media (max-width: 480px) {

    /* Container global */
    .container { padding: 0; }

    /* Header */
    .premium-header { border-radius: 0 0 20px 20px; }
    .header-content { flex-direction: column; gap: 14px; padding: 14px 16px; }
    .logo-wrapper { gap: 12px; }
    .logo-text h1 { font-size: 18px; }
    .logo-text p { font-size: 11px; }
    .jirama-logo { width: 42px; height: 42px; }
    .header-stats { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .header-stat { flex-direction: column; gap: 2px; padding: 8px; text-align: center; font-size: 11px; }
    .header-stat i { font-size: 14px; }
    .stat-label { font-size: 10px; }
    .stat-value, .period-select { font-size: 12px; }

    /* Navigation */
    .glass-nav { border-radius: 0; padding: 0; }
    .nav-container { gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; padding: 0; }
    .nav-btn { flex-direction: column; gap: 2px; padding: 10px 8px; font-size: 10px; min-width: 56px; scroll-snap-align: start; flex-shrink: 0; }
    .nav-btn i { font-size: 16px; }
    .nav-btn span { font-size: 9px; }

    /* Stats grid */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; }
    .stat-card { padding: 14px; border-radius: 14px; }
    .stat-card .stat-icon { font-size: 22px; }
    .stat-card h3 { font-size: 11px; }
    .stat-card p { font-size: 20px; }

    /* Quick actions */
    .quick-actions { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 12px; }
    .action-btn { padding: 12px 8px; font-size: 11px; border-radius: 12px; }
    .action-btn i { font-size: 16px; }
    .action-btn span { font-size: 10px; }

    /* Widgets */
    .widgets-grid { grid-template-columns: 1fr; gap: 10px; }

    /* Charts */
    .charts-grid { grid-template-columns: 1fr; gap: 12px; }

    /* Section headers */
    .section-header { flex-direction: column; gap: 10px; align-items: flex-start; padding: 12px; }
    .section-header .header-actions { width: 100%; display: flex; flex-direction: column; gap: 8px; }
    .section-header .header-actions button { width: 100%; justify-content: center; }

    /* Person / appliance grids */
    .persons-grid, .appliances-grid { grid-template-columns: 1fr; gap: 10px; padding: 12px; }
    .person-card, .appliance-card { padding: 14px; border-radius: 14px; }

    /* Billing */
    .billing-hero { flex-direction: column; gap: 12px; padding: 12px; }
    .bill-actions { width: 100%; display: flex; flex-direction: column; gap: 8px; }
    .bill-actions button { width: 100%; justify-content: center; }
    .billing-table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 12px; }
    .billing-table { min-width: 480px; font-size: 11px; }
    .billing-table th, .billing-table td { padding: 8px 10px; }

    /* History */
    .history-timeline { padding: 12px; }
    .history-item { padding: 12px; }

    /* Main content padding */
    .main-content { padding: 12px; gap: 12px; }
    .tab-content { gap: 12px; }

    /* Footer */
    .premium-footer { border-radius: 0; }
    .footer-content { grid-template-columns: 1fr; gap: 20px; padding: 20px 16px; }
    .footer-bottom { flex-direction: column; text-align: center; gap: 10px; padding: 14px 16px; font-size: 11px; }
    .footer-links { flex-wrap: wrap; justify-content: center; gap: 8px; }

    /* Charts responsive */
    canvas { max-height: 220px !important; }

    /* Forecast card */
    .forecast-card, .evolution-card { padding: 14px; }

    /* Common expenses */
    .common-expenses-card { padding: 14px; }

    /* Info grid */
    .info-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* ── Tablettes (481–768px) ── */
@media (min-width: 481px) and (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .quick-actions { grid-template-columns: repeat(3, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .widgets-grid { grid-template-columns: repeat(2, 1fr); }
    .persons-grid, .appliances-grid { grid-template-columns: repeat(2, 1fr); }
    .billing-table-container { overflow-x: auto; }
    .billing-table { min-width: 500px; }
}

/* ── Fix modal on very small screens ── */
@media (max-width: 400px) {
    .login-modal-card { border-radius: 20px; }
    .login-tabs { margin: 0 12px; }
    .login-panel { padding: 16px 14px 20px; }
    .login-modal-title { font-size: 16px; }
    .login-demo-list { gap: 6px; }
    .login-demo-chip { padding: 5px 10px; font-size: 11px; }
    .modal-content { border-radius: 16px; }
    .modal-header { padding: 14px 16px; }
    .modal-body { padding: 14px 16px; }
}
