/* Base shared styles — Light Theme */
:root {
  --brand:#1a1d56;
  --accent:#5865f2;
  --bg:#f8fafc;     /* clair */
  --panel:#ffffff;
  --muted:#64748b;
}

* { box-sizing: border-box; }

body {
  margin:0;
  font-family: system-ui, sans-serif;
  background: var(--bg);   /* clair */
  color:#1e293b;           /* texte foncé */
}


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

/* Navbar - respecte la préférence précédente (fond foncé + texte blanc) */
header.navbar{
  position: sticky; top:0; z-index:100;
  background: rgba(26,29,86,.85);
  backdrop-filter: blur(8px);
  border-bottom:1px solid rgba(255,255,255,.12);
}
.container{ max-width:1200px; margin:0 auto; padding:0 16px; }
.nav-inner{ display:flex; align-items:center; gap:16px; padding:12px 0; }
.brand{ display:flex; align-items:center; gap:10px; font-weight:700; letter-spacing:.3px; color:#fff; }
.brand .dot{
  width:10px; height:10px; border-radius:999px;
  background:linear-gradient(45deg, var(--accent), #7aa2ff);
  box-shadow:0 0 12px rgba(88,101,242,.7);
}
nav a{ padding:8px 10px; border-radius:10px; color:#fff; }
nav a.active, nav a:hover{ background: rgba(255,255,255,.12); }

main{ padding:24px 0 64px; }

footer{
  border-top:1px solid rgba(0,0,0,.08);
  padding:12px 0;
  color:#475569;
  font-size:.9rem;
}

.spacer{ flex:1; }
.role-pill{
  font-size:.8rem; padding:6px 10px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:999px; color:#334155; background:#f1f5f9;
}
.hidden{ display:none !important; }

/* Cartes, grilles, composants génériques */
.card{
  background: var(--panel);
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
  padding:16px;
}
.grid{ display:grid; gap:16px; }
.grid.cols-2{ grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.cols-3{ grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width:900px){ .grid.cols-2, .grid.cols-3{ grid-template-columns:1fr; } }

/* Boutons */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:10px 14px; border-radius:14px;
  background:#e2e8f0; color:#1e293b;
  border:1px solid rgba(0,0,0,.10);
  cursor:pointer;
  transition: filter .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover{ background:#cbd5e1; }
.btn:focus{ outline:none; box-shadow:0 0 0 3px #6aa3ff33; border-color:#6aa3ff; }

/* Variants */
.btn.primary, .btn.btn-primary{
  background: linear-gradient(180deg, #5865f2, #4856de);
  color:#fff;
  border:1px solid rgba(88,101,242,.6);
}
.btn.primary:hover, .btn.btn-primary:hover{ filter: brightness(1.04); }

.btn.secondary, .btn.btn-secondary{
  background:#f1f5f9; color:#111827; border-color:#e5e7eb;
}
.btn.secondary:hover, .btn.btn-secondary:hover{ background:#e5e7eb; }

.btn.success, .btn.btn-success{ background:#16a34a; color:#fff; border-color:#15803d; }
.btn.success:hover, .btn.btn-success:hover{ filter:brightness(1.05); }

.btn.danger, .btn.btn-danger{ background:#dc2626; color:#fff; border-color:#b91c1c; }
.btn.danger:hover, .btn.btn-danger:hover{ filter:brightness(1.05); }

.btn.outline, .btn.btn-outline{ background:transparent; color:#1e293b; }
.btn.outline:hover, .btn.btn-outline:hover{ background:#f1f5f9; }

.btn.btn-outline-danger, .btn.outline-danger{
  background:transparent; color:#b91c1c; border-color:#ef4444;
}
.btn.btn-outline-danger:hover, .btn.outline-danger:hover{
  background:#fee2e2; border-color:#ef4444; color:#991b1b;
}

.btn.ghost, .btn.btn-ghost{ background:transparent; border-color:#e5e7eb; }
.btn.ghost:hover, .btn.btn-ghost:hover{ background:#f8fafc; }

.btn-sm{ padding:6px 10px; border-radius:12px; font-size:.92rem; }

/* Inputs */
.input, input[type="text"], input[type="number"], input[type="date"], input[type="email"], select, textarea,
.form-control{
  background:#fff;
  border:1px solid var(--border, rgba(0,0,0,.15));
  padding:12px 14px; border-radius:14px; color:#0f172a; width:100%;
}
.input:focus, input:focus, select:focus, textarea:focus, .form-control:focus{
  outline: none;
  border-color: #6aa3ff;
  box-shadow: 0 0 0 3px #6aa3ff33;
}

/* Tables */
.table{
  width:100%;
  border-collapse: collapse;
  border:1px solid rgba(0,0,0,.08);
  border-radius:12px;
  overflow:hidden;
  background: var(--panel);
}
.table thead th{
  text-align:left; font-weight:600;
  background:#f1f5f9;
  color:#0f172a;
  padding:10px;
  border-bottom:1px solid rgba(0,0,0,.08);
}
.table tbody td{
  padding:10px;
  border-bottom:1px solid rgba(0,0,0,.06);
  color:#1e293b;
}
.table tbody tr:hover{ background:#f8fafc; }

/* --- NAVIGATION STYLES --- */

/* Navbar principale (fond foncé en haut) */
header.navbar nav a {
  color: #fff; /* blanc sur fond foncé */
}
header.navbar nav a.active,
header.navbar nav a:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}

/* Tabs internes (fond clair dans le contenu) */

/* ===== Responsive Tabs ===== */
.tabs { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; }
.tabs .tab, .tabs a { display:inline-flex; align-items:center; gap:.4rem; padding:.5rem .8rem; border-radius:999px; line-height:1; text-decoration:none; white-space:nowrap; }
@media (max-width: 900px) {
  .tabs { gap:.4rem; }
  .tabs .tab, .tabs a { padding:.45rem .7rem; font-size:.95rem; }
}
@media (max-width: 620px) {
  .tabs { flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:thin; scroll-snap-type:x proximity; gap:.35rem; }
  .tabs .tab, .tabs a { flex:0 0 auto; scroll-snap-align:start; }
}
.hstack.responsive { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
@media (max-width: 620px){
  .hide-on-mobile{ display:none !important; }
  .stack-on-mobile{ display:flex; flex-direction:column; align-items:stretch; gap:.5rem; }
}

.tabs a, .tabs .tab {
  color: #1e293b; /* texte foncé */
  background: #fff;
  border: 1px solid rgba(0,0,0,.1);
}
.tabs a.active, .tabs .tab.active,
.tabs a:hover, .tabs .tab:hover {
  background: rgba(88,101,242,.1); /* léger bleu clair */
  border-color: rgba(88,101,242,.35);
  color: #1a1d56; /* accent plus lisible */
}

/* ==== Calendrier ==== */
.cal-bar{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin:.5rem 0}
.cal-bar .btn{padding:.4rem .6rem}
#calendar, .calendar{
  display:grid;
  grid-template-columns: repeat(7, minmax(0,1fr));
  gap:.4rem;
  min-height: 16rem;
}
.cal-head{
  font-weight:600;
  text-align:center;
  padding:.25rem 0;
  border-bottom:1px solid #eee;
}
.day{
  border:1px solid #eee;
  border-radius:.5rem;
  min-height: 5rem;
  padding:.5rem;
  background:#fff;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-start;
  text-align:left;
}
.day:hover{outline:2px solid rgba(26,29,86,.25)}
.day.out{opacity:.45}
.day .dnum{font-weight:600;margin-bottom:.25rem}
.day .badge{
  margin-top:auto;
  font-size:.75rem;
  line-height:1;
  padding:.15rem .4rem;
  border-radius:999px;
  background: rgba(26,29,86,.85);
  color:#fff;
}
@media (max-width: 640px){
  #calendar, .calendar{ gap:.25rem }
  .day{ min-height: 4rem; padding:.4rem }
}
@media (max-width: 620px){ h1{font-size:1.4rem;} h2{font-size:1.15rem;} .hero p{font-size:.98rem;} }

/* ==== Notifications (toasts) ==== */
.notices{
  position: fixed; bottom: 16px; right: 16px; z-index: 9999;
  display:flex; flex-direction:column; gap:8px; pointer-events:none;
}
.notice{
  min-width: 260px; max-width: 420px;
  background:#ffffff; color:#0f172a;
  border:1px solid rgba(0,0,0,.12); border-left:4px solid #64748b;
  border-radius:12px; padding:10px 12px; box-shadow:0 6px 18px rgba(0,0,0,.10);
  pointer-events:auto; display:flex; align-items:center; justify-content:space-between; gap:10px;
  animation: slideIn .18s ease-out;
}
.notice.success{ border-left-color:#16a34a; background:#ecfdf5; }
.notice.error{ border-left-color:#dc2626; background:#fef2f2; }
.notice .msg{ flex:1; }
.notice .close{ background:transparent; border:none; cursor:pointer; color:#334155; }
@keyframes slideIn { from{ transform: translateY(6px); opacity:.0; } to{ transform: translateY(0); opacity:1; } }
