/* ════════════════════════════════════════════════════════════════
   AMERICAN INK TATTOO — Old-school flash / parchemin
   ════════════════════════════════════════════════════════════════ */

:root {
  --paper:      #e8dcc0;
  --paper-2:    #ddcfae;
  --paper-3:    #d2c29c;
  --ink:        #1a1512;
  --ink-soft:   #3a2f26;
  --red:        #8b1a1a;
  --red-bright: #b8302a;
  --navy:       #1e2a4a;
  --gold:       #b8893a;
  --gold-soft:  #cfa75c;
  --line:       #4a3b2c;
  --ok:         #4f7a3f;
  --warn:       #c2761f;
  --danger:     #8b1a1a;

  --shadow:     0 10px 30px rgba(26,21,18,.28);
  --radius:     4px;
  --font-disp:  'Rye', serif;
  --font-ui:    'Oswald', sans-serif;
  --font-body:  'Spectral', Georgia, serif;
  --font-type:  'Special Elite', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 20% 15%, rgba(184,137,58,.10), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(30,42,74,.08), transparent 45%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

::selection { background: var(--red); color: var(--paper); }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper-3); }
::-webkit-scrollbar-thumb { background: var(--line); border: 3px solid var(--paper-3); border-radius: 6px; }

/* ════════════ TYPO ════════════ */
h1, h2, h3 { font-family: var(--font-disp); font-weight: 400; letter-spacing: .5px; color: var(--ink); }
.section-title {
  font-family: var(--font-disp);
  font-size: 2rem;
  color: var(--ink);
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: ""; display: block; height: 3px; margin-top: 6px;
  background: linear-gradient(90deg, var(--red), transparent);
}
.eyebrow {
  font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 3px;
  font-size: .72rem; font-weight: 600; color: var(--red);
}

/* ════════════ BOUTONS ════════════ */
.btn {
  font-family: var(--font-ui); font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.2px; font-size: .82rem;
  padding: 11px 20px; border: 2px solid var(--ink);
  background: var(--paper); color: var(--ink); cursor: pointer;
  border-radius: var(--radius); transition: transform .12s, box-shadow .12s, background .15s;
  box-shadow: 3px 3px 0 var(--ink); position: relative;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.btn--primary { background: var(--red); color: var(--paper); border-color: var(--ink); }
.btn--primary:hover { background: var(--red-bright); }
.btn--navy { background: var(--navy); color: var(--paper); }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn--ghost:hover { background: rgba(26,21,18,.06); box-shadow: none; transform: none; }
.btn--danger { background: var(--danger); color: var(--paper); }
.btn--block { width: 100%; }
.btn--sm { padding: 7px 13px; font-size: .72rem; box-shadow: 2px 2px 0 var(--ink); }
.btn--sm:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.icon-btn {
  font-family: var(--font-ui); border: 1.5px solid var(--line); background: var(--paper);
  width: 30px; height: 30px; border-radius: var(--radius); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: .9rem;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--ink); color: var(--paper); }
.icon-btn--danger:hover { background: var(--danger); color: var(--paper); border-color: var(--danger); }

/* ════════════ CHAMPS ════════════ */
.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block; font-family: var(--font-ui); text-transform: uppercase;
  letter-spacing: 1.5px; font-size: .7rem; font-weight: 600; color: var(--ink-soft);
  margin-bottom: 6px;
}
input, select, textarea {
  width: 100%; font-family: var(--font-body); font-size: .95rem;
  padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--radius);
  background: rgba(255,250,240,.55); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}
input::placeholder { color: #9b8d72; }
.form-error {
  font-family: var(--font-ui); color: var(--red); font-size: .82rem;
  letter-spacing: .5px; margin-bottom: 12px; text-transform: uppercase;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ════════════ ÉCRAN DE CONNEXION ════════════ */
.login-screen, .overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 50;
}
.overlay { background: rgba(26,21,18,.75); backdrop-filter: blur(3px); }
.login-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 50% 30%, rgba(139,26,26,.12), transparent 55%),
    linear-gradient(160deg, var(--paper-2), var(--paper-3));
}
.login-card { width: 100%; max-width: 420px; }
.frame {
  background: linear-gradient(180deg, rgba(255,250,240,.6), rgba(210,194,156,.4));
  border: 3px double var(--ink);
  border-radius: 6px; padding: 36px 32px 28px;
  box-shadow: var(--shadow), inset 0 0 0 6px rgba(255,250,240,.35);
  text-align: center; position: relative;
}
.frame::before {
  content: ""; position: absolute; inset: 9px; border: 1px solid var(--line);
  border-radius: 3px; pointer-events: none;
}
.login-logo img { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
.login-title { font-family: var(--font-disp); font-size: 2.6rem; line-height: 1; color: var(--ink); margin-top: 4px; }
.login-sub { font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 2px; font-size: .74rem; color: var(--red); margin: 6px 0 22px; }
.banner {
  font-family: var(--font-ui); font-weight: 700; text-transform: uppercase;
  letter-spacing: 3px; font-size: .68rem; color: var(--paper);
  background: var(--navy); display: inline-block; padding: 4px 16px; border-radius: 2px;
  position: relative;
}
.banner--top { margin-bottom: 10px; }
.banner--bottom { margin-top: 18px; background: var(--red); }
#login-form { text-align: left; margin-top: 6px; }

/* ════════════ TOPBAR ════════════ */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(180deg, var(--ink), #271f19);
  color: var(--paper); padding: 0 22px; height: 64px;
  border-bottom: 3px solid var(--red);
  position: sticky; top: 0; z-index: 30;
}
.topbar__brand { display: flex; align-items: center; gap: 12px; }
.topbar__logo { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 0 4px rgba(184,137,58,.4)); }
.topbar__name { font-family: var(--font-disp); font-size: 1.45rem; color: var(--paper); line-height: 1; }
.topbar__tag { font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 3px; font-size: .6rem; color: var(--gold-soft); }
.theme-toggle {
  margin-left: auto; width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--gold); background: rgba(184,137,58,.12); color: var(--gold-soft);
  font-size: 1.05rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, transform .15s, color .15s; line-height: 1;
}
.theme-toggle:hover { background: var(--gold); color: var(--ink); transform: rotate(-18deg); }
.topbar__week {
  font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 1.5px;
  font-size: .8rem; font-weight: 600; color: var(--paper); white-space: nowrap;
  border: 1.5px solid var(--gold); border-radius: 2px; padding: 5px 14px;
  background: rgba(184,137,58,.12);
}

/* ── Boutons retour / rafraîchir ── */
.topbar__nav { display: flex; align-items: center; gap: 8px; }
.navbtn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--gold); background: rgba(184,137,58,.12); color: var(--gold-soft);
  font-size: 1.05rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, transform .15s; line-height: 1; padding: 0;
}
.navbtn:hover { background: var(--gold); color: var(--ink); }
.navbtn:disabled { opacity: .35; cursor: not-allowed; }
.navbtn.is-spinning { animation: navspin .6s linear infinite; }
@keyframes navspin { to { transform: rotate(360deg); } }
/* Barre retour/rafraîchir des écrans de connexion / mot de passe */
.screen-nav { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.screen-nav .navbtn { width: auto; min-width: 34px; height: 32px; border-radius: 4px; padding: 0 10px; font-size: .8rem; gap: 6px; }
.topbar__user { display: flex; align-items: center; gap: 14px; }
.topbar__user-info { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.topbar__username { font-family: var(--font-ui); font-weight: 600; font-size: .9rem; }
.badge-grade {
  font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 1px; font-size: .6rem;
  padding: 1px 8px; border-radius: 2px; background: var(--red); color: var(--paper); font-weight: 600;
}
.badge-grade[data-g="superadmin"] { background: var(--gold); color: var(--ink); }
.badge-grade[data-g="admin"]      { background: var(--red); }
.badge-grade[data-g="manager"]    { background: var(--navy); }
.badge-grade[data-g="employe"]    { background: var(--ink-soft); }
.topbar__burger { display: none; background: none; border: none; color: var(--paper); font-size: 1.5rem; cursor: pointer; }
/* Bouton déconnexion (fond sombre → texte clair) */
.topbar .btn--ghost {
  color: var(--paper); border-color: rgba(232,220,192,.45); background: rgba(232,220,192,.06);
}
.topbar .btn--ghost:hover { background: var(--red); color: var(--paper); border-color: var(--red); }

/* ════════════ LAYOUT + SIDEBAR ════════════ */
.layout { display: flex; flex: 1; }
.sidebar {
  width: 232px; flex-shrink: 0; background: linear-gradient(180deg, var(--paper-2), var(--paper-3));
  border-right: 3px solid var(--ink);
  display: flex; flex-direction: column; padding: 18px 0;
  position: sticky; top: 64px; height: calc(100vh - 64px);
}
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; overflow-y: auto; flex: 1; }
.nav__item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 1px; font-size: .82rem;
  font-weight: 500; color: var(--ink-soft); cursor: pointer; border-radius: var(--radius);
  border: 1.5px solid transparent; position: relative; transition: background .14s, color .14s;
}
.nav__item:hover { background: rgba(26,21,18,.06); color: var(--ink); }
.nav__item.active {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--red);
}
.nav__item.active .nav__num { color: var(--gold-soft); }
.nav__num { font-family: var(--font-disp); font-size: .9rem; color: var(--red); width: 20px; }
.nav__ico { width: 18px; text-align: center; }
.sidebar__seal {
  text-align: center; padding: 16px 12px 4px; border-top: 1px dashed var(--line); margin: 0 12px;
}
.sidebar__seal img { width: 54px; opacity: .8; }
.sidebar__seal span { display: block; font-family: var(--font-disp); font-size: .9rem; color: var(--red); }

/* ════════════ VIEW ════════════ */
.view { flex: 1; padding: 28px 34px; max-width: 1280px; width: 100%; }
.view__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.view__head .eyebrow { margin-bottom: 4px; }

/* ════════════ CARTES (planches de flash) ════════════ */
.card {
  background: linear-gradient(180deg, rgba(255,250,240,.55), rgba(221,207,174,.35));
  border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: 5px 5px 0 rgba(26,21,18,.15);
  padding: 20px; position: relative;
}
.card--frame::before {
  content: ""; position: absolute; inset: 5px; border: 1px solid var(--line);
  border-radius: 2px; pointer-events: none;
}
.card__title {
  font-family: var(--font-disp); font-size: 1.2rem; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.grid { display: grid; gap: 18px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* ── Tuiles de stats (badges flash) ── */
.stat {
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 18px 20px; position: relative; overflow: hidden;
  box-shadow: 4px 4px 0 rgba(26,21,18,.18);
}
.stat::after {
  content: ""; position: absolute; right: -18px; top: -18px; width: 70px; height: 70px;
  background: radial-gradient(circle, rgba(139,26,26,.12), transparent 70%); border-radius: 50%;
}
.stat__label { font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 1.5px; font-size: .68rem; color: var(--ink-soft); font-weight: 600; }
.stat__value { font-family: var(--font-disp); font-size: 2.1rem; line-height: 1.1; margin-top: 6px; color: var(--ink); }
.stat__value.is-red { color: var(--red); }
.stat__value.is-navy { color: var(--navy); }
.stat__value.is-green { color: var(--ok); }
.stat__sub { font-family: var(--font-type); font-size: .72rem; color: var(--ink-soft); margin-top: 4px; }
.stat--accent { background: var(--ink); }
.stat--accent .stat__label { color: var(--gold-soft); }
.stat--accent .stat__value { color: var(--paper); }
.stat--accent .stat__sub { color: var(--paper-3); }

/* ════════════ TABLES ════════════ */
.table-wrap { overflow-x: auto; border: 2px solid var(--ink); border-radius: var(--radius); background: rgba(255,250,240,.4); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
  font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 1px; font-size: .68rem;
  text-align: left; padding: 11px 14px; background: var(--ink); color: var(--paper); font-weight: 600;
  white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid rgba(74,59,44,.25); }
tbody tr:nth-child(even) { background: rgba(210,194,156,.25); }
tbody tr:hover { background: rgba(184,137,58,.16); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-type); }
.t-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty {
  text-align: center; padding: 40px 20px; font-family: var(--font-type); color: var(--ink-soft);
}
.empty span { font-family: var(--font-disp); font-size: 1.4rem; display: block; color: var(--red); margin-bottom: 6px; }

/* ── tags / pills ── */
.pill {
  font-family: var(--font-ui); text-transform: uppercase; letter-spacing: .8px; font-size: .64rem;
  padding: 2px 9px; border-radius: 10px; border: 1.5px solid var(--line); font-weight: 600;
  display: inline-block;
}
.pill--red { background: rgba(139,26,26,.12); color: var(--red); border-color: var(--red); }
.pill--navy { background: rgba(30,42,74,.1); color: var(--navy); border-color: var(--navy); }
.pill--gold { background: rgba(184,137,58,.16); color: #8a6320; border-color: var(--gold); }
.pill--alert { background: var(--red); color: var(--paper); border-color: var(--ink); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* ════════════ MODALE ════════════ */
.modal-back {
  position: fixed; inset: 0; background: rgba(26,21,18,.72); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--paper); border: 3px double var(--ink); border-radius: 6px;
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow); animation: rise .22s ease;
}
@keyframes rise { from { transform: translateY(18px); opacity: 0; } }
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 2px solid var(--ink); background: linear-gradient(180deg, var(--paper-2), transparent);
}
.modal__head h3 { font-size: 1.4rem; }
.modal__body { padding: 22px; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--line); }
.modal__close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--ink); line-height: 1; }

/* ════════════ TOASTS ════════════ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast {
  font-family: var(--font-ui); font-size: .85rem; letter-spacing: .5px;
  padding: 13px 20px; border-radius: var(--radius); color: var(--paper);
  background: var(--ink); border-left: 5px solid var(--gold);
  box-shadow: var(--shadow); animation: slideIn .25s ease; min-width: 240px;
}
.toast--ok  { border-left-color: var(--ok); }
.toast--err { border-left-color: var(--red-bright); }
.toast--warn{ border-left-color: var(--warn); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }

/* ════════════ DIVERS ════════════ */
.muted { color: var(--ink-soft); }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap-gap { display: flex; flex-wrap: wrap; gap: 10px; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }
.money { font-family: var(--font-type); font-variant-numeric: tabular-nums; }
.money--big { font-family: var(--font-disp); }

/* barre de progression (jauge stock) */
.gauge { height: 7px; background: rgba(74,59,44,.25); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.gauge__fill { height: 100%; background: var(--ok); border-radius: 4px; }
.gauge__fill.is-low { background: var(--red); }
.gauge__fill.is-mid { background: var(--warn); }

/* graphe barres simple */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars__bar { width: 70%; background: linear-gradient(180deg, var(--red), var(--navy)); border: 1.5px solid var(--ink); border-radius: 3px 3px 0 0; min-height: 3px; transition: height .4s ease; }
.bars__lbl { font-family: var(--font-type); font-size: .66rem; color: var(--ink-soft); }

/* ════════════ CALENDRIER ════════════ */
.cal-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-month {
  font-family: var(--font-disp); font-size: 1.6rem; min-width: 210px; text-align: center;
  text-transform: capitalize;
}
.cal-spacer { flex: 1; }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden;
  background: var(--line);
  gap: 1px;
}
.cal-dow {
  background: var(--ink); color: var(--paper); font-family: var(--font-ui); font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px; font-size: .68rem; text-align: center; padding: 9px 4px;
}
.cal-cell {
  background: rgba(255,250,240,.5); min-height: 116px; padding: 5px 6px 7px;
  display: flex; flex-direction: column; gap: 3px; position: relative; cursor: pointer;
  transition: background .12s;
}
.cal-cell:hover { background: rgba(184,137,58,.14); }
.cal-cell.is-other { background: rgba(210,194,156,.3); opacity: .6; }
.cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--red); }
.cal-daynum {
  font-family: var(--font-ui); font-weight: 600; font-size: .82rem; color: var(--ink-soft);
  align-self: flex-end; line-height: 1;
}
.cal-cell.is-today .cal-daynum {
  background: var(--red); color: var(--paper); border-radius: 50%;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: .72rem;
}
.cal-chip {
  font-family: var(--font-ui); font-size: .68rem; line-height: 1.25; padding: 3px 6px;
  border-radius: 3px; color: var(--paper); cursor: pointer; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; border-left: 3px solid rgba(0,0,0,.35);
  display: flex; gap: 5px; align-items: center;
}
.cal-chip b { font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-chip:hover { filter: brightness(1.12); }
.cal-chip.is-event { background: var(--gold) !important; color: var(--ink); font-weight: 600; }
.cal-chip.is-annule { opacity: .55; text-decoration: line-through; }
.cal-chip .cal-chip-ico { font-size: .72rem; }
.cal-more {
  font-family: var(--font-ui); font-size: .64rem; color: var(--red); font-weight: 600;
  cursor: pointer; padding-left: 3px;
}
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.cal-legend-item { display: flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-size: .75rem; }
.cal-legend-dot { width: 13px; height: 13px; border-radius: 3px; border: 1px solid rgba(0,0,0,.3); }

/* Fiche RDV (détail / liste du jour) */
.rdv-item {
  border: 1.5px solid var(--line); border-left-width: 5px; border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 10px; background: rgba(255,250,240,.5);
}
.rdv-item h4 { font-family: var(--font-ui); font-size: .95rem; margin-bottom: 3px; }
.rdv-meta { font-family: var(--font-type); font-size: .76rem; color: var(--ink-soft); }
.rdv-parts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

@media (max-width: 760px) {
  .cal-cell { min-height: 84px; }
  .cal-chip { font-size: .6rem; }
  .cal-month { font-size: 1.3rem; min-width: 150px; }
}

/* reset semaine — encart d'alerte */
.danger-zone {
  border: 2px dashed var(--red); background: rgba(139,26,26,.06);
  border-radius: var(--radius); padding: 20px;
}
.danger-zone h3 { color: var(--red); }

/* ════════════ THÈME SOMBRE ════════════ */
body.theme-dark {
  --paper:      #211b15;
  --paper-2:    #2a231b;
  --paper-3:    #16110c;
  --ink:        #ece2cd;
  --ink-soft:   #a99d88;
  --line:       #4a3f30;
  --red:        #cb4a3c;
  --red-bright: #dd5c4b;
  --navy:       #5f80bd;
  --gold:       #cda74f;
  --gold-soft:  #e0c27c;
  background-color: #15110c;
  background-image:
    radial-gradient(circle at 20% 15%, rgba(184,137,58,.10), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(95,128,189,.08), transparent 45%);
}
.theme-dark input, .theme-dark select, .theme-dark textarea { background: rgba(255,255,255,.05); color: var(--ink); }
.theme-dark input::placeholder { color: #7d7361; }
.theme-dark .frame { background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.15)); }
.theme-dark .card { background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(0,0,0,.12)); }
.theme-dark .table-wrap { background: rgba(255,255,255,.03); }
.theme-dark tbody tr:nth-child(even) { background: rgba(255,255,255,.035); }
.theme-dark tbody tr:hover { background: rgba(184,137,58,.14); }
.theme-dark .topbar { background: linear-gradient(180deg, #14100b, #1d1610); }
.theme-dark thead th { background: #14100b; color: var(--ink); }
.theme-dark .nav__item.active { background: #14100b; color: var(--ink); }
.theme-dark .nav__item:hover { background: rgba(255,255,255,.05); }
.theme-dark .btn { box-shadow: 3px 3px 0 rgba(0,0,0,.55); }
.theme-dark .btn:hover { box-shadow: 5px 5px 0 rgba(0,0,0,.55); }
.theme-dark .btn--sm { box-shadow: 2px 2px 0 rgba(0,0,0,.55); }
.theme-dark .btn--ghost:hover { background: rgba(255,255,255,.06); }
.theme-dark .icon-btn { background: rgba(255,255,255,.05); }
.theme-dark .stat--accent { background: #14100b; }
.theme-dark .toast { background: #14100b; color: var(--ink); }
.theme-dark .cal-dow { background: #14100b; color: var(--ink); }
.theme-dark .cal-cell { background: rgba(255,255,255,.025); }
.theme-dark .cal-cell.is-other { background: rgba(0,0,0,.2); }
.theme-dark .cal-cell:hover { background: rgba(184,137,58,.12); }
.theme-dark .rdv-item { background: rgba(255,255,255,.035); }
.theme-dark .modal__head { background: linear-gradient(180deg, rgba(255,255,255,.04), transparent); }
.theme-dark .danger-zone { background: rgba(203,74,60,.1); }
.theme-dark .login-bg {
  background: radial-gradient(circle at 50% 30%, rgba(203,74,60,.14), transparent 55%),
              linear-gradient(160deg, #241d15, #15110c);
}
.theme-dark ::-webkit-scrollbar-track { background: #1d1710; }
.theme-dark ::-webkit-scrollbar-thumb { background: #4a3f30; border-color: #1d1710; }
/* Texte clair forcé là où le clair utilisait var(--paper) (sinon illisible en sombre) */
.theme-dark .topbar,
.theme-dark .topbar__name,
.theme-dark .topbar__week,
.theme-dark .topbar__username,
.theme-dark .badge-grade,
.theme-dark .topbar .btn--ghost,
.theme-dark .banner,
.theme-dark .btn--primary,
.theme-dark .btn--navy,
.theme-dark .btn--danger,
.theme-dark .pill--alert,
.theme-dark .cal-chip { color: #f3ead6; }
.theme-dark .btn--gold,
.theme-dark .cal-chip.is-event { color: #1a1410; }

/* ════════════ RESPONSIVE ════════════ */
@media (max-width: 860px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .topbar__burger { display: block; }
  .topbar__week { font-size: .7rem; padding: 4px 9px; }
  .topbar__user-info { display: none; }
  .theme-toggle { margin-left: auto; }
  .navbtn { width: 32px; height: 32px; font-size: 1rem; }
  .sidebar {
    position: fixed; left: 0; top: 64px; z-index: 25; transform: translateX(-105%);
    transition: transform .25s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .view { padding: 20px 16px; }
  .form-row, .form-2 { grid-template-columns: 1fr; }
}
