/* ═══════════════════════════════════════
   ACADÉMIE NOVA — ADMIN CSS
═══════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --white:    #ffffff;
  --bg:       #f8f9fb;
  --bg2:      #f1f3f6;
  --border:   #e5e7eb;
  --border2:  #d1d5db;
  --text:     #111827;
  --text-2:   #374151;
  --text-3:   #6b7280;
  --text-4:   #9ca3af;
  --primary:  #1e40af;
  --primary-h:#1d3899;
  --primary-l:#eff6ff;
  --primary-m:#bfdbfe;
  --green:    #059669;
  --green-l:  #d1fae5;
  --red:      #dc2626;
  --red-l:    #fee2e2;
  --yellow:   #d97706;
  --yellow-l: #fef3c7;
  --blue:     #2563eb;
  --blue-l:   #dbeafe;
  --sidebar-w:240px;
  --topbar-h: 60px;
  --radius:   8px;
  --radius-sm:5px;
  --shadow:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:0 4px 16px rgba(0,0,0,.08);
  --ff:       'Inter', -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--ff); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── LAYOUT ── */
.a-layout { display: flex; min-height: 100vh; }
.a-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ── SIDEBAR ── */
.a-sidebar {
  width: var(--sidebar-w); position: fixed; top: 0; left: 0; bottom: 0;
  background: var(--white); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 100; overflow-y: auto;
}
.a-sidebar-head { padding: 1.2rem 1rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 9px; }
.a-logo-mark { width: 32px; height: 32px; background: var(--primary); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; color: var(--white); flex-shrink: 0; }
.a-logo-name { font-size: .82rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.a-logo-sub { font-size: .65rem; color: var(--text-4); }
.a-nav-section { padding: 1rem .75rem .3rem; font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-4); }
.a-nav { list-style: none; padding: 0 .5rem; margin-bottom: .3rem; }
.a-nav li { margin-bottom: 1px; }
.a-nav a { display: flex; align-items: center; gap: 9px; padding: .55rem .75rem; border-radius: var(--radius-sm); font-size: .82rem; font-weight: 500; color: var(--text-3); transition: background .12s, color .12s; }
.a-nav a svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .6; }
.a-nav a .nbadge { margin-left: auto; background: var(--red-l); color: var(--red); font-size: .65rem; font-weight: 700; padding: 1px 6px; border-radius: 10px; }
.a-nav a:hover { background: var(--bg); color: var(--text); }
.a-nav a:hover svg { opacity: 1; }
.a-nav a.active { background: var(--primary-l); color: var(--primary); font-weight: 600; }
.a-nav a.active svg { opacity: 1; }
.a-sidebar-foot { margin-top: auto; padding: .8rem .75rem 1rem; border-top: 1px solid var(--border); }
.a-user { display: flex; align-items: center; gap: 8px; padding: .5rem; border-radius: var(--radius-sm); margin-bottom: .3rem; }
.a-user-av { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-l); color: var(--primary); font-size: .68rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.a-user-name { font-size: .8rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.a-user-role { font-size: .68rem; color: var(--text-4); }
.a-logout { display: flex; align-items: center; gap: 7px; padding: .5rem .75rem; border-radius: var(--radius-sm); font-size: .8rem; color: var(--text-3); cursor: pointer; border: none; background: transparent; width: 100%; font-family: var(--ff); transition: background .12s, color .12s; }
.a-logout:hover { background: var(--red-l); color: var(--red); }

/* ── TOPBAR ── */
.a-topbar { height: var(--topbar-h); position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 1.8rem; flex-shrink: 0; }
.a-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .82rem; }
.a-breadcrumb .crumb { color: var(--text-3); }
.a-breadcrumb .crumb.active { color: var(--text); font-weight: 500; }
.a-breadcrumb .sep { color: var(--border2); }
.a-topbar-right { display: flex; align-items: center; gap: .6rem; }
.a-site-link { display: flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--primary); font-weight: 500; background: var(--primary-l); padding: .35rem .8rem; border-radius: var(--radius-sm); transition: background .12s; }
.a-site-link:hover { background: var(--primary-m); }

/* ── PAGE CONTENT ── */
.a-content { padding: 1.8rem; flex: 1; }
.a-page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.a-page-title { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.a-page-sub { font-size: .82rem; color: var(--text-3); margin-top: .2rem; }
.a-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ── STAT CARDS ── */
.a-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 1.5rem; }
.a-stat { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.4rem; display: flex; flex-direction: column; gap: .2rem; transition: box-shadow .15s; }
.a-stat:hover { box-shadow: var(--shadow-md); }
.a-stat-label { font-size: .72rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.a-stat-value { font-size: 1.9rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.a-stat-sub { font-size: .75rem; color: var(--text-4); }
.a-stat-icon { align-self: flex-end; font-size: 1.4rem; margin-top: -.2rem; opacity: .2; }

/* ── PANELS ── */
.a-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.2rem; }
.a-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.4rem; border-bottom: 1px solid var(--border); }
.a-panel-title { font-size: .9rem; font-weight: 700; color: var(--text); }
.a-panel-sub { font-size: .76rem; color: var(--text-3); margin-top: 1px; }
.a-panel-body { padding: 1.4rem; }
.a-panel-table { overflow-x: auto; }

/* ── TABLE ── */
.a-table { width: 100%; border-collapse: collapse; }
.a-table th { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-4); padding: .65rem 1rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg); }
.a-table td { padding: .75rem 1rem; font-size: .83rem; color: var(--text-2); border-bottom: 1px solid var(--border); vertical-align: middle; }
.a-table tr:last-child td { border-bottom: none; }
.a-table tr:hover td { background: var(--bg); }
.a-table td.bold { font-weight: 600; color: var(--text); }
.td-acts { display: flex; gap: .35rem; flex-wrap: wrap; }

/* ── BUTTONS ── */
.abtn { display: inline-flex; align-items: center; gap: 5px; font-family: var(--ff); font-size: .78rem; font-weight: 500; padding: .4rem .9rem; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; transition: all .13s; white-space: nowrap; }
.abtn-primary { background: var(--primary); color: var(--white); border-color: var(--primary); }
.abtn-primary:hover { background: var(--primary-h); }
.abtn-outline { background: var(--white); color: var(--primary); border-color: var(--primary-m); }
.abtn-outline:hover { background: var(--primary-l); }
.abtn-ghost { background: var(--bg); color: var(--text-2); border-color: var(--border); }
.abtn-ghost:hover { background: var(--bg2); color: var(--text); }
.abtn-danger { background: var(--red-l); color: var(--red); border-color: #fca5a5; }
.abtn-danger:hover { background: var(--red); color: var(--white); }
.abtn-success { background: var(--green-l); color: var(--green); border-color: #6ee7b7; }
.abtn-success:hover { background: var(--green); color: var(--white); }
.abtn-lg { padding: .55rem 1.2rem; font-size: .84rem; }
.abtn-full { width: 100%; justify-content: center; }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 600; padding: .2rem .65rem; border-radius: 20px; }
.badge-green  { background: var(--green-l); color: var(--green); }
.badge-red    { background: var(--red-l); color: var(--red); }
.badge-yellow { background: var(--yellow-l); color: var(--yellow); }
.badge-blue   { background: var(--blue-l); color: var(--blue); }
.badge-grey   { background: var(--bg2); color: var(--text-3); }
.badge-primary{ background: var(--primary-l); color: var(--primary); }

/* ── FORMS ── */
.aform-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: .9rem; }
.aform-group label { font-size: .78rem; font-weight: 600; color: var(--text-2); }
.aform-group input, .aform-group select, .aform-group textarea {
  font-family: var(--ff); font-size: .85rem; color: var(--text);
  background: var(--white); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: .55rem .75rem; outline: none;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none;
}
.aform-group input:focus, .aform-group select:focus, .aform-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,64,175,.1); }
.aform-group textarea { min-height: 90px; resize: vertical; }
.aform-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.aform-row.three { grid-template-columns: 1fr 1fr 1fr; }
.aform-check { display: flex; align-items: center; gap: 8px; margin-bottom: .9rem; }
.aform-check input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.aform-check label { font-size: .82rem; color: var(--text-2); cursor: pointer; }
.aform-sep { height: 1px; background: var(--border); margin: 1.2rem 0; }
.aform-section { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-4); margin-bottom: .8rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }

/* ── TOGGLE ── */
.a-toggle { position: relative; display: inline-block; width: 34px; height: 18px; }
.a-toggle input { opacity: 0; width: 0; height: 0; }
.a-toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border2); border-radius: 20px; transition: .2s; }
.a-toggle-slider:before { content: ''; position: absolute; width: 12px; height: 12px; left: 3px; bottom: 3px; background: var(--white); border-radius: 50%; transition: .2s; }
input:checked + .a-toggle-slider { background: var(--primary); }
input:checked + .a-toggle-slider:before { transform: translateX(16px); }
.a-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.1rem; background: var(--bg); border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: .7rem; }
.a-toggle-row .info strong { display: block; font-size: .84rem; font-weight: 600; color: var(--text); margin-bottom: 1px; }
.a-toggle-row .info span { font-size: .76rem; color: var(--text-3); }

/* ── ALERTS ── */
.aalert { display: flex; gap: 9px; align-items: flex-start; padding: .85rem 1.1rem; border-radius: var(--radius-sm); font-size: .82rem; margin-bottom: 1rem; }
.aalert-success { background: var(--green-l); color: var(--green); border: 1px solid #6ee7b7; }
.aalert-danger  { background: var(--red-l); color: var(--red); border: 1px solid #fca5a5; }
.aalert-info    { background: var(--primary-l); color: var(--primary); border: 1px solid var(--primary-m); }

/* ── FLASH TOASTS ── */
#a-flash { position: fixed; top: 72px; right: 1.2rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; }
.flash-toast { padding: .7rem 1.1rem; border-radius: var(--radius-sm); font-size: .82rem; font-weight: 500; min-width: 240px; box-shadow: var(--shadow-md); animation: toastIn .25s ease both; }
@keyframes toastIn { from{opacity:0;transform:translateX(16px)} to{opacity:1;transform:translateX(0)} }
.flash-toast.success { background: var(--green-l); color: var(--green); border: 1px solid #6ee7b7; }
.flash-toast.error   { background: var(--red-l); color: var(--red); border: 1px solid #fca5a5; }

/* ── MODAL ── */
.a-modal-ov { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 1rem; }
.a-modal-ov.open { display: flex; }
.a-modal { background: var(--white); border-radius: var(--radius); padding: 1.8rem; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-md); animation: modalIn .22s ease both; }
@keyframes modalIn { from{opacity:0;transform:scale(.97)} to{opacity:1;transform:scale(1)} }
.a-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.3rem; }
.a-modal-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.a-modal-close { background: var(--bg); border: none; border-radius: var(--radius-sm); width: 28px; height: 28px; cursor: pointer; font-size: 1.1rem; color: var(--text-3); display: flex; align-items: center; justify-content: center; transition: background .12s; }
.a-modal-close:hover { background: var(--bg2); }
.a-modal-foot { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }

/* ── EMPTY STATE ── */
.a-empty { text-align: center; padding: 3rem 1rem; }
.a-empty .icon { font-size: 2.2rem; opacity: .25; margin-bottom: .7rem; }
.a-empty h3 { font-size: .95rem; font-weight: 700; color: var(--text-2); margin-bottom: .3rem; }
.a-empty p { font-size: .8rem; color: var(--text-4); }

/* ── LOGIN ── */
.login-wrap { min-height: 100vh; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 380px; box-shadow: var(--shadow-md); }
.login-logo { text-align: center; margin-bottom: 1.8rem; }
.login-logo-mark { width: 48px; height: 48px; background: var(--primary); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; color: var(--white); margin: 0 auto .8rem; }
.login-title { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: .2rem; }
.login-sub { font-size: .8rem; color: var(--text-3); }
.login-hint { font-size: .72rem; color: var(--text-4); text-align: center; margin-top: 1rem; background: var(--bg); border-radius: var(--radius-sm); padding: .6rem; }

/* ── MISC ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.2rem; }
hr.adivider { border: none; border-top: 1px solid var(--border); margin: 1.2rem 0; }
.text-muted { color: var(--text-3); }
.text-bold { font-weight: 600; }
@media (max-width: 900px) {
  .a-sidebar { transform: translateX(-100%); }
  .a-main { margin-left: 0; }
  .a-stats { grid-template-columns: repeat(2,1fr); }
  .aform-row, .aform-row.three { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
