/* ============================================================
   UniFi Voucher Manager — Centre Reine Fabiola
   Charte graphique : teal #24A19C / navy #1C3257 / pink #D95F98
   Police : Open Sans (auto-hébergée)
   ============================================================ */

/* ── Open Sans — auto-hébergé ────────────────────── */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/assets/fonts/open-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/assets/fonts/open-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Reset ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Variables ───────────────────────────────────── */
:root {
  --teal:       #24A19C;
  --teal-dk:    #1d8a86;
  --navy:       #1C3257;
  --navy-dk:    #162848;
  --pink:       #D95F98;
  --gray-bg:    #EDEDED;
  --gray-md:    #6E6E7F;
  --gray-lt:    #B9AFA7;
  --white:      #FFFFFF;
  --dark:       #333333;
  --footer-bg:  #292929;
  --danger:     #e74c3c;
  --success-bg: #e8f7f7;
  --success-fg: #1d8a86;
  --error-bg:   #fdecea;
  --error-fg:   #c0392b;
  --radius:     6px;
  --shadow:     0 2px 10px rgba(28,50,87,.09);
  --shadow-lg:  0 4px 24px rgba(28,50,87,.13);
}

/* ── Base ────────────────────────────────────────── */
body {
  font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--dark);
  background: var(--gray-bg);
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typographie charte ──────────────────────────── */
h1 { font-size: 36px; font-weight: 500; color: var(--teal); }
h2 { font-size: 18px; font-weight: 500; color: var(--white); }
h3 { font-size: 24px; font-weight: 500; color: var(--dark); }

/* ── Page login ──────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.login-hero {
  background: var(--teal);
  padding: 48px 24px 56px;
  text-align: center;
  flex-shrink: 0;
}
.login-hero h1 {
  color: var(--white);
  font-size: 28px;
  font-weight: 500;
  margin-top: 14px;
  line-height: 1.3;
}
.login-hero p {
  color: rgba(255,255,255,.82);
  font-size: 14px;
  font-weight: 300;
  margin-top: 6px;
}
.login-hero svg { color: var(--white); }
.login-body {
  flex: 1;
  background: var(--gray-bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 24px 48px;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  margin-top: -28px;
}

/* ── Navbar utilisateur ──────────────────────────── */
.user-navbar {
  background: var(--white);
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  position: sticky;
  top: 0;
  z-index: 10;
}
.user-navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--teal);
  text-decoration: none;
}
.user-navbar-brand:hover { text-decoration: none; }
.user-navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  font-weight: 300;
  color: var(--gray-md);
}
.user-navbar-right a { color: var(--teal); font-weight: 400; }

/* Bandeau sous-navbar (site) */
.site-banner {
  background: var(--navy);
  color: var(--white);
  text-align: center;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: .01em;
}

/* ── Layout admin ────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px;
  min-width: 230px;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  color: var(--white);
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-decoration: none;
}
.sidebar-brand svg { color: var(--teal); flex-shrink: 0; }
.nav-section {
  padding: 16px 18px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.3);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: rgba(255,255,255,.65);
  font-size: 13px;
  font-weight: 300;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.nav-link svg { flex-shrink: 0; opacity: .75; }
.nav-link:hover { background: rgba(36,161,156,.12); color: var(--white); text-decoration: none; }
.nav-link.active { background: rgba(36,161,156,.18); color: var(--white); border-left-color: var(--teal); font-weight: 400; }
.nav-link.active svg { opacity: 1; }
.sidebar-footer {
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.4);
  font-size: 12px;
  font-weight: 300;
}
.sidebar-footer a:hover { color: rgba(255,255,255,.8); text-decoration: none; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--white);
  height: 52px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { font-size: 15px; font-weight: 500; color: var(--navy); }
.topbar-user  { font-size: 12px; color: var(--gray-md); font-weight: 300; display: flex; align-items: center; gap: 12px; }
.topbar-user a { color: var(--teal); font-weight: 400; }

.main { padding: 28px; flex: 1; }

/* ── Composants ──────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  margin-bottom: 22px;
}
.card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title svg { color: var(--teal); flex-shrink: 0; }

/* Stats grid */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px,1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  border-top: 3px solid var(--teal);
}
.stat-card .s-label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-md); margin-bottom: 8px; }
.stat-card .s-value { font-size: 30px; font-weight: 300; color: var(--navy); line-height: 1; }
.stat-card .s-value.teal { color: var(--teal); }
.stat-card .s-value.pink { color: var(--pink); }

/* ── Boutons CTA charte ──────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s, background .15s;
  line-height: 1;
  white-space: nowrap;
}
.btn:hover { opacity: .87; text-decoration: none; }
.btn-primary { background: var(--teal);  color: var(--white); }  /* CTAs principaux */
.btn-navy    { background: var(--navy);  color: var(--white); }  /* Secondaire */
.btn-pink    { background: var(--pink);  color: var(--white); }  /* Accent */
.btn-danger, a.btn-danger, a.btn-danger:hover { background: var(--danger); color: #fff !important; }
.btn-ghost   { background: var(--gray-bg); color: var(--dark); border: 1px solid #ddd; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-xs { padding: 3px 10px; font-size: 11px; }

/* ── Alertes ─────────────────────────────────────── */
.alert {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-bg); color: var(--success-fg); border: 1px solid #b2dfde; }
.alert-error   { background: var(--error-bg);   color: var(--error-fg);   border: 1px solid #f5c6cb; }

/* ── Formulaires ─────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  margin-bottom: 5px;
}
label .hint { font-weight: 300; color: var(--gray-lt); }
input[type=text],
input[type=email],
input[type=url],
input[type=number],
input[type=password],
select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
  color: var(--dark);
  background: var(--white);
  outline: none;
  transition: border-color .2s;
  line-height: 1.4;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(36,161,156,.1); }
input[type=checkbox] { width: auto; accent-color: var(--teal); }

/* ── Tables ──────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-md);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid var(--gray-bg);
  white-space: nowrap;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--gray-bg); font-size: 13px; vertical-align: middle; }
tbody tr:hover { background: #fafafa; }
tbody tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-active  { background: var(--success-bg); color: var(--success-fg); }
.badge-used    { background: #eaf0f8; color: var(--navy); }
.badge-expired { background: #f5f5f5; color: var(--gray-md); }
.badge-revoked { background: var(--error-bg); color: var(--danger); }
.badge-admin   { background: #eaf0f8; color: var(--navy); }
.badge-user    { background: var(--success-bg); color: var(--success-fg); }

/* ── Code voucher ────────────────────────────────── */
.voucher-code {
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--navy);
}

/* ── Progress bar (stats) ────────────────────────── */
.progress-bar  { height: 7px; background: var(--gray-bg); border-radius: 4px; overflow: hidden; margin-top: 5px; }
.progress-fill { height: 100%; border-radius: 4px; background: var(--teal); transition: width .4s; }
.progress-fill.low { background: var(--pink); }
.progress-fill.mid { background: var(--navy); }

/* ── Heatmap horaire ─────────────────────────────── */
.heatmap { display: flex; gap: 3px; align-items: flex-end; height: 64px; }
.heatmap-bar { flex: 1; border-radius: 2px 2px 0 0; background: var(--gray-bg); min-height: 3px; }
.heatmap-bar.lvl1 { background: #c8e6e5; }
.heatmap-bar.lvl2 { background: var(--teal); opacity: .5; }
.heatmap-bar.lvl3 { background: var(--teal); }
.heatmap-bar.lvl4 { background: var(--navy); }
.heatmap-labels { display: flex; gap: 3px; margin-top: 4px; }
.heatmap-labels span { flex: 1; font-size: 9px; color: var(--gray-lt); text-align: center; }

/* ── Vide ────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 20px; color: var(--gray-md); font-weight: 300; }
.empty svg { display: block; margin: 0 auto 14px; color: #ddd; }

/* ── Utilitaires ─────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

/* ── Footer app ──────────────────────────────────── */
.app-footer {
  background: var(--footer-bg);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 14px;
  font-size: 12px;
  font-weight: 400;
  margin-top: auto;
}
.app-footer a { color: var(--teal); }

/* ── Impression vouchers ─────────────────────────── */
/* L'impression se fait via une fenêtre dédiée (openPrintWindow dans dashboard.php) */
/* Pas de règles @media print nécessaires ici pour les vouchers */
