:root{
  --bg:#0f172a; --panel:#0b1224; --sidebar:#0b1224;
  --card:#111a31; --border:#1e293b; --text:#e6e7ea; --muted:#9aa3b2;
  --primary:#7c3aed; --primary-weak:rgba(124,58,237,.18); --hover:rgba(255,255,255,.06);
}
*{box-sizing:border-box} html,body{height:100%}
body{margin:0;font-family:Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, sans-serif;color:var(--text);background: radial-gradient(1200px 600px at 20% -10%, #1a2250 0%, transparent 50%), var(--bg);}
.layout{display:grid;grid-template-columns:264px 1fr;min-height:100dvh}
/* Layout quand il n'y a pas de sidebar (page login) */
.layout.layout-nosidebar{
  grid-template-columns: 1fr;
}
aside.sidebar{position:sticky;top:0;height:100dvh;background:var(--sidebar);border-right:1px solid var(--border);padding:18px 14px}
.brand{display:flex;align-items:center;gap:10px;margin:2px 0 16px 0}
.brand .logo-img {
  height: 70px;
  width: auto;
}
.brand .name{font-weight:800;letter-spacing:.2px}
.brand small{display:block;color:var(--muted);font-weight:500}
.nav{display:flex;flex-direction:column;gap:6px;margin-top:12px}
.nav a{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:12px;color:var(--text);text-decoration:none;border:1px solid transparent}
.nav a:hover{background:var(--hover);border-color:var(--border)}
.nav a.active{background:var(--primary-weak);border-color:transparent}
.nav .dot{width:8px;height:8px;border-radius:999px;background:var(--muted)}
.header{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.header h1{margin:0;font-size:20px;font-weight:800;letter-spacing:.2px}
main.content{padding:20px 20px 28px}
.card{background:var(--card);border:1px solid var(--border);border-radius:14px;padding:14px;margin-bottom:14px;box-shadow:0 6px 24px rgba(2,6,23,.24)}
table{width:100%;border-collapse:separate;border-spacing:0 8px}
th{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);text-align:left;padding:0 10px}
td{background:rgba(255,255,255,.02);border:1px solid var(--border);border-left:none;border-right:none;padding:10px}
tr td:first-child{border-left:1px solid var(--border);border-radius:10px 0 0 10px}
tr td:last-child{border-right:1px solid var(--border);border-radius:0 10px 10px 0}
.btn{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:10px;border:1px solid var(--border);background:rgba(255,255,255,.04);color:var(--text);cursor:pointer;font-weight:700}
.btn.primary{background:var(--primary);border-color:var(--primary);color:white}
.btn.danger{border-color:#ef4444;color:#fecaca;background:rgba(239,68,68,.12)}
.btn:hover{filter:brightness(1.06)}
input,select{padding:10px 12px;border:1px solid var(--border);border-radius:10px;width:100%;background:rgba(255,255,255,.04); color:var(--text)}
label{font-size:12px;color:var(--muted);display:block;margin-bottom:6px}
.grid{display:grid;gap:12px}.grid-2{grid-template-columns:1fr 1fr}.grid-3{grid-template-columns:1fr 1fr 1fr}
.footer{padding:22px 14px;color:var(--muted);text-align:center}
hr{border:0;border-top:1px solid var(--border);margin:10px 0}
:focus-visible{outline:2px solid #a78bfa; outline-offset:2px}
/* Quand sidebar masquée (page login) */
.content.no-sidebar {
    margin-left: 0 !important;
    padding: 0 !important;
}
.login-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
body.login-body {
    background: linear-gradient(135deg, #0f172a, #111827, #0f172a);
    min-height: 100vh;
}

/* Carte élève dans l’agenda */
.agenda-item {
    margin-bottom: 0.35rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(15,23,42,0.85);
    background: rgba(15,23,42,0.85);
    font-size: 0.8rem;
    line-height: 1.25;
}

/* Variante instrument (vert) */
.agenda-item-instr {
    border-color: rgba(34,197,94,0.65);
    box-shadow: 0 0 0 1px rgba(34,197,94,0.20);
}

/* Variante découverte (bleu) */
.agenda-item-dec {
    border-color: rgba(56,189,248,0.65);
    box-shadow: 0 0 0 1px rgba(56,189,248,0.20);
}

.agenda-item-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.1rem;
}

.agenda-type-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.agenda-type-dot-instr {
    background: #22c55e;   /* vert */
}

.agenda-type-dot-dec {
    background: #38bdf8;   /* bleu */
}

.agenda-item-eleve {
    font-weight: 600;
}

.agenda-item-meta {
    font-size: 0.75rem;
    opacity: 0.8;
}
/* ----- PAGE ACCUEIL ------ */

/* Conteneur principal de la home */
.accueil-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem 3rem;
}

/* HEADER : logo + titre à gauche, user à droite */
.home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.home-logo-title {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.home-logo {
    height: 64px;
    width: 64px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    padding: 6px;
}

.home-header h1 {
    margin: 0;
    font-size: 2.2rem;
}

.accueil-subtitle {
    margin: 0.4rem 0 0;
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Bloc utilisateur + bouton déconnexion */
.home-user {
    text-align: right;
    font-size: 0.9rem;
}

.home-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
    background: #dc2626;
    color: #fff;
    border: 1px solid #b91c1c;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.home-logout-btn:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.4);
}

/* GRILLE DES BOUTONS */
.accueil-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-bottom: 2rem;
}

/* CARTE BOUTON ACTIVE / DISABLED */
.accueil-tile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.3rem;
    border-radius: 0.9rem;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(15,23,42,0.8);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        background 0.12s ease,
        border-color 0.12s ease;
    color: #f9fafb;
}

.accueil-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.35);
    background: radial-gradient(circle at top left, #2f74ff 0, #0f172a 55%);
    border-color: rgba(129, 140, 248, 0.9);
}

.accueil-tile-disabled {
    cursor: not-allowed;
    opacity: 0.55;
    background: rgba(148,163,184,0.25);
    border-color: rgba(148,163,184,0.5);
    box-shadow: none;
}

.accueil-tile-disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ICÔNE RONDE DEVANT LE TEXTE */
.accueil-icon-circle {
    height: 40px;
    width: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 0, #93c5fd 0, #2563eb 40%, #1d4ed8 100%);
    opacity: 0.95;
    flex-shrink: 0;
}

.accueil-tile-disabled .accueil-icon-circle {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
}

.accueil-icon-circle i {
    font-size: 1.1rem;
    color: #f9fafb;
}

/* TEXTES DANS LES TUILES */
.accueil-label {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
}

.accueil-desc {
    font-size: 0.85rem;
    opacity: 0.8;
}

.accueil-access-info {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* BLOC INFO EN BAS DE PAGE */
.home-info {
    margin-top: 1.5rem;
    padding: 1rem 1.2rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(148,163,184,0.5);
    background: rgba(15,23,42,0.85);
    font-size: 0.9rem;
}

.home-info h2 {
    margin-top: 0;
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .accueil-page {
        padding: 1.5rem 1.2rem;
    }

    .home-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-user {
        text-align: left;
        margin-top: 0.5rem;
    }
}

.nav a.nav-disabled {
    opacity: 0.4;
    pointer-events: none;   /* clic désactivé */
    cursor: default;
}
/* ---- MENU LATÉRAL AVEC BOUTONS STYLE HOME ---- */

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 1rem;
}

.side-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.6rem;
    font-size: 0.95rem;
    text-decoration: none;
    color: #e2e8f0;
    background: rgba(30,41,59,0.8);
    border: 1px solid rgba(255,255,255,0.08);
    transition: 0.12s ease;
}

.side-btn i {
    width: 18px;
    opacity: 0.9;
}

.side-btn:hover {
    background: rgba(59,130,246,0.25);
    border-color: rgba(59,130,246,0.6);
    transform: translateX(3px);
}

/* État actif */
.side-btn.active {
    background: rgba(37,99,235,0.8);
    border-color: rgba(37,99,235,1);
}

/* Désactivé */
.side-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
    background: rgba(51,65,85,0.6);
}
/* ---- MENU LATÉRAL : style inspiré des tuiles de la home ---- */

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 1rem;
}

.side-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.8rem;
    text-decoration: none;
    font-size: 0.9rem;

    /* même base que .accueil-tile */
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(15,23,42,0.8);
    backdrop-filter: blur(10px);
    color: #e5e7eb;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        background 0.12s ease,
        border-color 0.12s ease;
}

.side-btn:hover {
    transform: translateX(3px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.35);
    background: radial-gradient(circle at top left, #2f74ff 0, #0f172a 55%);
    border-color: rgba(129, 140, 248, 0.9);
}

.side-btn.active {
    background: radial-gradient(circle at top left, #2f74ff 0, #0f172a 55%);
    border-color: rgba(129, 140, 248, 1);
}

/* pastille icône, même esprit que .accueil-icon-circle mais plus petite */
.side-icon-circle {
    height: 30px;
    width: 30px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(
        circle at 30% 0,
        #93c5fd 0,
        #2563eb 40%,
        #1d4ed8 100%
    );
    flex-shrink: 0;
}

.side-icon-circle i {
    font-size: 0.9rem;
    color: #f9fafb;
}

/* texte */
.side-label {
    flex: 1;
}

/* désactivé = gris, pas cliquable */
.side-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
    background: rgba(30,41,59,0.7);
    border-color: rgba(148,163,184,0.6);
}

/* ===== PARAMÈTRES / ACCÈS ===== */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.2rem;
}

.page-header h1 {
  margin: 0;
}

.page-subtitle {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.access-filters {
  margin-bottom: 1rem;
}

.access-filters-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.access-filters-form .field-group {
  display: flex;
  flex-direction: column;
  min-width: 180px;
}

.access-filters-form label {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-bottom: 0.2rem;
}

.field-group-button {
  margin-left: auto;
}

/* Carte tableau */

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.badge-soft {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.table-wrapper {
  overflow-x: auto;
}

.access-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.access-table th,
.access-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(148,163,184,0.18);
  vertical-align: top;
}

.access-table th {
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.75;
}

.user-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-avatar {
  height: 32px;
  width: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #93c5fd 0, #2563eb 40%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.user-name {
  font-weight: 600;
}

.user-comment {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Tags rôles / scope */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid transparent;
}

.tag-directeur {
  background: rgba(34,197,94,0.18);
  border-color: rgba(34,197,94,0.7);
  color: #bbf7d0;
}

.tag-finances {
  background: rgba(234,179,8,0.18);
  border-color: rgba(234,179,8,0.7);
  color: #fef3c7;
}

.tag-prof {
  background: rgba(59,130,246,0.18);
  border-color: rgba(59,130,246,0.7);
  color: #bfdbfe;
}

.tag-autre {
  background: rgba(148,163,184,0.18);
  border-color: rgba(148,163,184,0.7);
  color: #e5e7eb;
}

.tag-scope-own {
  background: rgba(59,130,246,0.15);
  border-color: rgba(59,130,246,0.7);
  color: #bfdbfe;
}

.tag-scope-all {
  background: rgba(16,185,129,0.15);
  border-color: rgba(16,185,129,0.7);
  color: #a7f3d0;
}

/* Lien fichier partagé */

.link-soft {
  font-size: 0.85rem;
  text-decoration: none;
  opacity: 0.9;
}

.link-soft i {
  margin-right: 0.25rem;
}

.link-soft:hover {
  text-decoration: underline;
}

/* Permissions */

.col-perms {
  min-width: 180px;
}

.perm-line {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.25rem;
}

.perm-line span:first-child {
  flex: 0 0 80px;
  font-size: 0.8rem;
  opacity: 0.85;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  font-size: 0.7rem;
  border: 1px solid transparent;
}

.pill-ok {
  background: rgba(74,222,128,0.15);
  border-color: rgba(74,222,128,0.7);
  color: #bbf7d0;
}

.pill-warn {
  background: rgba(248,113,113,0.15);
  border-color: rgba(248,113,113,0.7);
  color: #fecaca;
}

/* Actions */

.col-actions {
  text-align: right;
  white-space: nowrap;
}

.btn-ico {
  border: none;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.btn-ico:hover {
  background: rgba(148,163,184,0.2);
}

.btn-ico.danger {
  color: #fecaca;
}
.perm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.4rem;
}
.perm-table th,
.perm-table td {
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid rgba(148,163,184,0.3);
}
.perm-table th {
  text-align: left;
  opacity: 0.8;
}
.perm-table input[type="checkbox"] {
  transform: scale(1.1);
}
