/* ============================================================
   ARCHIVES DE KONOHA — Feuille de Style
   Auteur : Kanakiro Toku
   ============================================================ */

/* ── VARIABLES GLOBALES ── */
:root {
  --ink:            #1a0f00;
  --ink-faded:      #3d2b1a;
  --parchment:      #f5e9c9;
  --parchment-edge: #c9a96e;
  --red-seal:       #8b1a1a;
  --gold:           #b8860b;
  --shadow:         rgba(26, 15, 0, 0.25);

  /* Couleurs de zone */
  --pub: #5a7a3a;
  --t1:  #4a6fa5;
  --t2:  #7a4fa5;
  --t3:  #b8860b;
  --t4:  #c0392b;
  --arc: #8b1a1a;

  /* Natures de chakra */
  --raiton: #4a6fa5;
  --katon:  #c0392b;
  --suiton: #2980b9;
  --tai:    #7d5a3c;
}

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

/* ── BODY ── */
body {
  background: #1a0f00;
  background-image:
    radial-gradient(ellipse at 15% 50%, #2c1505 0%, transparent 55%),
    radial-gradient(ellipse at 85% 20%, #0f0800 0%, transparent 50%);
  min-height: 100vh;
  font-family: 'IM Fell English', serif;
  color: var(--ink);
  overflow-x: hidden;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pulse-red {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1;   }
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   ÉCRAN DE VERROUILLAGE (EXAMEN)
   ============================================================ */
#exam-lock {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(10, 4, 0, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}
#exam-lock .lock-seal {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: pulse-red 2.5s ease-in-out infinite;
}
#exam-lock h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.4rem, 5vw, 2.8rem);
  color: #e8c4b8;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  text-align: center;
}
#exam-lock p {
  font-style: italic;
  color: #8b5a5a;
  font-size: 1rem;
  text-align: center;
  max-width: 440px;
  line-height: 1.8;
}
#exam-lock .lock-line {
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #8b1a1a, transparent);
  margin: 20px auto;
}

/* ============================================================
   BARRE DE ZONE
   ============================================================ */
#zone-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--pub);
  z-index: 1000;
  transition: background 0.5s;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header { text-align: center; padding: 32px 20px 16px; }

.site-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--parchment);
  text-shadow: 0 2px 12px rgba(0,0,0,.9), 0 0 40px rgba(184,134,11,.25);
  letter-spacing: 0.08em;
}
.site-subtitle {
  font-style: italic;
  color: var(--parchment-edge);
  font-size: 0.88rem;
  margin-top: 6px;
  opacity: 0.75;
}

/* Badge de zone actuelle */
#zone-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 5px 16px;
  border-radius: 20px;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  transition: all 0.4s;
}
#zone-label.zp { color: var(--pub); border-color: var(--pub); background: rgba(90,122,58,.12); }
#zone-label.z1 { color: var(--t1);  border-color: var(--t1);  background: rgba(74,111,165,.12); }
#zone-label.z2 { color: var(--t2);  border-color: var(--t2);  background: rgba(122,79,165,.12); }
#zone-label.z3 { color: var(--t3);  border-color: var(--t3);  background: rgba(184,134,11,.12); }
#zone-label.z4 { color: var(--t4);  border-color: var(--t4);  background: rgba(192,57,43,.12);  }
#zone-label.za { color: var(--arc); border-color: var(--arc); background: rgba(139,26,26,.12);  }

/* ============================================================
   NAVIGATION PRINCIPALE
   ============================================================ */
.top-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 20px 20px;
}
.zone-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid;
  background: transparent;
  transition: all 0.2s;
}
.zone-btn.bp { color: var(--pub); border-color: var(--pub); }
.zone-btn.bt { color: var(--t1);  border-color: var(--t1);  }
.zone-btn.ba { color: #444; border-color: #2a1a0a; font-size: 0.6rem; opacity: 0.3; letter-spacing: 0.2em; }
.zone-btn:hover { opacity: 0.75; }
.zone-btn.active          { color: #fff !important; }
.zone-btn.bp.active       { background: var(--pub); border-color: var(--pub); }
.zone-btn.bt.active       { background: var(--t1);  border-color: var(--t1);  }

/* ============================================================
   LAYOUT
   ============================================================ */
.app { max-width: 1040px; margin: 0 auto; padding: 0 16px 60px; }

/* ============================================================
   PARCHEMIN
   ============================================================ */
.parchment {
  background: var(--parchment);
  background-image: linear-gradient(180deg, #f7edce 0%, #f2e4b8 50%, #eedda8 100%);
  border-radius: 4px;
  box-shadow:
    0 0 0 1px var(--parchment-edge),
    0 0 0 3px var(--ink),
    0 0 0 5px rgba(184,134,11,.4),
    0 12px 50px rgba(0,0,0,.8),
    inset 0 0 80px rgba(180,140,60,.1);
  padding: 44px 52px 52px;
  position: relative;
  animation: pageIn 0.35s ease-out;
  min-height: 500px;
}
/* Bord déchiré */
.parchment::before {
  content: '';
  position: absolute;
  top: -5px; left: 0; right: 0; height: 10px;
  background: var(--parchment);
  clip-path: polygon(
    0% 100%,1% 30%,2% 80%,3% 20%,4% 70%,5% 10%,6% 60%,7% 25%,8% 75%,9% 15%,
    10% 65%,11% 30%,12% 85%,13% 20%,14% 70%,15% 40%,16% 90%,17% 25%,18% 75%,19% 35%,
    20% 80%,21% 15%,22% 65%,23% 30%,24% 85%,25% 20%,26% 70%,27% 40%,28% 90%,29% 25%,
    30% 75%,31% 35%,32% 80%,33% 15%,34% 65%,35% 30%,36% 85%,37% 20%,38% 70%,39% 40%,
    40% 90%,41% 25%,42% 75%,43% 35%,44% 80%,45% 15%,46% 65%,47% 30%,48% 85%,49% 20%,
    50% 70%,51% 40%,52% 90%,53% 25%,54% 75%,55% 35%,56% 80%,57% 15%,58% 65%,59% 30%,
    60% 85%,61% 20%,62% 70%,63% 40%,64% 90%,65% 25%,66% 75%,67% 35%,68% 80%,69% 15%,
    70% 65%,71% 30%,72% 85%,73% 20%,74% 70%,75% 40%,76% 90%,77% 25%,78% 75%,79% 35%,
    80% 80%,81% 15%,82% 65%,83% 30%,84% 85%,85% 20%,86% 70%,87% 40%,88% 90%,89% 25%,
    90% 75%,91% 35%,92% 80%,93% 15%,94% 65%,95% 30%,96% 85%,97% 20%,98% 60%,99% 35%,
    100% 70%, 100% 100%
  );
}

/* ── Onglets de navigation de page ── */
.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--parchment-edge);
}
.page-tab {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid var(--parchment-edge);
  background: rgba(255,255,255,.3);
  color: var(--ink-faded);
  transition: all 0.15s;
}
.page-tab:hover  { background: rgba(255,255,255,.6); }
.page-tab.active { background: var(--ink); color: var(--parchment); border-color: var(--ink); }

/* ============================================================
   CONTENU DES PAGES
   ============================================================ */
.page-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}
.page-title::after {
  content: '';
  display: block;
  width: 80px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 10px auto 0;
}
.page-author {
  text-align: center;
  font-style: italic;
  color: var(--red-seal);
  font-size: 0.85rem;
  margin-bottom: 26px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(139,26,26,.2);
}
.section-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-faded);
  margin: 26px 0 11px;
  padding: 7px 14px;
  background: linear-gradient(90deg, rgba(184,134,11,.12), transparent);
  border-left: 3px solid var(--gold);
  letter-spacing: 0.04em;
}
.page-content p          { line-height: 1.85; margin-bottom: 13px; font-size: .97rem; color: var(--ink-faded); text-align: justify; text-indent: 1.5em; }
.page-content ul,
.page-content ol         { margin: 0 0 13px 21px; color: var(--ink-faded); }
.page-content li         { line-height: 1.8; margin-bottom: 5px; font-size: .93rem; }

/* ── Note ── */
.note-box {
  background: rgba(139,26,26,.06);
  border: 1px solid rgba(139,26,26,.2);
  border-left: 4px solid var(--red-seal);
  padding: 11px 15px;
  margin: 13px 0;
  font-size: .88rem;
  font-style: italic;
  color: var(--ink-faded);
  border-radius: 0 3px 3px 0;
}
.note-box strong { font-family: 'Cinzel', serif; font-size: .78rem; color: var(--red-seal); display: block; margin-bottom: 4px; font-style: normal; }

/* ── Technique ── */
.technique-card {
  background: linear-gradient(135deg, rgba(255,255,255,.4), rgba(180,140,60,.07));
  border: 1px solid var(--parchment-edge);
  border-radius: 4px;
  padding: 18px 22px;
  margin: 16px 0;
  box-shadow: inset 0 0 20px rgba(180,140,60,.07), 2px 2px 8px var(--shadow);
  position: relative;
}
.technique-card::before {
  content: attr(data-rank);
  position: absolute;
  top: -9px; right: 18px;
  background: var(--red-seal);
  color: var(--parchment);
  font-family: 'Cinzel', serif;
  font-size: .6rem;
  letter-spacing: .1em;
  padding: 2px 9px;
  border-radius: 2px;
  text-transform: uppercase;
}
.technique-name { font-family: 'Cinzel', serif; font-size: 1.05rem; font-weight: 700; color: var(--ink); margin-bottom: 10px; }

/* ── Mudras ── */
.mudra-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 13px 0; }
.mudra-item { display: flex; gap: 9px; align-items: flex-start; padding: 7px 11px; background: rgba(255,255,255,.3); border-radius: 3px; border: 1px solid rgba(184,134,11,.2); }
.mudra-symbol         { font-size: 1.3rem; line-height: 1; flex-shrink: 0; }
.mudra-text strong    { font-family: 'Cinzel', serif; font-size: .78rem; color: var(--ink); display: block; }
.mudra-text span      { font-size: .8rem; color: var(--ink-faded); font-style: italic; line-height: 1.35; }

/* ── Badges nature ── */
.nature-badge { display: inline-block; font-family: 'Cinzel', serif; font-size: .68rem; letter-spacing: .1em; padding: 3px 11px; border-radius: 2px; text-transform: uppercase; margin-bottom: 13px; font-weight: 600; }
.badge-raiton { background: var(--raiton); color: #fff; }
.badge-katon  { background: var(--katon);  color: #fff; }
.badge-suiton { background: var(--suiton); color: #fff; }
.badge-tai    { background: var(--tai);    color: #fff; }

/* ── Règles ── */
.rules-list { counter-reset: r; list-style: none; margin: 0 0 13px; padding: 0; }
.rules-list li {
  counter-increment: r;
  display: flex; gap: 11px; align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(139,26,26,.15);
  line-height: 1.6; font-size: .93rem; color: var(--ink-faded);
}
.rules-list li::before {
  content: counter(r);
  background: var(--red-seal); color: var(--parchment);
  font-family: 'Cinzel', serif; font-size: .68rem; font-weight: 700;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}

/* ── Hiérarchie ── */
.hierarchy { display: flex; flex-direction: column; gap: 4px; margin: 13px 0; padding: 16px; background: rgba(255,255,255,.25); border: 1px solid var(--parchment-edge); border-radius: 4px; }
.rank-tier { display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-radius: 3px; }
.rank-tier.tt { background: linear-gradient(90deg, rgba(139,26,26,.12), transparent); }
.rank-tier.th { background: linear-gradient(90deg, rgba(184,134,11,.12), transparent); }
.rank-tier.tm { background: linear-gradient(90deg, rgba(74,111,165,.08), transparent); }
.rank-tier.tl { background: linear-gradient(90deg, rgba(125,90,60,.08),  transparent); }
.rank-dot     { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.tt .rank-dot { background: var(--red-seal); }
.th .rank-dot { background: var(--gold);     }
.tm .rank-dot { background: var(--raiton);   }
.tl .rank-dot { background: var(--tai);      }
.rank-label   { font-family: 'Cinzel', serif; font-size: .8rem; color: var(--ink); min-width: 150px; }
.rank-desc    { font-size: .8rem; color: var(--ink-faded); font-style: italic; }

/* ── Info cards ── */
.info-card        { border: 1px solid var(--parchment-edge); border-radius: 4px; margin: 16px 0; overflow: hidden; }
.info-card-header { background: var(--ink); color: var(--parchment); font-family: 'Cinzel', serif; font-size: .88rem; letter-spacing: .1em; padding: 9px 18px; text-transform: uppercase; }
.info-card-body   { padding: 13px 17px; background: rgba(255,255,255,.2); font-size: .92rem; line-height: 1.75; color: var(--ink-faded); }

/* ── Sceau ── */
.seal {
  position: absolute; bottom: 36px; right: 44px;
  width: 64px; height: 64px;
  border: 3px solid var(--red-seal); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--red-seal); opacity: .2; transform: rotate(-12deg);
  font-family: 'Cinzel', serif; font-size: .5rem; text-align: center; line-height: 1.4;
  pointer-events: none;
}
.seal::before { content: '巻'; font-size: 1.5rem; display: block; }

/* ── Grade badges ── */
.grade-badge { display: inline-flex; align-items: center; gap: 6px; font-family: 'Cinzel', serif; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; padding: 4px 12px; border-radius: 2px; margin-bottom: 18px; font-weight: 600; }
.gb1 { background: var(--t1);  color: #fff; }
.gb2 { background: var(--t2);  color: #fff; }
.gb3 { background: var(--t3);  color: var(--ink); }
.gb4 { background: var(--t4);  color: #fff; }
.gba { background: var(--arc); color: #fff; }

/* ── En-tête académique ── */
.teacher-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding: 10px 14px; background: rgba(255,255,255,.25); border: 1px solid var(--parchment-edge); border-radius: 4px; flex-wrap: wrap; gap: 8px; }
.teacher-info         { font-family: 'Cinzel', serif; font-size: .75rem; letter-spacing: .06em; color: var(--ink-faded); }
.teacher-info strong  { color: var(--ink); }
.logout-btn           { background: none; border: 1px solid var(--parchment-edge); border-radius: 3px; padding: 5px 12px; cursor: pointer; font-family: 'Cinzel', serif; font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faded); transition: all .15s; }
.logout-btn:hover     { background: var(--ink); color: var(--parchment); border-color: var(--ink); }
.exam-btn             { background: rgba(139,26,26,.1); border: 1px solid var(--red-seal); color: var(--red-seal); }
.exam-btn.active      { background: var(--red-seal); color: #fff; }
.exam-btn:hover       { background: var(--red-seal); color: #fff; border-color: var(--red-seal); }

/* ============================================================
   ZONE ARCHIVES
   ============================================================ */
.archive-parchment {
  background: #1a0808;
  background-image: linear-gradient(160deg, #200a0a, #120404);
  box-shadow: 0 0 0 1px #5a1010, 0 0 0 3px #0f0000, 0 0 0 5px rgba(139,26,26,.4), 0 12px 50px rgba(0,0,0,.9);
}
.archive-parchment::before                 { background: #1a0808; }
.archive-parchment .page-title             { color: #e8c4b8; }
.archive-parchment .page-author            { color: #8b3a3a; border-bottom-color: rgba(139,26,26,.3); }
.archive-parchment .section-title          { color: #c4a090; border-left-color: var(--red-seal); background: linear-gradient(90deg, rgba(139,26,26,.15), transparent); }
.archive-parchment .page-content p         { color: #c4a090; }
.archive-parchment .page-tab               { color: #7a4a4a; border-color: #4a1a1a; background: rgba(80,10,10,.3); }
.archive-parchment .page-tab.active        { background: #5a1010; color: #e8c4b8; border-color: #5a1010; }
.archive-parchment .page-nav               { border-bottom-color: #4a1010; }
.archive-parchment .page-title::after      { background: linear-gradient(90deg, transparent, #8b1a1a, transparent); }
.archive-classified                        { text-align: center; padding: 16px; color: #8b1a1a; font-family: 'Cinzel', serif; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 18px; border: 1px solid rgba(139,26,26,.25); border-radius: 3px; animation: pulse-red 3s ease-in-out infinite; }

/* ============================================================
   PAGE D'ACCUEIL PUBLIQUE
   ============================================================ */
.landing-hero   { text-align: center; padding: 24px 0 8px; }
.landing-kanji  { font-size: 3.5rem; opacity: .12; display: block; margin-bottom: 10px; letter-spacing: .3em; color: var(--parchment-edge); }
.landing-hero h2 { font-family: 'Cinzel', serif; font-size: 1.35rem; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.landing-hero p  { font-style: italic; color: var(--ink-faded); font-size: .9rem; max-width: 500px; margin: 0 auto; line-height: 1.8; }

.page-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 11px; margin: 24px 0; }
.page-card  { border: 1px solid var(--parchment-edge); border-radius: 4px; padding: 15px; background: rgba(255,255,255,.3); cursor: pointer; transition: all .2s; text-align: center; }
.page-card:hover       { background: rgba(255,255,255,.55); transform: translateY(-2px); box-shadow: 0 4px 12px var(--shadow); }
.page-card .card-icon  { font-size: 1.7rem; display: block; margin-bottom: 7px; }
.page-card .card-title { font-family: 'Cinzel', serif; font-size: .78rem; letter-spacing: .06em; color: var(--ink); display: block; margin-bottom: 5px; }
.page-card .card-desc  { font-size: .74rem; color: var(--ink-faded); font-style: italic; line-height: 1.4; }
.locked-card           { opacity: .32; cursor: default !important; }
.locked-card:hover     { transform: none !important; box-shadow: none !important; background: rgba(255,255,255,.3) !important; }

/* ============================================================
   MODALES
   ============================================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(8,3,0,.93); display: flex; align-items: center; justify-content: center; z-index: 9500; backdrop-filter: blur(5px); animation: fadeIn .2s ease; }
.modal         { background: var(--parchment); background-image: linear-gradient(160deg,#f7edce,#eedda8); border: 1px solid var(--parchment-edge); box-shadow: 0 0 0 3px var(--ink),0 0 0 5px var(--gold),0 20px 60px rgba(0,0,0,.8); border-radius: 6px; padding: 38px 42px; width: min(460px,92vw); text-align: center; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-title   { font-family: 'Cinzel', serif; font-size: 1.15rem; font-weight: 700; color: var(--ink); letter-spacing: .06em; margin-bottom: 5px; }
.modal-sub     { font-style: italic; font-size: .8rem; color: var(--ink-faded); margin-bottom: 22px; }
.modal label   { display: block; text-align: left; font-family: 'Cinzel', serif; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faded); margin-bottom: 4px; margin-top: 13px; }
.modal input, .modal select, .modal textarea { width: 100%; background: rgba(255,255,255,.5); border: 1px solid var(--parchment-edge); border-radius: 3px; padding: 8px 11px; font-family: 'IM Fell English',serif; font-size: .95rem; color: var(--ink); outline: none; transition: border-color .2s; }
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--gold); }
.modal-btn     { margin-top: 20px; width: 100%; background: var(--ink); color: var(--parchment); border: none; border-radius: 3px; font-family: 'Cinzel',serif; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; padding: 11px; cursor: pointer; transition: background .2s; }
.modal-btn:hover { background: var(--ink-faded); }
.modal-error   { margin-top: 10px; font-size: .8rem; color: var(--red-seal); font-style: italic; min-height: 17px; }
.modal-close   { position: absolute; top: 11px; right: 13px; background: none; border: none; cursor: pointer; font-size: 1.05rem; color: var(--ink-faded); opacity: .5; }
.modal-close:hover { opacity: 1; }

/* ============================================================
   PANEL D'ADMINISTRATION
   ============================================================ */
.admin-title { font-family: 'Cinzel',serif; font-size: 1.6rem; font-weight: 700; color: var(--ink); text-align: center; margin-bottom: 6px; }
.admin-title::after { content: ''; display: block; width: 80px; height: 3px; background: linear-gradient(90deg,transparent,var(--t4),transparent); margin: 10px auto 0; }
.admin-subtitle { text-align: center; font-style: italic; color: var(--red-seal); font-size: .83rem; margin-bottom: 28px; }

.admin-tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 2px solid var(--parchment-edge); flex-wrap: wrap; }
.admin-tab { font-family: 'Cinzel',serif; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; padding: 8px 16px; border-radius: 3px 3px 0 0; cursor: pointer; border: 1px solid var(--parchment-edge); border-bottom: none; background: rgba(255,255,255,.2); color: var(--ink-faded); transition: all .15s; margin-bottom: -2px; }
.admin-tab.active          { background: var(--ink); color: var(--parchment); border-color: var(--ink); }
.admin-tab:hover:not(.active) { background: rgba(255,255,255,.45); }
.admin-section { animation: pageIn .25s ease-out; }

.panel-card       { background: rgba(255,255,255,.28); border: 1px solid var(--parchment-edge); border-radius: 4px; padding: 20px 22px; margin-bottom: 14px; }
.panel-card-title { font-family: 'Cinzel',serif; font-size: .85rem; letter-spacing: .06em; color: var(--ink); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid rgba(184,134,11,.2); }

/* Formulaires */
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-group  { display: flex; flex-direction: column; gap: 4px; }
.form-group.full { grid-column: 1/-1; }
.form-label  { font-family: 'Cinzel',serif; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faded); }
.form-input, .form-select { background: rgba(255,255,255,.5); border: 1px solid var(--parchment-edge); border-radius: 3px; padding: 7px 10px; font-family: 'IM Fell English',serif; font-size: .92rem; color: var(--ink); outline: none; transition: border-color .2s; width: 100%; }
.form-input:focus, .form-select:focus { border-color: var(--gold); }

/* Boutons */
.btn         { font-family: 'Cinzel',serif; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; padding: 8px 18px; border-radius: 3px; cursor: pointer; border: 1px solid; transition: all .15s; }
.btn-primary { background: var(--ink); color: var(--parchment); border-color: var(--ink); }
.btn-primary:hover { background: var(--ink-faded); }
.btn-danger  { background: transparent; color: var(--red-seal); border-color: var(--red-seal); }
.btn-danger:hover  { background: var(--red-seal); color: #fff; }
.btn-warn    { background: transparent; color: #c0392b; border-color: #c0392b; }
.btn-warn:hover    { background: #c0392b; color: #fff; }
.btn-sm      { padding: 4px 10px; font-size: .62rem; }
.btn-row     { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; flex-wrap: wrap; }

/* Tableau comptes */
.accounts-table    { width: 100%; border-collapse: collapse; font-size: .85rem; }
.accounts-table th { font-family: 'Cinzel',serif; font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faded); padding: 8px 10px; text-align: left; border-bottom: 2px solid var(--parchment-edge); background: rgba(255,255,255,.2); }
.accounts-table td { padding: 9px 10px; border-bottom: 1px solid rgba(184,134,11,.15); color: var(--ink-faded); vertical-align: middle; }
.accounts-table tr:hover td { background: rgba(255,255,255,.2); }
.grade-pill { display: inline-block; font-family: 'Cinzel',serif; font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 2px; font-weight: 600; }
.p1 { background: var(--t1); color: #fff; } .p2 { background: var(--t2); color: #fff; }
.p3 { background: var(--t3); color: var(--ink); } .p4 { background: var(--t4); color: #fff; }

/* Accès aux pages */
.access-grid       { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 10px; }
.access-item       { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: rgba(255,255,255,.25); border: 1px solid var(--parchment-edge); border-radius: 3px; }
.access-item-info  { display: flex; align-items: center; gap: 9px; }
.access-item-icon  { font-size: 1.1rem; }
.access-item-label { font-family: 'Cinzel',serif; font-size: .75rem; letter-spacing: .04em; color: var(--ink); }
.access-select     { font-family: 'Cinzel',serif; font-size: .65rem; letter-spacing: .06em; padding: 4px 8px; border: 1px solid var(--parchment-edge); border-radius: 2px; background: rgba(255,255,255,.6); color: var(--ink); cursor: pointer; outline: none; }

/* MDP archive */
.archive-pass-display { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: rgba(139,26,26,.07); border: 1px solid rgba(139,26,26,.2); border-radius: 3px; margin-top: 10px; }
.archive-pass-val     { font-family: monospace; font-size: 1rem; color: var(--red-seal); letter-spacing: .15em; flex: 1; }

/* Examen */
.exam-status-card     { padding: 18px 22px; border-radius: 4px; border: 2px solid; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.exam-status-card.off { border-color: var(--pub); background: rgba(90,122,58,.08); }
.exam-status-card.on  { border-color: var(--red-seal); background: rgba(139,26,26,.1); animation: pulse-red 2s infinite; }
.exam-status-text     { font-family: 'Cinzel',serif; font-size: .9rem; letter-spacing: .05em; color: var(--ink); }
.exam-status-text small { display: block; font-style: italic; font-size: .78rem; color: var(--ink-faded); margin-top: 4px; }

/* Éditeur de pages */
.page-list            { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.page-list-item       { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: rgba(255,255,255,.28); border: 1px solid var(--parchment-edge); border-radius: 3px; gap: 10px; flex-wrap: wrap; }
.page-list-item-info  { display: flex; align-items: center; gap: 10px; }
.page-list-icon       { font-size: 1.3rem; }
.page-list-label      { font-family: 'Cinzel',serif; font-size: .8rem; letter-spacing: .04em; color: var(--ink); }
.page-list-meta       { font-size: .72rem; color: var(--ink-faded); font-style: italic; }
.page-list-actions    { display: flex; gap: 6px; }
.system-badge         { display: inline-block; font-family: 'Cinzel',serif; font-size: .55rem; letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border-radius: 2px; background: rgba(184,134,11,.15); color: var(--gold); border: 1px solid rgba(184,134,11,.3); margin-left: 6px; vertical-align: middle; }
.custom-badge         { background: rgba(74,111,165,.12); color: var(--t1); border-color: rgba(74,111,165,.3); }

/* Éditeur de blocs */
.block-editor         { margin-top: 16px; }
.blocks-container     { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.block-item           { background: rgba(255,255,255,.35); border: 1px solid var(--parchment-edge); border-radius: 3px; padding: 12px 14px; position: relative; }
.block-item:hover     { border-color: var(--gold); }
.block-item-header    { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.block-type-badge     { font-family: 'Cinzel',serif; font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border-radius: 2px; background: var(--ink); color: var(--parchment); }
.block-actions        { display: flex; gap: 4px; }
.block-actions button { background: none; border: 1px solid var(--parchment-edge); border-radius: 2px; padding: 2px 7px; cursor: pointer; font-size: .7rem; color: var(--ink-faded); transition: all .15s; }
.block-actions button:hover { background: var(--ink); color: var(--parchment); }
.block-preview        { font-size: .85rem; color: var(--ink-faded); line-height: 1.5; max-height: 60px; overflow: hidden; text-overflow: ellipsis; }
.block-preview img    { max-height: 50px; border-radius: 2px; }
.add-block-bar        { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding: 10px 0; border-top: 1px dashed var(--parchment-edge); }
.add-block-btn        { font-family: 'Cinzel',serif; font-size: .62rem; letter-spacing: .07em; text-transform: uppercase; padding: 5px 11px; border-radius: 2px; cursor: pointer; border: 1px solid var(--parchment-edge); background: rgba(255,255,255,.3); color: var(--ink-faded); transition: all .15s; }
.add-block-btn:hover  { background: var(--ink); color: var(--parchment); }

/* Éditeur RTE */
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 3px; padding: 6px 8px; background: rgba(255,255,255,.4); border: 1px solid var(--parchment-edge); border-bottom: none; border-radius: 3px 3px 0 0; }
.rte-btn     { background: rgba(255,255,255,.5); border: 1px solid var(--parchment-edge); border-radius: 2px; padding: 3px 8px; cursor: pointer; font-size: .78rem; color: var(--ink-faded); transition: all .12s; font-family: serif; }
.rte-btn:hover, .rte-btn.active { background: var(--ink); color: var(--parchment); border-color: var(--ink); }
.rte-sep     { width: 1px; background: var(--parchment-edge); margin: 2px 3px; }
.rte-area {
  min-height: 120px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px;
  background: rgba(255,255,255,.5);
  border: 1px solid var(--parchment-edge);
  border-radius: 0 0 3px 3px;
  font-family: 'IM Fell English',serif;
  font-size: .93rem;
  color: var(--ink);
  line-height: 1.7;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}
.rte-area:focus               { border-color: var(--gold); }
.rte-area b, .rte-area strong { color: var(--ink); }
.rte-area i, .rte-area em     { color: var(--ink-faded); }

/* Empêcher le débordement dans le contenu affiché */
.page-content {
  overflow-wrap: break-word;
  word-break: break-word;
  overflow-x: hidden;
}

/* ============================================================
   UTILITAIRES
   ============================================================ */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--parchment); font-family: 'Cinzel',serif; font-size: .72rem; letter-spacing: .08em; padding: 10px 22px; border-radius: 3px; box-shadow: 0 4px 20px rgba(0,0,0,.5); z-index: 999; opacity: 0; transition: opacity .3s; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; }
.scroll-up  { position: fixed; bottom: 22px; right: 22px; background: var(--ink); color: var(--gold); border: 1px solid var(--gold); border-radius: 50%; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; opacity: 0; transition: opacity .3s; z-index: 200; }
.scroll-up.visible { opacity: .8; }
.hidden { display: none !important; }
.cb     { animation: pageIn .3s ease-out; }

/* ============================================================
   RESPONSIVE MOBILE
   ============================================================ */
@media (max-width: 640px) {
  .parchment      { padding: 26px 18px 38px; }
  .form-grid      { grid-template-columns: 1fr; }
  .access-grid    { grid-template-columns: 1fr; }
  .teacher-header { flex-direction: column; }
  .modal          { padding: 28px 20px; }
}