/* ============================================================
   GUIDE EVENT — Style raffiné, sobre, distingué
   Police : DM Sans + DM Mono
   Palette : Blanc cassé / Marine profond / Or discret
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

:root {
  --navy:      #0f1e30;
  --navy-mid:  #1a3050;
  --navy-soft: #243d5a;
  --gold:      #c8a96e;
  --gold-light:#e8d5a8;
  --white:     #ffffff;
  --off-white: #f7f6f3;
  --surface:   #ffffff;
  --border:    #e8e4de;
  --border-strong: #c8c4bc;
  --text:      #1a1a1a;
  --text-mid:  #4a4a4a;
  --text-muted:#8a8680;
  --green:     #2d7a4f;
  --green-bg:  #edf7f2;
  --red:       #c0392b;
  --red-bg:    #fdf0ef;
  --amber:     #b8601a;
  --amber-bg:  #fdf4ec;
  --blue:      #1a5fa8;
  --blue-bg:   #eff5fc;
  --sidebar-w: 230px;
  --radius:    6px;
  --radius-lg: 10px;
  --shadow:    0 1px 3px rgba(15,30,48,.07), 0 4px 16px rgba(15,30,48,.06);
  --shadow-md: 0 2px 8px rgba(15,30,48,.10), 0 8px 24px rgba(15,30,48,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  background: var(--off-white);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
}

a { color: var(--navy-mid); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold); }

.ge-layout { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.ge-sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.ge-sidebar::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--gold) 0%, transparent 100%);
}
.ge-sidebar .brand {
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.ge-sidebar .brand-name {
  font-size: 1.05rem; font-weight: 700; color: var(--white);
  letter-spacing: .4px; display: flex; align-items: center; gap: 8px;
}
.ge-sidebar .brand-name .logo-dot {
  width: 7px; height: 7px; background: var(--gold);
  border-radius: 50%; flex-shrink: 0;
}
.ge-sidebar .brand-sub {
  font-size: .72rem; color: rgba(255,255,255,.35);
  margin-top: 3px; letter-spacing: .6px; text-transform: uppercase;
}
.ge-sidebar nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.ge-sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 22px; color: rgba(255,255,255,.55);
  font-size: .88rem; font-weight: 400;
  border-left: 2px solid transparent; transition: all .15s;
}
.ge-sidebar nav a .nav-icon { font-size: .95rem; width: 18px; text-align: center; opacity: .7; }
.ge-sidebar nav a:hover {
  color: rgba(255,255,255,.9); background: rgba(255,255,255,.04); text-decoration: none;
}
.ge-sidebar nav a.active {
  color: var(--gold-light); background: rgba(200,169,110,.07);
  border-left-color: var(--gold); font-weight: 500;
}
.ge-sidebar nav a.active .nav-icon { opacity: 1; }
.ge-sidebar .nav-sep { height: 1px; background: rgba(255,255,255,.05); margin: 6px 22px; }
.ge-sidebar .sidebar-footer { padding: 14px 22px; border-top: 1px solid rgba(255,255,255,.06); }
.ge-sidebar .sidebar-footer .user-name { font-size: .85rem; font-weight: 600; color: rgba(255,255,255,.8); }
.ge-sidebar .sidebar-footer .user-role { font-size: .7rem; color: rgba(255,255,255,.3); text-transform: uppercase; letter-spacing: .5px; margin-top: 1px; }

/* ── MAIN ── */
.ge-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ── TOPBAR ── */
.ge-topbar {
  background: var(--white); border-bottom: 1px solid var(--border);
  height: 54px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.ge-topbar .page-title { font-size: .95rem; font-weight: 600; color: var(--navy); letter-spacing: .2px; }
.ge-topbar .topbar-right { display: flex; align-items: center; gap: 12px; }
.ge-topbar .user-avatar {
  width: 30px; height: 30px; background: var(--navy);
  color: var(--gold-light); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; letter-spacing: .3px;
}
#mob-toggle { display: none; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--navy); padding: 4px; }

/* ── CONTENT ── */
.ge-content { padding: 26px 28px; flex: 1; }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow); transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card .stat-icon { width: 42px; height: 42px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.stat-card .stat-val { font-size: 1.7rem; font-weight: 700; line-height: 1; color: var(--navy); font-family: 'DM Mono', monospace; }
.stat-card .stat-label { font-size: .73rem; color: var(--text-muted); margin-top: 3px; text-transform: uppercase; letter-spacing: .5px; }
.stat-card.blue   { border-bottom: 2px solid var(--blue);  }
.stat-card.blue   .stat-icon { background: var(--blue-bg);  color: var(--blue); }
.stat-card.green  { border-bottom: 2px solid var(--green); }
.stat-card.green  .stat-icon { background: var(--green-bg); color: var(--green); }
.stat-card.amber  { border-bottom: 2px solid var(--amber); }
.stat-card.amber  .stat-icon { background: var(--amber-bg); color: var(--amber); }
.stat-card.red    { border-bottom: 2px solid var(--red);   }
.stat-card.red    .stat-icon { background: var(--red-bg);   color: var(--red); }

/* ── CARDS ── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.card-header h2 { font-size: .9rem; font-weight: 600; color: var(--navy); letter-spacing: .2px; display: flex; align-items: center; gap: 7px; }
.card-body { padding: 20px; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
thead tr { background: var(--off-white); }
th { padding: 10px 14px; text-align: left; font-size: .71rem; text-transform: uppercase; letter-spacing: .7px; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-mid); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--off-white); }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: .72rem; font-weight: 600; letter-spacing: .3px; white-space: nowrap; }
.badge-attendu { background: var(--blue-bg);  color: var(--blue); }
.badge-present { background: var(--green-bg); color: var(--green); }
.badge-sorti   { background: var(--off-white); color: var(--text-muted); border: 1px solid var(--border); }
.badge-success { background: var(--green-bg); color: var(--green); }
.badge-danger  { background: var(--red-bg);   color: var(--red); }
.badge-warning { background: var(--amber-bg); color: var(--amber); }
.badge-navy    { background: var(--navy);     color: var(--gold-light); }

/* ── BOUTONS ── */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 16px; border-radius: var(--radius); font-size: .84rem; font-weight: 500; border: 1px solid transparent; cursor: pointer; transition: all .15s; font-family: inherit; text-decoration: none; line-height: 1.4; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-mid); color: var(--white); }
.btn-accent { background: var(--gold); color: var(--navy); border-color: var(--gold); font-weight: 600; }
.btn-accent:hover { background: var(--gold-light); color: var(--navy); }
.btn-danger { background: var(--red-bg); color: var(--red); border-color: #f0c0bc; }
.btn-danger:hover { background: var(--red); color: var(--white); }
.btn-outline { background: var(--white); color: var(--text-mid); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.btn-sm { padding: 4px 11px; font-size: .78rem; }
.btn-xs { padding: 3px 8px; font-size: .73rem; }

/* ── FORMULAIRES ── */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 5px; color: var(--text-mid); text-transform: uppercase; letter-spacing: .4px; }
input[type=text],input[type=email],input[type=password],input[type=tel],input[type=datetime-local],input[type=date],input[type=color],select,textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: .88rem; color: var(--text); background: var(--white); font-family: inherit; transition: border-color .15s, box-shadow .15s; }
input:focus,select:focus,textarea:focus { outline: none; border-color: var(--navy-mid); box-shadow: 0 0 0 3px rgba(26,48,80,.08); }
textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }

/* ── ALERTS ── */
.alert { padding: 11px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: .87rem; display: flex; align-items: flex-start; gap: 9px; border: 1px solid transparent; }
.alert-success { background: var(--green-bg); color: var(--green); border-color: #b6e4cc; }
.alert-danger  { background: var(--red-bg);   color: var(--red);   border-color: #f0c0bc; }
.alert-warning { background: var(--amber-bg); color: var(--amber); border-color: #f0d0a8; }
.alert-info    { background: var(--blue-bg);  color: var(--blue);  border-color: #b8d4f0; }

/* ── PAGINATION ── */
.pagination { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pagination a,.pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: var(--radius); font-size: .82rem; font-family: 'DM Mono',monospace; border: 1px solid var(--border); background: var(--white); color: var(--text-mid); text-decoration: none; transition: all .15s; }
.pagination a:hover { border-color: var(--navy); color: var(--navy); }
.pagination span.current { background: var(--navy); color: var(--gold-light); border-color: var(--navy); font-weight: 600; }

/* ── MODAL ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(10,20,35,.5); z-index: 200; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(2px); }
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: var(--radius-lg); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(10,20,35,.25); border: 1px solid var(--border); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: .95rem; font-weight: 700; color: var(--navy); }
.modal-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-muted); width: 28px; height: 28px; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.modal-close:hover { background: var(--off-white); color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--off-white); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ── LOGIN ── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); padding: 20px; position: relative; overflow: hidden; }
.login-page::before { content: ''; position: absolute; width: 600px; height: 600px; background: radial-gradient(circle, rgba(200,169,110,.08) 0%, transparent 70%); top: -100px; right: -100px; pointer-events: none; }
.login-box { background: var(--white); border-radius: 12px; padding: 40px 36px; width: 100%; max-width: 380px; box-shadow: 0 24px 80px rgba(0,0,0,.3); position: relative; z-index: 1; }
.login-box::before { content: ''; display: block; height: 3px; background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%); border-radius: 12px 12px 0 0; position: absolute; top: 0; left: 0; right: 0; }
.login-box .brand { text-align: center; margin-bottom: 28px; }
.login-box .brand h1 { font-size: 1.4rem; color: var(--navy); font-weight: 700; letter-spacing: .3px; }
.login-box .brand p { color: var(--text-muted); font-size: .82rem; margin-top: 4px; }
.login-box .demo-hint { text-align: center; margin-top: 18px; font-size: .75rem; color: var(--text-muted); padding: 9px 12px; background: var(--off-white); border-radius: var(--radius); border: 1px solid var(--border); font-family: 'DM Mono',monospace; }

/* ── QR ZONE ── */
.qr-scan-area { background: var(--navy); border-radius: var(--radius-lg); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.25); font-size: 3.5rem; margin-bottom: 14px; position: relative; overflow: hidden; max-height: 200px; }
.qr-scan-area .scan-frame { position: absolute; width: 55%; height: 55%; border: 2px solid var(--gold); border-radius: 6px; }

/* ── CHART ── */
.chart-bar-wrap { display: flex; align-items: flex-end; gap: 5px; height: 80px; padding: 0 2px; }
.chart-bar { flex: 1; background: var(--navy-soft); border-radius: 3px 3px 0 0; min-height: 3px; opacity: .7; transition: opacity .2s; }
.chart-bar:hover { opacity: 1; }
.chart-labels { display: flex; gap: 5px; margin-top: 4px; }
.chart-labels span { flex: 1; text-align: center; font-size: .66rem; color: var(--text-muted); font-family: 'DM Mono',monospace; }

/* ── MISC ── */
.event-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.search-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-bar input { max-width: 260px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 2rem; margin-bottom: 10px; opacity: .4; }
.empty-state p { font-size: .88rem; }
code { font-family: 'DM Mono',monospace; font-size: .8rem; background: var(--off-white); border: 1px solid var(--border); padding: 1px 6px; border-radius: 3px; color: var(--navy-mid); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99; }
.sidebar-overlay.open { display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  #mob-toggle { display: block; }
  .ge-sidebar { transform: translateX(-100%); }
  .ge-sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  .ge-main { margin-left: 0; }
  .ge-content { padding: 14px 16px; }
  .ge-topbar { padding: 0 16px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 16px; }
  .stat-card { padding: 13px 14px; gap: 10px; }
  .stat-card .stat-icon { width: 36px; height: 36px; font-size: 1rem; }
  .stat-card .stat-val { font-size: 1.35rem; }
  .form-row,.form-row.cols-3 { grid-template-columns: 1fr; }
  .card-header { flex-direction: column; align-items: flex-start; }
  table thead { display: none; }
  table tr { display: block; border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 10px; background: var(--white); padding: 10px 14px; box-shadow: var(--shadow); }
  table td { display: flex; justify-content: space-between; align-items: center; border: none; padding: 5px 0; font-size: .83rem; border-bottom: 1px solid var(--border); }
  table td:last-child { border-bottom: none; }
  table td::before { content: attr(data-label); font-weight: 600; font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; flex-shrink: 0; margin-right: 10px; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { max-width: 100%; border-radius: 14px 14px 0 0; max-height: 92vh; }
  .modal-footer { border-radius: 0; }
  .search-bar { flex-direction: column; align-items: stretch; }
  .search-bar input { max-width: 100%; }
  .login-box { padding: 30px 22px; }
}
@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card .stat-val { font-size: 1.15rem; }
  .ge-content { padding: 12px; }
}
@media print {
  .ge-sidebar,.ge-topbar,.btn,.pagination,#mob-toggle { display: none !important; }
  .ge-main { margin-left: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
