/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
    --primary: #0088FF;
    --dark-navy: #0B192C;
    --background: #F3F4F6;
    --white: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --success: #10B981;
    --success-bg: #D1FAE5;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --danger: #EF4444;
    --danger-bg: #FEE2E2;
    --info: #6366F1;
    --info-bg: #E0E7FF;
    --border: #E5E7EB;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-main);
    padding-bottom: 80px;
    overflow-x: hidden;
}

/* ===== EN-TÊTE ===== */
.app-header {
    background: var(--dark-navy);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-left { display: flex; align-items: center; gap: 12px; }

.app-logo {
    width: 42px; height: 42px;
    background: var(--primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}

.app-title h1 { font-size: 17px; font-weight: 700; line-height: 1.2; }
.app-title span { font-size: 12px; color: #9CA3AF; }

.network-badge {
    display: flex; align-items: center; gap: 6px;
    background: var(--success-bg);
    color: var(--success);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.network-badge.offline { background: var(--danger-bg); color: var(--danger); }

/* ===== ÉCRANS ===== */
.screen { display: none; padding: 16px; animation: fadeIn 0.3s; }
.screen.active { display: block; }

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

.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.page-header h2 { font-size: 22px; color: var(--text-main); font-weight: 700; }

/* ===== BANNIÈRE ===== */
.banner {
    background: var(--dark-navy);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
}
.banner h3 { font-size: 18px; margin-bottom: 6px; font-weight: 700; }
.banner p { font-size: 13px; color: #9CA3AF; line-height: 1.4; }

/* ===== GRILLE STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--white);
    padding: 14px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 10px;
    font-size: 18px;
}

.stat-icon.blue { background: #E0F2FE; color: var(--primary); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.stat-icon.purple { background: var(--info-bg); color: var(--info); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }

.stat-value { display: block; font-size: 22px; font-weight: 700; color: var(--text-main); }
.stat-label { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== SECTIONS ===== */
.section {
    background: var(--white);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.section-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 14px;
}
.section-header h3 { font-size: 16px; color: var(--text-main); font-weight: 700; }

/* ===== INCIDENTS ===== */
.incident-item, .incident-card {
    border-left: 4px solid var(--warning);
    padding: 10px 0 10px 12px;
    margin-bottom: 14px;
}
.incident-card { background: var(--white); padding: 14px; border-radius: 10px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

.border-red { border-left-color: var(--danger); }
.border-orange { border-left-color: var(--warning); }
.border-yellow { border-left-color: var(--warning); }
.border-blue { border-left-color: var(--primary); }
.border-green { border-left-color: var(--success); }

.incident-top {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 6px;
}
.incident-title { font-size: 14px; font-weight: 600; color: var(--text-main); }
.incident-meta { font-size: 12px; color: var(--text-muted); display: block; margin-top: 6px; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.bg-red { background: var(--danger-bg); color: #B91C1C; }
.bg-orange { background: var(--warning-bg); color: #B45309; }
.bg-yellow { background: var(--warning-bg); color: #D97706; }
.bg-blue { background: var(--info-bg); color: #4338CA; }
.bg-green { background: var(--success-bg); color: #047857; }
.bg-gray { background: #F3F4F6; color: #4B5563; }

/* ===== PROGRESS BARS ===== */
.progress-item { margin-bottom: 12px; }
.progress-label {
    display: flex; justify-content: space-between;
    font-size: 13px; margin-bottom: 6px;
    color: var(--text-main);
}
.progress-label span:last-child { font-weight: 700; }
.progress-bar {
    height: 8px; background: var(--border);
    border-radius: 4px; overflow: hidden;
}
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.6s; }
.progress-fill.green { background: var(--success); }
.progress-fill.orange { background: var(--warning); }
.progress-fill.blue { background: var(--primary); }
.progress-fill.red { background: var(--danger); }

/* ===== LISTES ===== */
.list { display: flex; flex-direction: column; gap: 12px; }

.list-card {
    background: var(--white);
    padding: 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.list-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.list-icon.blue { background: #E0F2FE; color: var(--primary); }
.list-icon.green { background: var(--success-bg); color: var(--success); }
.list-icon.red { background: var(--danger-bg); color: var(--danger); }

.list-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.list-title { font-size: 14px; font-weight: 700; color: var(--text-main); }
.list-sub { font-size: 12px; color: var(--text-muted); }

/* ===== DATE BOX ===== */
.date-box {
    background: var(--info-bg);
    color: var(--info);
    padding: 8px 12px;
    border-radius: 10px;
    text-align: center;
    min-width: 55px;
    flex-shrink: 0;
}
.date-box span { display: block; font-size: 18px; font-weight: 700; }
.date-box small { font-size: 11px; font-weight: 600; }

/* ===== RESSOURCES ===== */
.resource-card {
    background: var(--white);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 12px;
}
.resource-header { display: flex; gap: 12px; margin-bottom: 10px; }
.resource-footer {
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.btn-offline {
    background: none;
    border: none;
    color: var(--success);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
}
.btn-offline.not-downloaded { color: var(--text-muted); }
.btn-offline:active { opacity: 0.6; }

/* ===== NAVIGATION BAS ===== */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--dark-navy);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}

.nav-btn {
    background: none;
    border: none;
    color: #6B7280;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    padding: 6px 10px;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s;
    flex: 1;
}
.nav-btn i { font-size: 18px; }
.nav-btn.active { color: var(--primary); }
.nav-btn:active { opacity: 0.7; }

/* ===== RESPONSIVE TABLETTE ===== */
@media (min-width: 768px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .screen { padding: 24px; max-width: 900px; margin: 0 auto; }
    .bottom-nav { position: sticky; }
}

/* ===== OFFLINE STATE ===== */
body.offline .network-badge {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ============================================================
   MODE SOMBRE
   ============================================================ */
body.dark-mode {
    --background: #0F172A;
    --white: #1E293B;
    --text-main: #F1F5F9;
    --text-muted: #94A3B8;
    --border: #334155;
}
body.dark-mode { background: #0F172A; }
body.dark-mode .app-header { background: #020617; }
body.dark-mode .banner { background: #020617; }
body.dark-mode .bottom-nav { background: #020617; }
body.dark-mode .kpi-table thead { background: #020617; }
body.dark-mode .kpi-table tbody tr:nth-child(even) { background: #1E293B; }
body.dark-mode .form-input { background: #1E293B; color: #F1F5F9; border-color: #334155; }
body.dark-mode .modal-content { background: #1E293B; }
body.dark-mode .stat-card, body.dark-mode .section, body.dark-mode .list-card,
body.dark-mode .incident-card, body.dark-mode .resource-card { background: #1E293B; }

/* ============================================================
   HEADER BUTTONS
   ============================================================ */
.header-right { display: flex; align-items: center; gap: 8px; }

.header-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    cursor: pointer;
    font-size: 16px;
}
.header-btn:active { transform: scale(0.92); }

.notif-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--danger);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
}

/* ============================================================
   BARRE DE RECHERCHE
   ============================================================ */
.search-bar {
    background: var(--white);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    border: 1.5px solid var(--border);
}
.search-bar i { color: var(--text-muted); }
.search-bar input {
    flex: 1; border: none; background: none; outline: none;
    font-size: 14px; color: var(--text-main); font-family: inherit;
}
.clear-search {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px;
}

/* ============================================================
   FILTRES CHIPS
   ============================================================ */
.filters { margin-bottom: 14px; }
.filter-chips {
    display: flex; gap: 6px; overflow-x: auto;
    padding: 4px 0; scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }

.chip {
    background: var(--white);
    border: 1.5px solid var(--border);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}
.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ============================================================
   MODALES
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
}
.modal-overlay.active { display: flex; }

.modal-content {
    background: var(--white);
    width: 100%;
    max-width: 600px;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 {
    font-size: 16px; color: var(--text-main); font-weight: 700;
    display: flex; align-items: center; gap: 8px;
}
.modal-header h3 i { color: var(--primary); }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 20px; cursor: pointer; padding: 6px;
}
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex; gap: 10px;
}
.modal-footer button { flex: 1; }

/* ============================================================
   GPS + PHOTO + SIGNATURE
   ============================================================ */
.gps-row { display: flex; gap: 8px; }
.btn-gps {
    background: var(--primary); color: white; border: none;
    width: 48px; border-radius: 10px; cursor: pointer; font-size: 18px;
}
.photo-section { display: flex; flex-direction: column; gap: 10px; }
.btn-photo {
    background: var(--info-bg); color: var(--info);
    border: 1.5px dashed var(--info);
    padding: 14px; border-radius: 10px;
    font-weight: 600; cursor: pointer; font-family: inherit;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.photo-preview { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-preview img {
    width: 80px; height: 80px;
    object-fit: cover; border-radius: 8px; border: 2px solid var(--border);
}
.signature-container {
    position: relative; border: 2px dashed var(--border);
    border-radius: 10px; background: #FAFBFC; overflow: hidden;
}
#signatureCanvas {
    width: 100%; height: 120px;
    touch-action: none; cursor: crosshair;
}
.btn-clear-sign {
    position: absolute; top: 6px; right: 6px;
    background: var(--danger-bg); color: var(--danger);
    border: none; width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
}

/* ============================================================
   QR CODE
   ============================================================ */
#qrReader { border-radius: 10px; overflow: hidden; }
.qr-hint { text-align: center; color: var(--text-muted); font-size: 13px; margin-top: 12px; }
.qr-result {
    margin-top: 14px; padding: 14px;
    background: var(--success-bg); border-radius: 10px;
    color: #047857; font-size: 14px; font-weight: 600;
}

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
.notifs-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
    padding: 12px; background: #FAFBFC;
    border-radius: 10px; border-left: 4px solid var(--primary);
}
.notif-item.unread { background: #EFF6FF; }
.notif-item.critical { border-left-color: var(--danger); }
.notif-title { font-weight: 700; font-size: 13px; color: var(--text-main); margin-bottom: 4px; }
.notif-msg { font-size: 12px; color: var(--text-muted); }
.notif-time { font-size: 10px; color: var(--text-muted); margin-top: 6px; }
.empty-state { text-align: center; color: var(--text-muted); padding: 30px; font-size: 14px; }

/* ============================================================
   CHAT
   ============================================================ */
.chat-container {
    display: flex; flex-direction: column;
    height: calc(100vh - 200px);
    background: var(--white);
    border-radius: 12px; overflow: hidden;
}
.chat-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
}
.chat-msg {
    max-width: 80%; padding: 10px 14px;
    border-radius: 16px; font-size: 13px; line-height: 1.4;
}
.chat-msg.me {
    align-self: flex-end; background: var(--primary); color: white;
    border-bottom-right-radius: 4px;
}
.chat-msg.other {
    align-self: flex-start; background: #F3F4F6; color: var(--text-main);
    border-bottom-left-radius: 4px;
}
.chat-msg-author { font-size: 10px; font-weight: 700; opacity: 0.8; margin-bottom: 3px; }
.chat-msg-time { font-size: 10px; opacity: 0.7; margin-top: 4px; text-align: right; }
.chat-input-bar {
    display: flex; gap: 8px; padding: 10px;
    border-top: 1px solid var(--border); background: var(--white);
}
.chat-input-bar input {
    flex: 1; padding: 10px 14px;
    border: 1.5px solid var(--border); border-radius: 22px;
    outline: none; font-size: 14px; font-family: inherit;
    background: var(--background); color: var(--text-main);
}
.chat-send-btn {
    background: var(--primary); color: white; border: none;
    width: 44px; height: 44px; border-radius: 50%;
    cursor: pointer; font-size: 16px;
}

/* ============================================================
   TABLEAUX KPI
   ============================================================ */
.table-wrapper {
    overflow-x: auto; border-radius: 10px; border: 1px solid var(--border);
}
.kpi-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.kpi-table thead { background: var(--dark-navy); color: white; }
.kpi-table th {
    padding: 10px 12px; text-align: left;
    font-weight: 600; font-size: 12px; text-transform: uppercase;
}
.kpi-table td {
    padding: 10px 12px; border-bottom: 1px solid var(--border);
    color: var(--text-main); white-space: nowrap;
}
.kpi-table tbody tr:nth-child(even) { background: #FAFBFC; }
.kpi-table .total-row {
    background: var(--info-bg) !important; color: var(--info);
    border-top: 2px solid var(--info);
}
.kpi-table .total-row td { color: var(--info); }

/* ============================================================
   BOUTONS EXPORT
   ============================================================ */
.btn-export {
    background: var(--success); color: white; border: none;
    padding: 8px 14px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
    display: flex; align-items: center; gap: 6px;
    cursor: pointer; font-family: inherit;
}
.export-section {
    display: flex; flex-direction: column; gap: 10px;
    margin-top: 20px; margin-bottom: 20px;
}
.btn-export-large {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white; border: none;
    padding: 16px 20px; border-radius: 12px;
    font-size: 15px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    gap: 10px; cursor: pointer; font-family: inherit;
}
.btn-export-large.csv {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
}
.btn-export-large.pdf {
    background: linear-gradient(135deg, #EF4444, #B91C1C);
}

/* ============================================================
   GRAPHIQUES CHART.JS
   ============================================================ */
.charts-grid {
    display: grid; grid-template-columns: 1fr; gap: 16px;
}
.chart-box {
    background: var(--background); border-radius: 12px;
    padding: 14px; border: 1px solid var(--border);
}
.chart-box h4 {
    font-size: 13px; font-weight: 700; color: var(--text-main);
    margin-bottom: 12px; text-transform: uppercase;
}
.chart-box canvas { max-height: 220px; }
body.dark-mode .chart-box { background: #0F172A; }

@media (min-width: 600px) {
    .charts-grid { grid-template-columns: 1fr 1fr; }
    .chart-box.full { grid-column: span 2; }
}

/* ============================================================
   VERROUILLAGE PIN
   ============================================================ */
.pin-lock-screen {
    position: fixed; inset: 0;
    background: linear-gradient(135deg, #0B192C, #1E3A5F);
    z-index: 9999; display: flex;
    align-items: center; justify-content: center; padding: 20px;
}
.pin-lock-content { width: 100%; max-width: 340px; text-align: center; color: white; }
.pin-logo {
    width: 72px; height: 72px; background: var(--primary);
    border-radius: 20px; margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
}
.pin-lock-content h2 { font-size: 20px; margin-bottom: 8px; font-weight: 700; }
.pin-subtitle { font-size: 13px; color: #94A3B8; margin-bottom: 30px; }
.pin-dots { display: flex; justify-content: center; gap: 18px; margin-bottom: 20px; }
.pin-dot {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4); transition: all 0.2s;
}
.pin-dot.filled {
    background: var(--primary); border-color: var(--primary);
    transform: scale(1.15); box-shadow: 0 0 12px rgba(0,136,255,0.6);
}
.pin-error { color: #FCA5A5; font-size: 13px; height: 20px; margin-bottom: 12px; font-weight: 600; }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.pin-keypad button {
    aspect-ratio: 1; background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px; color: white;
    font-size: 24px; font-weight: 600;
    cursor: pointer; font-family: inherit;
}
.pin-keypad button:active { background: var(--primary); transform: scale(0.92); }
.pin-keypad .pin-fn { font-size: 18px; }
.pin-settings-btn {
    background: none; border: none; color: #94A3B8;
    font-size: 13px; cursor: pointer; font-family: inherit;
    display: flex; align-items: center; gap: 6px;
    margin: 0 auto; padding: 8px 16px; border-radius: 20px;
}
.pin-info {
    margin-top: 16px; padding: 12px;
    background: var(--info-bg); border-radius: 10px;
    font-size: 12px; color: var(--info);
    display: flex; gap: 8px; align-items: flex-start;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}
.pin-lock-content.shake { animation: shake 0.3s; }

/* ============================================================
   GMAO SCREEN
   ============================================================ */
.gmao-status-card {
    background: linear-gradient(135deg, #FFFFFF, #F9FAFB);
    border: 1px solid var(--border);
}
.gmao-status-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.gmao-status-icon {
    width: 50px; height: 50px; border-radius: 12px;
    background: var(--danger-bg); color: var(--danger);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.gmao-status-icon.connected { background: var(--success-bg); color: var(--success); }
.gmao-status-icon.syncing { background: var(--info-bg); color: var(--info); animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.gmao-status-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.gmao-status-title { font-size: 15px; font-weight: 700; color: var(--text-main); }
.gmao-status-sub { font-size: 12px; color: var(--text-muted); }
.gmao-actions { display: flex; gap: 10px; }
.btn-gmao {
    flex: 1; background: var(--white);
    border: 1.5px solid var(--border); color: var(--text-main);
    padding: 12px 16px; border-radius: 10px;
    font-size: 13px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    gap: 6px; cursor: pointer; font-family: inherit;
}
.btn-gmao.primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-gmao.sync { background: var(--dark-navy); color: white; border-color: var(--dark-navy); }
.btn-gmao.danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bg); }
.btn-gmao.secondary { background: var(--border); color: var(--text-muted); }
.btn-gmao.large { padding: 14px 20px; font-size: 14px; }
.btn-gmao.full { width: 100%; margin-top: 10px; }

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form-label {
    display: block; font-size: 12px; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.4px; margin-bottom: 6px; margin-top: 14px;
}
.form-input {
    width: 100%; padding: 12px 14px;
    border: 1.5px solid var(--border); border-radius: 10px;
    font-size: 14px; font-family: inherit;
    color: var(--text-main); background: var(--white); outline: none;
}
.form-input:focus { border-color: var(--primary); }
.form-switch {
    margin-top: 14px; padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.form-switch label {
    display: flex; align-items: center; gap: 12px;
    font-size: 14px; color: var(--text-main); cursor: pointer;
}
.form-switch input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); }
.form-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

/* ============================================================
   STATS GMAO
   ============================================================ */
.gmao-stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.gmao-stat { text-align: center; padding: 12px 6px; background: #FAFBFC; border-radius: 10px; }
.gmao-stat-value { display: block; font-size: 22px; font-weight: 700; color: var(--text-main); }
.gmao-stat-value.green { color: var(--success); }
.gmao-stat-value.blue { color: var(--primary); }
.gmao-stat-value.red { color: var(--danger); }
.gmao-stat-label {
    display: block; font-size: 10px; color: var(--text-muted);
    margin-top: 4px; text-transform: uppercase; font-weight: 600;
}

/* ============================================================
   LOGS
   ============================================================ */
.gmao-logs { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.log-entry {
    display: flex; gap: 10px; padding: 10px;
    border-radius: 8px; background: #FAFBFC; font-size: 12px;
    border-left: 3px solid var(--border); align-items: flex-start;
}
.log-entry.info { border-left-color: var(--primary); }
.log-entry.success { border-left-color: var(--success); background: #F0FDF4; }
.log-entry.error { border-left-color: var(--danger); background: #FEF2F2; }
.log-entry.warning { border-left-color: var(--warning); background: #FFFBEB; }
.log-entry > i { font-size: 14px; margin-top: 2px; flex-shrink: 0; }
.log-entry.info > i { color: var(--primary); }
.log-entry.success > i { color: var(--success); }
.log-entry.error > i { color: var(--danger); }
.log-entry.warning > i { color: var(--warning); }
.log-entry > div { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.log-title { font-weight: 600; color: var(--text-main); }
.log-time { font-size: 11px; color: var(--text-muted); }

@media (max-width: 400px) {
    .gmao-stats-grid { grid-template-columns: repeat(2, 1fr); }
}