:root {
  --primary: #0e6b7a;
  --primary-dark: #093f48;
  --accent: #2fbf8f;
  --rouge: #d64545;
  --gris-fond: #f2f6f7;
  --texte: #22303a;
  --danger: #c0392b;
  --warn: #b8860b;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Roboto, Arial, sans-serif; background: var(--gris-fond); color: var(--texte); }
a { color: var(--primary); text-decoration: none; }

.page-auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.auth-box { background: #fff; padding: 40px; border-radius: var(--radius); width: 380px; box-shadow: 0 12px 32px rgba(0,0,0,.3); }
.auth-box h1 { margin: 0 0 4px; font-size: 21px; }
.auth-box .subtitle { color: #666; margin: 0 0 20px; font-size: 13px; }
.auth-box label { display: block; margin-bottom: 14px; font-size: 14px; }
.auth-box input { width: 100%; padding: 10px; margin-top: 6px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.alert { background: #fdecea; color: var(--danger); padding: 10px; border-radius: 6px; font-size: 13px; }
.alert-success { background: #e7f7ee; color: #1c7c2c; }
.alert-warn { background: #fff4d9; color: var(--warn); padding: 10px; border-radius: 6px; font-size: 13px; }

.btn { display: inline-block; background: var(--primary); color: #fff; border: none; padding: 10px 18px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid #fff; color: #fff; }
.btn-danger { background: var(--danger); }
.btn-accent { background: var(--accent); color: #04382a; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--primary-dark); color: #fff; flex-shrink: 0; overflow-y: auto; }
.sidebar-brand { font-size: 16px; font-weight: bold; padding: 20px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar nav { display: flex; flex-direction: column; padding: 10px 0; }
.sidebar nav a { color: #cdeaea; padding: 9px 20px; font-size: 13.5px; border-left: 3px solid transparent; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.08); border-left-color: var(--accent); color: #fff; }
.nav-section { padding: 12px 20px 3px; font-size: 11px; text-transform: uppercase; color: #8fb9ba; letter-spacing: .05em; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; background: #fff; padding: 14px 24px; border-bottom: 1px solid #e2e6e3; }
.topbar h2 { margin: 0; font-size: 18px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar .btn-outline { color: var(--texte); border-color: #ccc; }
.user-chip { font-size: 13px; color: #555; }
.icon-btn { background: none; border: none; font-size: 20px; cursor: pointer; }
.content { padding: 24px; }
.licence-banner { background: #fff4d9; color: var(--warn); padding: 8px 24px; font-size: 13px; text-align: center; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.07); border-left: 4px solid var(--primary); }
.card h3 { margin: 0 0 6px; font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: .03em; }
.card .value { font-size: 25px; font-weight: bold; }
.card .sub { font-size: 12px; color: #888; }
.card.alert-card { border-left-color: var(--danger); }
.card.accent-card { border-left-color: var(--accent); }

.table-wrap { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.07); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 13px; text-align: left; border-bottom: 1px solid #eef1ee; vertical-align: middle; }
th { background: #e6f2f2; color: var(--primary-dark); font-size: 11.5px; text-transform: uppercase; }
tr:hover td { background: #fafcfc; }
.badge { padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-ok { background: #e3f6e5; color: #1c7c2c; }
.badge-warn { background: #fff4d9; color: var(--warn); }
.badge-danger { background: #fdecea; color: var(--danger); }
.badge-info { background: #e3eef6; color: var(--primary); }
.badge-muted { background: #eceef0; color: #667085; }

/* Impression (plannings, listes) : n'imprime que le contenu utile */
@media print {
  .sidebar, .topbar, .toolbar, .panel form, details, .licence-banner, .btn, .no-print { display: none !important; }
  .layout, .main, .content { display: block !important; margin: 0 !important; padding: 0 !important; }
  .table-wrap { box-shadow: none !important; }
  body { background: #fff !important; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 14px; margin-bottom: 18px; }
.form-grid label { display: flex; flex-direction: column; font-size: 13px; gap: 6px; }
.form-grid input, .form-grid select, .form-grid textarea { padding: 9px; border: 1px solid #ccd3cd; border-radius: 6px; font-size: 14px; font-family: inherit; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.toolbar input[type=search] { padding: 8px 12px; border-radius: 6px; border: 1px solid #ccc; min-width: 260px; }
.panel { background: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.panel h3 { margin-top: 0; }

.thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; border: 1px solid #eee; background: #f2f2f2; }
.thumb-lg { width: 100%; max-width: 220px; border-radius: 10px; border: 1px solid #eee; }

/* Publications d'hygiène (grille de type "blog") */
.pub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 18px; }
.pub-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.pub-card img { width: 100%; height: 150px; object-fit: cover; }
.pub-card .pub-body { padding: 14px; }
.pub-card h4 { margin: 0 0 6px; }
.pub-card p { font-size: 13px; color: #555; }

/* Reçu / document imprimable */
.recu { max-width: 520px; margin: 20px auto; background: #fff; padding: 24px; border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,.1); font-size: 13px; }
.recu h2 { text-align: center; margin: 0 0 4px; color: var(--primary-dark); }
.recu .sub-center { text-align: center; color: #777; margin-bottom: 16px; font-size: 12px; }
.recu table { font-size: 12px; }
.recu .total-row td { font-weight: bold; border-top: 2px solid #333; }
@media print { .no-print { display: none !important; } body { background: #fff; } .recu { box-shadow: none; margin: 0; } }

