/* ============================================================================
 *  ██╗   ██╗██╗████████╗██╗███╗   ██╗██╗
 *  ██║   ██║██║╚══██╔══╝██║████╗  ██║██║
 *  ██║   ██║██║   ██║   ██║██╔██╗ ██║██║
 *  ╚██╗ ██╔╝██║   ██║   ██║██║╚██╗██║██║
 *   ╚████╔╝ ██║   ██║   ██║██║ ╚████║██║
 *    ╚═══╝  ╚═╝   ╚═╝   ╚═╝╚═╝  ╚═══╝╚═╝
 *
 *  Fichier  : assets/css/style.css
 *  Module   : Design System — Global UNIFIÉ
 *  Rôle     : Feuille de style unique et partagée par toutes les pages.
 *             Regroupe désormais l'intégralité des règles auparavant
 *             éparpillées dans les balises <style> des fichiers PHP.
 *  Auteur   : Thomas — Profil E1
 * ============================================================================ */


/* ============================================================================
 * §1 — VARIABLES GLOBALES (Design Tokens)
 * ============================================================================ */
:root {
    --bordeaux:        #712444;
    --bordeaux-hover:  #5a1c36;
    --bordeaux-light:  #f4e8ec;

    --green:           #49684D;
    --green-hover:     #3a533d;
    --green-light:     #eaf1eb;

    --bg-body:         #f4f6f8;
    --bg-card:         #ffffff;
    --text-main:       #2c3e50;
    --text-muted:      #7f8c8d;
    --border-color:    #e2e8f0;

    --danger:          #e74c3c;
    --danger-bg:       #fdeaea;
    --warning:         #f39c12;
    --warning-bg:      #fef5e7;
    --success:         #2ecc71;
    --success-bg:      #eafaf1;
    --info:            #3498db;
    --info-bg:         #ebf5fb;

    --shadow-sm:       0 2px 4px rgba(0,0,0,0.05);
    --shadow-md:       0 4px 12px rgba(0,0,0,0.08);

    --radius-md:       8px;
    --radius-lg:       12px;
}


/* ============================================================================
 * §2 — RESET ET BASE TYPOGRAPHIQUE
 * ============================================================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}


/* ============================================================================
 * §3 — NAVIGATION SUPÉRIEURE (Navbar)
 * ============================================================================ */
.navbar {
    background-color: var(--bg-card);
    padding: 0 24px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand { display: flex; align-items: center; gap: 12px; }

.nav-brand .logo-icon {
    background-color: var(--bordeaux);
    color: white;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}

.nav-brand h2 { font-size: 20px; color: var(--bordeaux); margin: 0; line-height: 1.2; }
.nav-brand span { font-size: 12px; color: var(--text-muted); font-weight: normal; }

.nav-links { display: flex; gap: 8px; align-items: center; }

.nav-item {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    display: flex; align-items: center; gap: 8px;
    color: var(--text-main);
    transition: all 0.2s;
}

.nav-item:hover { background-color: var(--bg-body); }
.nav-item.active { background-color: var(--bordeaux); color: white; }
.nav-logout { color: var(--danger); margin-left: 16px; }


/* ============================================================================
 * §4 — LAYOUT ET CONTENEUR PRINCIPAL
 * ============================================================================ */
.main-content { max-width: 1400px; margin: 0 auto; padding: 32px 24px; }

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 24px; margin-bottom: 4px; }
.page-header p { color: var(--text-muted); font-size: 14px; }

.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 20px; margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); gap: 20px; margin-bottom: 24px; }


/* ============================================================================
 * §5 — CARTES (Cards)
 * ============================================================================ */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    border: 1px solid rgba(0,0,0,0.02);
}

.stat-card { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-info h3 { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.stat-info .value { font-size: 28px; font-weight: 700; color: var(--text-main); margin-bottom: 8px; }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.stat-icon.green   { background-color: var(--green-light);    color: var(--green); }
.stat-icon.bordeaux { background-color: var(--bordeaux-light); color: var(--bordeaux); }
.stat-icon.gray    { background-color: var(--bg-body);         color: var(--text-muted); }

.zone-header {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 16px 24px;
    color: white;
    margin: -24px -24px 24px -24px;
}
.zone-header.viticulture { background-color: var(--green); }
.zone-header.viniculture { background-color: var(--bordeaux); }


/* ============================================================================
 * §6 — BADGES (Pilules d'état)
 * ============================================================================ */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
    white-space: nowrap;
}

.badge-success { background-color: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.badge-warning { background-color: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); }
.badge-danger  { background-color: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger);  }
.badge-info    { background-color: var(--info-bg);    color: var(--info);    border: 1px solid var(--info);    }
.badge-outline { background-color: transparent; border: 1px solid var(--border-color); color: var(--text-muted); }


/* ============================================================================
 * §7 — TABLEAUX DE DONNÉES
 * ============================================================================ */
.table-container { width: 100%; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; text-align: left; }

th { padding: 16px; font-size: 13px; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid var(--border-color); }
td { padding: 16px; font-size: 14px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }

tr:last-child td { border-bottom: none; }
tr:hover td { background-color: rgba(0,0,0,0.01); }


/* ============================================================================
 * §8 — BARRES DE PROGRESSION (Cuves de vinification)
 * ============================================================================ */
.progress-container { margin: 12px 0; }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.progress-track { width: 100%; height: 8px; background-color: var(--border-color); border-radius: 4px; overflow: hidden; }
.progress-fill  { height: 100%; background-color: var(--text-main); border-radius: 4px; transition: width 0.5s ease; }


/* ============================================================================
 * §9 — BOUTONS ET FORMULAIRES
 * ============================================================================ */
.btn {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px; font-weight: 600;
    border: none; cursor: pointer;
    transition: background-color 0.2s;
    display: inline-flex; align-items: center; gap: 8px;
}

.btn-primary  { background-color: var(--green);    color: white; }
.btn-primary:hover { background-color: var(--green-hover); }
.btn-bordeaux { background-color: var(--bordeaux); color: white; }
.btn-outline  { background-color: transparent; border: 1px solid var(--border-color); color: var(--text-main); }
.btn-outline:hover { background-color: var(--bg-body); }

input[type="text"],
input[type="email"],
select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-main);
    width: 100%;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--bordeaux);
}


/* ============================================================================
 * §10 — RESPONSIVE (Mobiles & Tablettes)
 * ============================================================================ */
.hamburger { display: none; font-size: 24px; color: var(--bordeaux); cursor: pointer; }

@media (max-width: 768px) {
    .navbar { flex-direction: column; height: auto; padding: 15px 24px; }
    .nav-brand { width: 100%; justify-content: space-between; }
    .hamburger { display: block; }

    .nav-links { display: none; flex-direction: column; width: 100%; gap: 0; margin-top: 15px; }
    .nav-links.active { display: flex; }

    .nav-item { padding: 12px; width: 100%; justify-content: flex-start; border-radius: 0; border-bottom: 1px solid var(--border-color); }
    .nav-item:last-child { border-bottom: none; }

    .nav-logout { margin-left: 0; color: white; background-color: var(--danger); justify-content: center; border-radius: var(--radius-md); margin-top: 10px; }

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

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    .modal-container { padding: 20px; width: 95%; }
    .form-grid-2x2, .form-row { grid-template-columns: 1fr; flex-direction: column; gap: 10px; }
}


/* ============================================================================
 * §11 — PAGE LOGIN (index.php) — scopé via body.login-page
 * ============================================================================ */
body.login-page { height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--bordeaux) 0%, var(--green) 100%); margin: 0; }
.login-container { background-color: var(--bg-card); width: 100%; max-width: 420px; padding: 40px; border-radius: var(--radius-lg); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2); text-align: center; }
.login-container h1 { margin: 0; font-size: 26px; color: var(--text-main); font-weight: 600; letter-spacing: 1px; }
.login-container .subtitle { margin: 8px 0 35px 0; color: var(--text-muted); font-size: 14px; }

.input-wrapper { position: relative; display: flex; align-items: center; margin-bottom: 25px; margin-top: 30px; }
.input-wrapper label { position: absolute; top: -22px; left: 0; font-size: 13px; font-weight: 600; color: var(--text-main); }
.input-wrapper i { position: absolute; left: 15px; color: var(--text-muted); }
.input-wrapper input { width: 100%; padding: 14px 15px 14px 45px; background-color: var(--bg-body); border: 1px solid transparent; border-radius: var(--radius-md); font-size: 14px; color: var(--text-main); outline: none; transition: all 0.2s; }
.input-wrapper input:focus { border-color: var(--bordeaux); background-color: white; }

.error-msg { background-color: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); padding: 10px; border-radius: var(--radius-md); font-size: 14px; margin-bottom: 20px; }
.btn-submit { width: 100%; padding: 14px; font-size: 15px; margin-top: 10px; }
.remember-wrapper { text-align: left; margin-bottom: 20px; font-size: 14px; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.remember-wrapper input { cursor: pointer; width: 16px; height: 16px; accent-color: var(--bordeaux); }


/* ============================================================================
 * §12 — PAGE DASHBOARD (dashboard.php)
 * ============================================================================ */
.refresh-indicator { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); background: white; padding: 6px 12px; border-radius: 20px; box-shadow: var(--shadow-sm); }
.pulse { width: 8px; height: 8px; background-color: var(--success); border-radius: 50%; box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); animation: pulsing 1.5s infinite; }
@keyframes pulsing {
    0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70%  { transform: scale(1);    box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.sensor-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border-color); }
.sensor-row:last-child { border-bottom: none; }
.sensor-info strong { display: block; color: var(--text-main); font-size: 15px; }
.sensor-info span   { font-size: 12px; color: var(--text-muted); }
.sensor-value  { font-size: 20px; font-weight: 700; color: var(--text-main); text-align: right; }
.sensor-status { margin-top: 4px; text-align: right; }
.dashboard-header { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 24px; }


/* ============================================================================
 * §13 — PAGE VITICULTURE (viticulture.php)
 * ============================================================================ */
.moyenne-col { background-color: var(--bordeaux-light); color: var(--bordeaux); border-radius: 4px; }


/* ============================================================================
 * §14 — PAGE VINICULTURE (viniculture.php)
 * ============================================================================ */
.ambiance-banner { background-color: var(--bordeaux); color: white; padding: 24px; border-radius: var(--radius-lg); margin-bottom: 24px; }
.ambiance-banner h3 { margin-bottom: 16px; font-size: 18px; font-weight: 600; }
.ambiance-metrics { display: flex; gap: 20px; }
.metric-box { background-color: rgba(255,255,255,0.1); padding: 16px 24px; border-radius: var(--radius-md); display: flex; align-items: center; gap: 16px; flex: 1; }
.metric-box i { font-size: 24px; opacity: 0.8; }
.metric-box .label { font-size: 13px; opacity: 0.8; display: block; }
.metric-box .value { font-size: 24px; font-weight: 700; }

.cuve-header   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cuve-title    { font-size: 18px; font-weight: 600; color: var(--bordeaux); display: flex; align-items: center; gap: 8px; }
.cuve-capacity { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

.data-row             { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--border-color); font-size: 14px; }
.data-row:last-of-type { border-bottom: none; }
.data-label { color: var(--text-muted); }
.data-value { font-weight: 600; color: var(--text-main); }

.badge-rouge { background-color: #fce7f3; color: #be185d; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-rose  { background-color: #fdf2f8; color: #db2777; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-blanc { background-color: #fef9c3; color: #ca8a04; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }

.row-24h { background-color: var(--bordeaux-light); padding: 8px 12px; border-radius: 6px; margin: 4px 0; border-bottom: none; }


/* ============================================================================
 * §15 — PAGE HISTORIQUE (historique.php)
 * ============================================================================ */
.filter-form  { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 180px; }
.filter-group label { font-size: 13px; font-weight: 600; color: var(--text-main); }
.filter-group input, .filter-group select { padding: 9px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 14px; color: var(--text-main); background: white; outline: none; width: 100%; box-sizing: border-box; }
.search-wrapper   { position: relative; display: flex; align-items: center; }
.search-wrapper i { position: absolute; left: 12px; color: var(--text-muted); }
.search-wrapper input { padding-left: 35px; }

.period-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.period-btn  { padding: 7px 14px; border: 2px solid var(--border-color); border-radius: 20px; background: white; font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all 0.15s; text-decoration: none; }
.period-btn:hover  { border-color: var(--bordeaux); color: var(--bordeaux); }
.period-btn.active { background-color: var(--bordeaux); border-color: var(--bordeaux); color: white; }

.period-extra         { display: none; padding: 16px; background: var(--bg-body); border-radius: var(--radius-md); margin-top: 12px; }
.period-extra.visible { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.period-extra label   { font-size: 13px; font-weight: 600; color: var(--text-main); display: block; margin-bottom: 6px; }
.period-extra input, .period-extra select { padding: 8px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 14px; color: var(--text-main); background: white; }

.chart-container { position: relative; height: 350px; width: 100%; margin-top: 20px; }

.sensor-selectors { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.sensor-badge     { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border: 2px solid #e5e7eb; border-radius: 8px; background-color: white; cursor: pointer; transition: all 0.2s; user-select: none; }
.sensor-badge.active { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.sensor-badge input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.sensor-badge .color-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.sensor-badge .sensor-info { line-height: 1.2; }
.sensor-badge .sensor-info strong { font-size: 14px; color: var(--text-main); }
.sensor-badge .sensor-info span   { font-size: 11px; color: var(--text-muted); }
.disabled-badge { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.badge-type { background-color: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.export-row { display: flex; justify-content: flex-end; margin-bottom: 12px; }


/* ============================================================================
 * §16 — PAGE ALERTES (alertes.php)
 * ============================================================================ */
.tabs { display: flex; gap: 16px; margin-bottom: 24px; border-bottom: 1px solid var(--border-color); padding-bottom: 12px; }
.tab-btn { background: none; border: none; padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-radius: var(--radius-md); transition: all 0.2s; display: flex; align-items: center; gap: 8px; }
.tab-btn.active { background-color: white; color: var(--text-main); box-shadow: var(--shadow-sm); }
.tab-btn:hover:not(.active) { background-color: rgba(0,0,0,0.05); }

.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.alert-card { background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.alert-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.alert-badges { display: flex; gap: 8px; }
.alert-title    { font-size: 16px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.alert-location { font-size: 13px; color: var(--info);      margin-bottom: 12px; }
.alert-message  { font-size: 14px; color: var(--text-main); margin-bottom: 12px; }
.alert-footer   { font-size: 12px; color: var(--text-muted); }
.alert-date     { font-size: 12px; color: var(--text-muted); }

.badge-high            { background-color: var(--danger);  color: white; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge-medium          { background-color: var(--warning); color: white; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge-low             { background-color: var(--info);    color: white; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge-status-active   { background-color: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge-status-resolved { background-color: #dcfce7; color: #16a34a; border: 1px solid #86efac; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }

.data-table th, .data-table td { text-align: center; }
.data-table td:first-child { text-align: left; }


/* ============================================================================
 * §17 — PAGE CONFIGURATION (configuration.php)
 * ============================================================================
 * IMPORTANT — Conflit de nommage géré ici :
 * `.zone-title` est utilisée à la fois dans dashboard.php (avec styles inline)
 * et dans configuration.php. Pour ne PAS altérer le rendu de dashboard.php,
 * les règles de `.zone-title` sont scopées sous `body.config-page`.
 * (La classe `config-page` est ajoutée au <body> de configuration.php.)
 * ============================================================================ */

.admin-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 24px; }
.action-card   { padding: 28px 20px; border-radius: var(--radius-lg); color: white; text-align: center; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.action-card:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.15); }
.action-card i  { font-size: 22px; margin-bottom: 10px; background: rgba(255,255,255,0.2); width: 48px; height: 48px; line-height: 48px; border-radius: 50%; display: inline-block; }
.action-card h3 { font-size: 15px; margin-bottom: 4px; }
.action-card p  { font-size: 12px; opacity: 0.9; }
.bg-green    { background-color: var(--green); }
.bg-bordeaux { background-color: var(--bordeaux); }
.bg-slate    { background-color: #5b6b7c; }
.bg-dark     { background-color: #2c3e50; }

.success-banner { background-color: var(--success-bg); border: 1px solid var(--success); color: var(--success); padding: 14px 16px; border-radius: var(--radius-md); margin-bottom: 20px; font-size: 14px; }
.error-banner   { background-color: var(--danger-bg);  border: 1px solid var(--danger);  color: var(--danger);  padding: 14px 16px; border-radius: var(--radius-md); margin-bottom: 20px; font-size: 14px; }

/* ── Titres de zone — SCOPÉ pour ne pas affecter dashboard.php ── */
body.config-page .zone-title      { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); }
body.config-page .zone-title.viti { color: var(--green); }
body.config-page .zone-title.vini { color: var(--bordeaux); }
body.config-page .zone-title span { background-color: var(--bg-body); color: var(--text-muted); font-size: 12px; padding: 2px 8px; border-radius: 12px; border: 1px solid var(--border-color); }

.threshold-table th, .threshold-table td { text-align: center; vertical-align: middle; }
.threshold-table td:first-child { text-align: left; }
.th-tb { color: #2563eb; font-weight: 600; }
.th-b  { color: #0284c7; font-weight: 600; }
.th-h  { color: #ea580c; font-weight: 600; }
.th-th { color: #dc2626; font-weight: 600; }
.badge-header { display: inline-block; padding: 4px 12px; border-radius: 12px; color: white; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.bg-tb { background-color: #2563eb; } .bg-b { background-color: #0ea5e9; }
.bg-h  { background-color: #f97316; } .bg-th { background-color: #ef4444; }

.user-table th, .user-table td { vertical-align: middle; }
.role-badge-admin { background-color: #fef3c7; color: #92400e; border: 1px solid #fbbf24; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.role-badge-user  { background-color: #f0f9ff; color: #0369a1; border: 1px solid #7dd3fc; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.notif-on  { color: var(--green); font-weight: 600; }
.notif-off { color: var(--text-muted); }

.modal-overlay   { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal-container { background-color: white; padding: 30px; border-radius: var(--radius-lg); width: 100%; max-width: 520px; box-shadow: 0 15px 30px rgba(0,0,0,0.2); position: relative; animation: slideDown 0.3s ease; max-height: 90vh; overflow-y: auto; }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header    { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { font-size: 19px; color: var(--text-main); }
.btn-close       { background: none; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; }

.form-grid-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; }
.form-group    { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group.no-margin { margin-bottom: 0; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-main); }
.form-group input, .form-group select { padding: 10px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 14px; outline: none; width: 100%; box-sizing: border-box; }
.form-row { display: flex; gap: 16px; margin-bottom: 14px; }
.form-row .form-group { flex: 1; margin-bottom: 0; }

.toggle-option { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--bg-body); border-radius: var(--radius-md); cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-main); margin-bottom: 10px; }
.toggle-option input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--bordeaux); cursor: pointer; }

.section-divider { border: none; border-top: 1px solid var(--border-color); margin: 16px 0; }
