/* =========================================
   STYLE GLOBAL - ÉQUIPE MOBILE AVSEA/CEDRE
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800&family=Segoe+UI:wght@400;600;700&display=swap');

:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --secondary: #2c3e50;
    --secondary-light: #34495e;
    --success: #2ecc71;
    --success-dark: #27ae60;
    --danger: #e74c3c;
    --danger-dark: #c0392b;
    --warning: #f39c12;
    --warning-dark: #e67e22;
    --info: #17a2b8;
    --light-bg: #f4f7f6;
    --text-main: #333333;
    --text-muted: #7f8c8d;
    --border-color: #e0e6ed;
    --box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    margin: 0;
    padding: 0;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3 { color: var(--secondary); margin-top: 0; }
h1 { font-size: 1.8rem; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; margin-bottom: 20px; display: flex; align-items: center; gap: 15px; }
h2 { font-size: 1.3rem; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; margin-bottom: 20px; }
a { transition: color 0.3s ease; }

/* --- HEADER & NAVBAR --- */
.logo-bar { background-color: white; padding: 15px 40px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.05); z-index: 10; position: relative; }
.logo-bar img { height: 70px; width: auto; }
.logo-bar .title { font-family: 'Montserrat', sans-serif; font-size: 2.2rem; font-weight: 800; color: var(--secondary); text-align: center; letter-spacing: 4px; text-transform: uppercase; }

.navbar { background-color: var(--secondary); color: white; padding: 12px 30px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.navbar a { color: white; text-decoration: none; padding: 8px 16px; margin: 0 4px; border-radius: 6px; transition: all 0.3s ease; font-size: 0.95rem; font-weight: 600; }
.navbar a:hover, .navbar a.active { background-color: var(--secondary-light); transform: translateY(-1px); }
.btn-logout { background-color: var(--danger) !important; margin-left: 20px; }
.btn-logout:hover { background-color: var(--danger-dark) !important; }

/* --- CONTENEURS ET LAYOUT --- */
.content-wrapper { flex: 1; padding-bottom: 40px; }
.container { max-width: 1200px; margin: 30px auto; padding: 0 20px; }
.container-small { max-width: 800px; margin: 30px auto; padding: 0 20px; }
.box { background: white; padding: 30px; border-radius: 12px; box-shadow: var(--box-shadow); margin-bottom: 30px; border: 1px solid rgba(0,0,0,0.02); }

.grid-layout { display: grid; grid-template-columns: 1fr 2fr; gap: 30px; }
.grid-admin { display: grid; grid-template-columns: 1fr 2.5fr; gap: 30px; }
.row { display: flex; gap: 20px; margin-bottom: 15px; }
.col { flex: 1; }
@media (max-width: 900px) { .grid-layout, .grid-admin, .row { grid-template-columns: 1fr; flex-direction: column; gap: 15px; } }

/* --- ALERTES --- */
.alert { padding: 15px 20px; border-radius: 8px; margin-bottom: 25px; font-weight: 600; font-size: 0.95rem; line-height: 1.5; display: flex; align-items: center; gap: 10px; }
.alert-success { background-color: #d4edda; color: #155724; border-left: 5px solid #28a745; }
.alert-danger { background-color: #f8d7da; color: #721c24; border-left: 5px solid #dc3545; }
.alert-info { background-color: #e8f4f8; color: #31708f; border-left: 5px solid var(--primary); }
.alert-warning { background-color: #fff3cd; color: #856404; border-left: 5px solid #ffc107; }

/* --- FORMULAIRES --- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--text-muted); font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 15px; border: 1px solid #ced4da; border-radius: 8px; box-sizing: border-box; font-size: 1rem; font-family: inherit; transition: all 0.3s ease; background-color: #fcfcfc; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); outline: none; background-color: white; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15); }
.section-title { margin-top: 30px; margin-bottom: 15px; color: var(--secondary); border-bottom: 1px dashed var(--border-color); padding-bottom: 8px; font-weight: 700; font-size: 1.15rem; }

/* --- BOUTONS --- */
.btn { display: inline-block; padding: 12px 24px; border: none; border-radius: 8px; cursor: pointer; font-size: 1rem; font-weight: 700; text-align: center; text-decoration: none; transition: all 0.3s ease; box-shadow: 0 4px 6px rgba(0,0,0,0.06); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.1); }
.btn:active { transform: translateY(0); }
.btn-block { width: 100%; display: block; }
.btn-blue, .btn-primary { background: var(--primary); color: white; } .btn-blue:hover, .btn-primary:hover { background: var(--primary-dark); }
.btn-green, .btn-success { background: var(--success); color: white; } .btn-green:hover, .btn-success:hover { background: var(--success-dark); }
.btn-red, .btn-danger { background: var(--danger); color: white; } .btn-red:hover, .btn-danger:hover { background: var(--danger-dark); }
.btn-orange, .btn-warning { background: var(--warning); color: white; } .btn-orange:hover, .btn-warning:hover { background: var(--warning-dark); }

/* Petits boutons d'action (tableaux) */
.btn-action, .btn-edit { background: var(--primary); color: white; text-decoration: none; padding: 8px 14px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; transition: 0.3s; display: inline-block; margin-bottom: 4px; border: none; cursor: pointer;}
.btn-action:hover, .btn-edit:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-edit { background: var(--warning); } .btn-edit:hover { background: var(--warning-dark); }
.btn-del { color: var(--danger); background: none; border: none; cursor: pointer; font-size: 1rem; font-weight: bold; padding: 5px; transition: 0.3s; }
.btn-del:hover { transform: scale(1.2); }

/* --- TABLEAUX --- */
.table-responsive { overflow-x: auto; border-radius: 8px; box-shadow: 0 0 0 1px var(--border-color); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: white; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
th { background-color: #f8f9fa; color: var(--text-muted); font-weight: 700; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.5px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background-color: #f8faff; }
.ligne-inactif, .ligne-archive { background-color: #fdfdfd; opacity: 0.7; }
.ligne-inactif td, .ligne-archive td { color: #95a5a6; }

/* --- BADGES --- */
.badge { display: inline-block; padding: 5px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-blue { background-color: var(--primary); color: white; }
.badge-admin { background-color: #9b59b6; color: white; }
.badge-read { background-color: #16a085; color: white; }
.badge-inactif, .badge-archive { background-color: #95a5a6; color: white; }
.statut-badge { padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: bold; color: white; }

/* --- LOGIN PAGE --- */
.login-body { background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%); display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; }
.login-container { background: white; padding: 50px 40px; border-radius: 16px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); width: 100%; max-width: 400px; text-align: center; }
.secure-badge { display: inline-block; background-color: #e8f8f5; color: var(--success-dark); padding: 8px 16px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; margin-bottom: 25px; border: 1px solid #c3e6cb; }

/* --- TABLEAU DE BORD (KPIs) --- */
.kpi-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 25px; margin-bottom: 40px; }
.kpi-card { background: white; padding: 30px 20px; border-radius: 12px; box-shadow: var(--box-shadow); text-align: center; transition: transform 0.3s ease; border-top: 4px solid var(--primary); }
.kpi-card:hover { transform: translateY(-5px); }
.kpi-card h3 { color: var(--text-muted); font-size: 0.95rem; margin-top: 0; text-transform: uppercase; letter-spacing: 1px; }
.kpi-card .value { font-size: 2.8rem; font-weight: 800; color: var(--secondary); margin: 15px 0; }

/* --- DOSSIER CLINIQUE (Grille) --- */
.grille-clinique { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.colonne { padding: 20px; border-radius: 8px; border-top: 4px solid #ddd; background: #fafafa; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.03); }
.col-alarmants { border-color: var(--danger); background: #fdf3f2; }
.col-limitants { border-color: var(--warning); background: #fdfaf3; }
.col-compl { border-color: var(--primary); background: #f2f8fc; }
.col-symptomes { border-color: #95a5a6; background: #f8f9f9; }
.colonne h3 { margin-top: 0; font-size: 1.05rem; color: var(--secondary); text-align: center; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 10px; margin-bottom: 15px; }
.checkbox-item { margin-bottom: 12px; display: flex; align-items: flex-start; }
.checkbox-item input { margin-top: 4px; margin-right: 10px; transform: scale(1.1); cursor: pointer; }
.checkbox-item label { font-size: 0.9rem; color: #34495e; cursor: pointer; line-height: 1.4; }
.resultat-bandeau { background: var(--secondary); color: white; padding: 25px; border-radius: 10px; text-align: center; margin-top: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.resultat-bandeau h2 { margin: 0; font-size: 1.6rem; color: white !important; }

/* --- UTILITAIRES --- */
.back-link { display: inline-flex; align-items: center; margin-bottom: 25px; color: var(--text-muted); text-decoration: none; font-weight: 700; font-size: 0.95rem; }
.back-link:hover { color: var(--primary); transform: translateX(-5px); }
.filter-bar { background: #f8f9fa; padding: 20px; border-radius: 10px; margin-bottom: 25px; display: flex; gap: 15px; align-items: flex-end; border: 1px solid var(--border-color); }
.filter-bar .form-group { margin-bottom: 0; flex: 1; }

/* --- FOOTER --- */
.app-footer { background-color: var(--secondary); color: #95a5a6; text-align: center; padding: 25px 20px; font-size: 0.9rem; margin-top: 50px; border-top: 4px solid var(--primary); }
.app-footer p { margin: 6px 0; }
.app-footer .confidential { color: var(--danger); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
