/* ===== SMART_EQUIPMENT_MANAGER – Style Principal ===== */
:root {
  --primary: #1a56db;
  --primary-dark: #1e40af;
  --secondary: #6c757d;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --bg: #f1f5f9;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #1a56db;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { text-decoration: none; color: inherit; }

/* ===== LOGIN ===== */
.login-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: white;
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%; max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
}
.login-logo { margin-bottom: 16px; }
.login-logo-img { height: 80px; max-width: 220px; object-fit: contain; }
.login-app-name { font-size: 22px; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; margin-bottom: 6px; }
.login-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 32px; }
.login-form .form-group { margin-bottom: 16px; text-align: left; }
.login-form label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.login-form input { width: 100%; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 14px; transition: border-color .2s; }
.login-form input:focus { outline: none; border-color: var(--primary); }
.btn-login { width: 100%; padding: 14px; background: var(--primary); color: white; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .2s; margin-top: 8px; }
.btn-login:hover { background: var(--primary-dark); }
.login-error { background: #fef2f2; color: var(--danger); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; border: 1px solid #fecaca; }
.login-footer { margin-top: 24px; font-size: 11px; color: #b0b7c3; }

/* ===== APP LAYOUT ===== */
.app-container { display: flex; height: 100vh; overflow: hidden; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px; min-width: 260px;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  transition: width .3s;
  overflow: hidden;
  z-index: 100;
}
.sidebar.collapsed { width: 70px; min-width: 70px; }
.sidebar-header {
  padding: 20px 16px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo { height: 40px; width: 40px; border-radius: 8px; object-fit: contain; background: white; padding: 3px; flex-shrink: 0; }
.sidebar-title { color: white; font-size: 13px; font-weight: 700; line-height: 1.3; }
.sidebar-title small { color: var(--sidebar-text); font-weight: 400; font-size: 11px; }
.sidebar.collapsed .sidebar-title { display: none; }
.sidebar-menu { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar-menu li { list-style: none; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  font-size: 13px; font-weight: 500;
  transition: all .2s;
  border-left: 3px solid transparent;
  cursor: pointer;
}
.menu-item:hover { background: rgba(255,255,255,.06); color: white; }
.menu-item.active { background: rgba(26,86,219,.2); color: white; border-left-color: var(--primary); }
.menu-item i { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; }
.sidebar.collapsed .menu-item span { display: none; }
.badge { background: var(--danger); color: white; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; }
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.user-info { display: flex; align-items: center; gap: 8px; color: var(--sidebar-text); font-size: 12px; overflow: hidden; }
.user-info i { font-size: 22px; flex-shrink: 0; }
.sidebar.collapsed .user-info div { display: none; }
#sidebarUserName { font-weight: 600; color: white; font-size: 12px; }
.btn-logout { background: rgba(239,68,68,.15); color: #f87171; border: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.btn-logout:hover { background: rgba(239,68,68,.3); }
/* Bouton clé mot de passe dans la sidebar */
.btn-key-pwd { background: rgba(251,191,36,.12); color: #fbbf24; border: 1px solid rgba(251,191,36,.25); padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.btn-key-pwd:hover { background: rgba(251,191,36,.25); }

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.topbar {
  background: white;
  padding: 0 24px;
  height: 60px;
  display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 90;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.btn-menu-toggle { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--text-muted); padding: 6px; border-radius: 6px; }
.btn-menu-toggle:hover { background: var(--bg); }
.topbar-title { font-size: 18px; font-weight: 700; flex: 1; }
.alert-top-badge { background: #fef2f2; color: var(--danger); padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid #fecaca; }

/* ===== MODULES ===== */
.module { display: none; padding: 24px; flex: 1; }
.module.active { display: block; }
.module-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.module-header h2 { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.module-header h2 i { color: var(--primary); }

/* ===== BUTTONS ===== */
.btn { padding: 9px 18px; border-radius: 8px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; transition: all .2s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ===== KPI GRID ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
  border-left: 4px solid var(--primary);
}
.kpi-card.kpi-success { border-left-color: var(--success); }
.kpi-card.kpi-warning { border-left-color: var(--warning); }
.kpi-card.kpi-danger { border-left-color: var(--danger); }
.kpi-card.kpi-info { border-left-color: var(--info); }
.kpi-icon { font-size: 22px; color: var(--primary); margin-bottom: 4px; }
.kpi-card.kpi-success .kpi-icon { color: var(--success); }
.kpi-card.kpi-warning .kpi-icon { color: var(--warning); }
.kpi-card.kpi-danger .kpi-icon { color: var(--danger); }
.kpi-card.kpi-info .kpi-icon { color: var(--info); }
.kpi-value { font-size: 28px; font-weight: 800; color: var(--text); }
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ===== SECTION CARDS ===== */
.section-card { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.section-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.text-red { color: var(--danger); }
.text-orange { color: var(--warning); }
.text-green { color: var(--success); }

/* ===== ONEDRIVE BANNER ===== */
.onedrive-banner {
  background: linear-gradient(135deg, #0078d4, #106ebe);
  color: white;
  padding: 16px 20px;
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 16px;
  margin-top: 8px;
}
.onedrive-banner i { font-size: 28px; flex-shrink: 0; }
.onedrive-banner div { flex: 1; }
.onedrive-banner p { font-size: 12px; opacity: .85; margin-top: 3px; }
.onedrive-banner code { background: rgba(255,255,255,.2); padding: 1px 6px; border-radius: 4px; font-size: 11px; }

.onedrive-info-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: #1e40af;
}
.onedrive-info-banner i { font-size: 18px; color: #0078d4; flex-shrink: 0; }

/* ===== MATÉRIEL GRID ===== */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.search-input { flex: 1; min-width: 200px; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 14px; }
.search-input:focus { outline: none; border-color: var(--primary); }
.filter-select { padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 13px; background: white; cursor: pointer; }
.filter-select:focus { outline: none; border-color: var(--primary); }

.materiel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.materiel-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
  border: 1.5px solid transparent;
}
.materiel-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.materiel-card-header { padding: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--border); }
.materiel-card-title { font-size: 15px; font-weight: 700; }
.materiel-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.materiel-card-body { padding: 14px 16px; }
.materiel-info-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12px; }
.materiel-info-row span:first-child { color: var(--text-muted); }
.materiel-info-row span:last-child { font-weight: 600; }
.materiel-card-docs { padding: 10px 16px; background: var(--bg); display: flex; flex-wrap: wrap; gap: 6px; }
.doc-chip { padding: 3px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.doc-chip.valid { background: #d1fae5; color: #065f46; }
.doc-chip.expiring { background: #fef3c7; color: #92400e; }
.doc-chip.expired { background: #fee2e2; color: #991b1b; }
.materiel-card-actions { padding: 12px 16px; display: flex; gap: 8px; justify-content: flex-end; }

/* ===== STATUT BADGES ===== */
.statut-badge {
  padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.statut-en_service { background: #d1fae5; color: #065f46; }
.statut-en_panne { background: #fee2e2; color: #991b1b; }
.statut-inactif { background: #f1f5f9; color: #64748b; }
.statut-hs { background: #fce7f3; color: #9d174d; }
.statut-planifie { background: #ede9fe; color: #5b21b6; }
.statut-actif { background: #d1fae5; color: #065f46; }
.statut-termine { background: #f1f5f9; color: #64748b; }
.statut-suspendu { background: #fef3c7; color: #92400e; }

/* ===== ALERTES ===== */
.alerte-card {
  background: white;
  border-radius: var(--radius);
  border-left: 4px solid;
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  display: flex; gap: 16px; align-items: flex-start;
}
.alerte-card.alerte-rouge { border-left-color: var(--danger); }
.alerte-card.alerte-orange { border-left-color: var(--warning); }
.alerte-card.alerte-verte { border-left-color: var(--success); opacity: .7; }
.alerte-card.alerte-documentaire { background: linear-gradient(to right, #fff7ed, white); }
.alerte-card.alerte-panne { background: linear-gradient(to right, #fef2f2, white); }
.alerte-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.alerte-content { flex: 1; }
.alerte-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.alerte-type-badge { font-size: 10px; padding: 2px 8px; border-radius: 12px; font-weight: 700; }
.alerte-type-doc { background: #fef3c7; color: #92400e; }
.alerte-type-panne { background: #fee2e2; color: #991b1b; }
.alerte-type-expire { background: #fee2e2; color: #991b1b; }
.alerte-type-expiring { background: #fef3c7; color: #92400e; }
.alerte-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.alerte-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex-shrink: 0; }
.alerte-cloturee-info { font-size: 11px; color: var(--success); font-weight: 600; }

/* ===== TABS ===== */
.tabs-nav { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.tab-btn { background: none; border: none; padding: 10px 18px; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; display: flex; align-items: center; gap: 6px; transition: all .2s; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover { color: var(--text); }

.header-tabs { display: flex; gap: 4px; }

/* ===== DATA TABLE ===== */
.data-table-wrapper { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
table.data-table { width: 100%; border-collapse: collapse; background: white; }
table.data-table th { background: #f8fafc; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-weight: 600; }
table.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--bg); }
table.data-table .actions { display: flex; gap: 6px; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-box {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.modal-sm { max-width: 520px; }
.modal-lg { max-width: 860px; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: white; z-index: 1; border-radius: 16px 16px 0 0; }
.modal-header h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-close { background: var(--bg); border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px; color: var(--text-muted); display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: #e2e8f0; }
.modal-body { padding: 24px; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: #f8fafc; border-radius: 0 0 16px 16px; }

/* ===== FORMS ===== */
.form-grid {}
.form-section { background: var(--bg); border-radius: 10px; padding: 20px; margin-bottom: 20px; border: 1px solid var(--border); }
.form-section h4 { font-size: 14px; font-weight: 700; margin-bottom: 16px; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 13px; transition: border-color .2s;
  background: white; color: var(--text);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--primary); }
.required { color: var(--danger); }

/* ===== DOCUMENTS SECTION ===== */
.documents-section { border: 2px solid #bfdbfe; background: #f0f7ff; }
.documents-section h4 { color: #1d4ed8; }
.doc-row {
  background: white; border-radius: 10px; padding: 16px; margin-bottom: 12px;
  border: 1.5px solid var(--border);
  transition: border-color .2s;
}
.doc-row:hover { border-color: var(--primary); }
.doc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.doc-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--text); }
.doc-title i { color: var(--primary); }
.doc-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.doc-status-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.doc-valid { background: #d1fae5; color: #065f46; }
.doc-expiring { background: #fef3c7; color: #92400e; }
.doc-expired { background: #fee2e2; color: #991b1b; }
.doc-unknown { background: #f1f5f9; color: #64748b; }

/* ===== FILE UPLOAD ===== */
.file-upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 8px; padding: 12px;
  cursor: pointer; transition: all .2s;
  background: #f8fafc;
  min-height: 70px;
  display: flex; align-items: center; justify-content: center;
}
.file-upload-zone:hover { border-color: var(--primary); background: #eff6ff; }
.file-preview-empty { text-align: center; color: var(--text-muted); font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.file-preview-empty i { font-size: 20px; color: #94a3b8; }
.file-preview-loaded { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--success); }
.file-preview-loaded i { font-size: 18px; }

/* ===== AUTRE DOCUMENT ===== */
.autre-doc-row {
  background: white; border-radius: 10px; padding: 16px; margin-bottom: 8px;
  border: 1.5px dashed var(--border);
}
.autre-doc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.autre-doc-header input { flex: 1; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 13px; font-weight: 600; font-family: inherit; }

/* ===== TOAST ===== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: white; border-radius: 10px; padding: 14px 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  display: flex; align-items: center; gap: 10px;
  min-width: 280px; max-width: 400px;
  animation: slideIn .3s ease;
  border-left: 4px solid var(--primary);
}
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast i { font-size: 16px; }
.toast.toast-success i { color: var(--success); }
.toast.toast-error i { color: var(--danger); }
.toast.toast-warning i { color: var(--warning); }
.toast span { font-size: 13px; font-weight: 500; flex: 1; }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* ===== FICHE MATERIEL ===== */
.fiche-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.fiche-title h3 { font-size: 20px; font-weight: 800; }
.fiche-title p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.fiche-docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.fiche-doc-card { border-radius: 10px; padding: 14px; border: 1.5px solid var(--border); }
.fiche-doc-card.valid { border-color: #6ee7b7; background: #f0fdf4; }
.fiche-doc-card.expiring { border-color: #fcd34d; background: #fffbeb; }
.fiche-doc-card.expired { border-color: #fca5a5; background: #fef2f2; }
.fiche-doc-name { font-weight: 700; font-size: 13px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.fiche-doc-date { font-size: 12px; margin-bottom: 6px; }
.fiche-doc-date span { font-weight: 600; }
.fiche-doc-days { font-size: 11px; font-weight: 700; }
.fiche-doc-days.valid { color: var(--success); }
.fiche-doc-days.expiring { color: var(--warning); }
.fiche-doc-days.expired { color: var(--danger); }

/* ===== RAPPORT ===== */
.rapport-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.rapport-card {
  background: white; border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); border: 1.5px solid var(--border);
  cursor: pointer; transition: all .2s;
  text-align: center;
}
.rapport-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.rapport-card i { font-size: 36px; color: var(--primary); margin-bottom: 12px; }
.rapport-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.rapport-card p { font-size: 12px; color: var(--text-muted); }

/* ===== ONEDRIVE SETUP ===== */
.onedrive-setup-info { text-align: center; padding: 16px; margin-bottom: 20px; }
.onedrive-setup-info i { color: #0078d4; margin-bottom: 10px; }
.onedrive-setup-info h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.onedrive-setup-info p { font-size: 13px; color: var(--text-muted); }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 10px 14px; display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: #1e40af; }
.alert-info code { background: rgba(30,64,175,.1); padding: 1px 5px; border-radius: 3px; font-size: 11px; }

/* ===== POINTAGE LISTE ATTENTE ===== */
.pointage-attente-card {
  background: linear-gradient(135deg, #fff7ed, #fff);
  border: 1.5px solid #fed7aa;
  border-radius: var(--radius);
  padding: 16px;
}
.pointage-attente-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.pointage-attente-title {
  font-size: 14px; font-weight: 700; color: #92400e;
  display: flex; align-items: center; gap: 8px;
}
.pointage-attente-count {
  display: inline-block;
  background: #fed7aa; color: #92400e;
  font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: 20px;
  margin-left: 8px;
}
.pointage-progress-wrap { text-align: right; }
.pointage-attente-list { display: flex; flex-direction: column; gap: 8px; }
.pointage-attente-item {
  background: white; border-radius: 8px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid #fde68a; cursor: pointer;
  transition: all .2s;
}
.pointage-attente-item:hover { border-color: var(--primary); background: #eff6ff; transform: translateX(3px); }
.pointage-attente-item-info { display: flex; align-items: center; gap: 10px; flex: 1; }

/* ===== KPI CLICKABLE ===== */
.kpi-clickable {
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  border: 1.5px solid transparent;
}
.kpi-clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.13);
  border-color: var(--primary);
}
.kpi-link {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 8px;
  opacity: 0;
  transition: opacity .2s;
}
.kpi-clickable:hover .kpi-link { opacity: 1; }

/* ===== EMAIL MODAL ===== */
#email_corps { background: #f8fafc; border: 1.5px solid var(--border); border-radius: 8px; padding: 12px; resize: vertical; }
#email_corps:focus { outline: none; border-color: var(--primary); background: white; }

/* ===== PRINT ===== */
@media print {
  body > *:not(#printReport) { display: none !important; }
  #printReport { display: block !important; }
  .no-print, #reportToolbar { display: none !important; }
  .print-header { text-align: center; border-bottom: 2px solid #333; padding-bottom: 16px; margin-bottom: 20px; }
  .print-logo { height: 60px; margin-bottom: 8px; }
  .print-footer { margin-top: 30px; border-top: 1px solid #999; padding-top: 10px; text-align: center; font-size: 11px; color: #666; }
  table { width: 100%; border-collapse: collapse; }
  th, td { border: 1px solid #ddd; padding: 8px; font-size: 12px; }
  th { background: #f0f0f0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  /* Sidebar mobile: slide-in, z-index élevé, ne couvre pas le toggle */
  .sidebar {
    position: fixed;
    left: -260px;
    height: 100vh;
    transition: left .3s;
    z-index: 200;
  }
  .sidebar.open { left: 0; }

  /* Overlay derrière la sidebar mobile */
  .sidebar.open::after {
    content: '';
    position: fixed;
    top: 0; left: 260px;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,.45);
    z-index: -1;
  }

  .main-content { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .doc-fields { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .materiel-grid { grid-template-columns: 1fr; }
  .modal-box { margin: 8px; max-height: 95vh; }

  /* Topbar mobile : garde le toggle visible et accessible */
  .topbar {
    padding: 0 12px;
    position: sticky; top: 0; z-index: 100;
  }
  .btn-menu-toggle {
    z-index: 101;
    position: relative;
  }

  /* Bannière de rôle : ne couvre pas le toggle en mobile */
  #roleBanner {
    margin-top: 0;
    margin-left: 0;
    font-size: 12px !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
    position: relative;
    z-index: 1;
  }

  /* Sidebar footer : boutons logout ET key bien visibles sur mobile */
  .sidebar-footer {
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px;
    min-height: 64px;
  }
  .user-info {
    flex: 1 1 100%;
    min-width: 0;
    margin-bottom: 4px;
  }
  .btn-key-pwd, .btn-logout {
    flex: 1;
    min-width: 44px;
    padding: 10px 12px;
    font-size: 15px;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Modules : padding réduit mobile */
  .module { padding: 12px; }
  .module-header { margin-bottom: 16px; }
  .module-header h2 { font-size: 17px; }

  /* Section cards : padding réduit */
  .section-card { padding: 14px; }

  /* Tables : scroll horizontal */
  .data-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Rapport options : 1 colonne */
  .rapport-options { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
}

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty-state p { font-size: 14px; }

/* ===== INFRASTRUCTURE MODULE ===== */
#parametresContainer .section-card { margin-bottom: 20px; }
#parametresContainer .form-row { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
#parametresContainer input[type="text"],
#parametresContainer input[type="url"],
#parametresContainer input[type="email"],
#parametresContainer input[type="password"] {
  font-size: 12px;
  font-family: 'Courier New', monospace;
  background: #f8fafc;
}
#parametresContainer .kpi-card { min-height: 80px; }

/* ===== MISC ===== */
.table-actions { display: flex; gap: 6px; }
.progress-bar { background: #e2e8f0; border-radius: 20px; height: 6px; overflow: hidden; margin-top: 4px; }
.progress-fill { height: 100%; border-radius: 20px; background: var(--primary); transition: width .4s; }
.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.info-item { display: flex; flex-direction: column; gap: 2px; }
.info-item label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); font-weight: 600; }
.info-item span { font-size: 14px; font-weight: 600; }
.separator { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
