/* ============================
   VMA UI — Modern Premium (2026)
   - fond stable au scroll (no banding)
   - cards glass subtil
   - sidebar premium
   - tokens propres (sans doublons)
============================ */

/* ---- Tokens ---- */
:root{


  /* Brand */
  --vma-primary:#300780;
  --vma-accent:#FC6413;

  /* Base */
  --bg-0:#ffffff;
  --bg-1:#f6f7fb;
  --bg-2:#eef0f8;

  --panel:#ffffff;
  --panel-glass: rgba(255,255,255,.78);
  --panel-glass-2: rgba(255,255,255,.86);

--panel-soft: rgba(255,255,255,.86);
--field: rgba(255,255,255,.92);
--panel-hover: rgba(255,255,255,1);
--shadow: var(--shadow-2);

  --text:#0f172a;             /* slate-900 */
  --muted:#64748b;            /* slate-500 */
  --line: rgba(15,23,42,.10);

  /* Radius */
  --radius:18px;
  --radius-sm:14px;

  /* Shadows */
  --shadow-1: 0 10px 30px rgba(15,23,42,.07);
  --shadow-2: 0 18px 48px rgba(15,23,42,.10);
  --shadow-inset: inset 0 0 0 1px rgba(255,255,255,.55);

  /* Rings */
  --ring-primary: 0 0 0 4px rgba(48,7,128,.12);
  --ring-accent:  0 0 0 4px rgba(252,100,19,.16);

  /* Interactions */
  --hover: rgba(15,23,42,.04);
  --active: rgba(48,7,128,.10);

  /* Typography */
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{ box-sizing:border-box; }
html, body{ min-height:100%; margin:0; }
a{ color:inherit; text-decoration:none; }
::selection{ background: rgba(48,7,128,.18); }

/* ---- Background FIX (no weird gradient on scroll) ---- */
/* On met le fond sur un pseudo-élément FIXE : stable, premium, propre */
body{
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-1);
}
body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 700px at 12% 0%, rgba(48,7,128,.13), transparent 62%),
    radial-gradient(900px 600px at 88% 10%, rgba(252,100,19,.10), transparent 55%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 42%, var(--bg-2) 100%);
}

/* Container */
.container{ max-width:1200px; margin:0 auto; padding:18px; }

/* ---- App grid ---- */
.app{
  display:grid;
  grid-template-columns: 300px 1fr;
  min-height:100vh;
}

/* ---- Sidebar (glass) ---- */
.sidebar{
  padding:18px;
  position:sticky;
  top:0;
  height:100vh;

  background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.60));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Brand card */
.brand{
  display:flex;
  align-items:center;
  gap:14px;
  padding:12px 12px;
  border:1px solid rgba(15,23,42,.10);
  border-radius: var(--radius);
  background: var(--panel-glass);
  box-shadow: var(--shadow-1);
}

.brand-logo{
  width:54px;
  height:54px;
  padding:9px;
  background:#fff;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:
    0 14px 22px rgba(15,23,42,.12),
    inset 0 0 0 1px rgba(15,23,42,.06);
}
.brand-logo img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}
.brand-text .t1{
  font-weight:900;
  letter-spacing:.2px;
  line-height:1.1;
}
.brand-text .t2{
  font-size:12px;
  color:var(--muted);
  margin-top:3px;
}

/* ---- Navigation ---- */
.nav{
  margin-top:16px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.nav a,
.nav-group__sum{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid transparent;
  user-select:none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .06s ease;
}

.nav a:hover,
.nav-group__sum:hover{
  background: rgba(255,255,255,.55);
  border-color: rgba(15,23,42,.10);
  box-shadow: 0 10px 18px rgba(15,23,42,.05);
}

.nav a:active,
.nav-group__sum:active{
  transform: translateY(1px);
}

.nav a.active{
  background: linear-gradient(180deg, rgba(48,7,128,.14), rgba(48,7,128,.08));
  border-color: rgba(48,7,128,.22);
  box-shadow: inset 0 0 0 1px rgba(48,7,128,.12);
}

.nav .ico{
  width:18px;
  height:18px;
  color: var(--vma-primary);
  opacity:.92;
}

/* ---- Main ---- */
.main{ padding:18px; }

/* Topbar */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;

  padding:14px 16px;
  border:1px solid rgba(15,23,42,.10);
  border-radius: var(--radius);
  background: var(--panel-glass-2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-1);
}

.title{
  font-weight:900;
  letter-spacing:.2px;
  font-size:16px;
}

.badge{
  font-size:12px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid rgba(48,7,128,.18);
  background: rgba(48,7,128,.06);
  color: var(--vma-primary);
}

/* ---- Cards / Sections ---- */
.card, .section{
  margin-top:16px;
  border:1px solid rgba(15,23,42,.10);
  border-radius: var(--radius);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-2);
  overflow:hidden;
}

.card .hd, .section-hd{
  padding:14px 16px;
  border-bottom:1px solid rgba(15,23,42,.08);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.72));
}

.card .bd, .section-bd{ padding:16px; }

.section-title{
  font-weight:900;
  display:flex;
  align-items:center;
  gap:10px;
}

/* ---- Page layout helpers ---- */
.page{
  display:flex;
  flex-direction:column;
  gap:14px;
  padding-top:14px;
}

.toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.h1{
  font-size:20px;
  font-weight:950;
  letter-spacing:.2px;
  margin:0;
}
.sub{
  margin:4px 0 0;
  color:var(--muted);
  font-size:13px;
}

/* ---- Grid ---- */
.grid-2{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
@media (min-width: 980px){
  .grid-2{ grid-template-columns: 1.15fr .85fr; }
}

/* ---- Forms ---- */
.form{ display:flex; flex-direction:column; gap:12px; }

.fields-2{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
@media (min-width: 680px){
  .fields-2{ grid-template-columns:1fr 1fr; }
}

.label{
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
}

/* Inputs plus “premium” */
.input, select.input, textarea.input{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.92);
  color: var(--text);
  outline:none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .06s ease, background .15s ease;
}

.input:hover{
  background:#fff;
  border-color: rgba(15,23,42,.16);
}

.input:focus{
  border-color: rgba(48,7,128,.35);
  box-shadow: var(--ring-primary);
}

.help{
  font-size:12px;
  color:var(--muted);
  margin-top:6px;
}

/* Pills */
.kbdpill{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.78);
  color: rgba(15,23,42,.82);
}

/* ---- Lists / items ---- */
.list{ display:flex; flex-direction:column; gap:10px; }

.item{
  border:1px solid rgba(15,23,42,.10);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.86);
  padding:12px 12px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  box-shadow: 0 10px 20px rgba(15,23,42,.05);
}

.item-title{ font-weight:900; }
.item-sub{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
}

/* ---- Buttons ---- */
.btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  border-radius: 14px;
  padding:10px 12px;
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.88);
  color: var(--text);
  cursor:pointer;
  transition: transform .06s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease, filter .15s ease;
}

.btn:hover{
  background:#fff;
  border-color: rgba(15,23,42,.16);
  box-shadow: 0 12px 20px rgba(15,23,42,.06);
}
.btn:active{ transform: translateY(1px); }

.btn:focus-visible{
  outline:none;
  box-shadow: var(--ring-primary);
  border-color: rgba(48,7,128,.35);
}

.btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  box-shadow:none;
}

.btn .ico{ width:18px; height:18px; }



/* ✅ Fix: les <a class="btn"> doivent garder la couleur du bouton */
a.btn,
a.btn:visited{
  color: var(--text) !important;
  text-decoration: none;
}

a.btn:hover{
  color: var(--text) !important;
}

/* ✅ Variantes */
a.btn.primary,
a.btn.primary:visited,
a.btn.primary:hover{
  color:#fff !important;
}

a.btn.danger,
a.btn.danger:visited,
a.btn.danger:hover{
  color:#b91c1c !important;
}


/* Primary (accent) */
.btn.primary{
  background: linear-gradient(180deg, rgba(252,100,19,1), rgba(252,100,19,.90));
  border-color: rgba(252,100,19,.35);
  color:#fff;
  font-weight:900;
  box-shadow: 0 14px 26px rgba(252,100,19,.18);
}
.btn.primary:hover{
  filter: brightness(1.03);
  box-shadow: 0 16px 30px rgba(252,100,19,.22);
}
.btn.primary:focus-visible{
  box-shadow: var(--ring-accent);
  border-color: rgba(252,100,19,.45);
}

/* Ghost */
.btn.ghost{
  background: transparent;
  border-color: rgba(15,23,42,.12);
}
.btn.ghost:hover{ background: rgba(255,255,255,.45); }

/* ---- Responsive ---- */
@media (max-width: 980px){
  .app{ grid-template-columns: 1fr; }
  .sidebar{
    position:relative;
    height:auto;
    border-right:0;
    border-bottom:1px solid var(--line);
  }
}

/* ===== SAFETY overlays ===== */
.modal-backdrop,
.overlay,
.backdrop,
.scrim,
.dim,
[data-overlay],
#overlay{
  display:none;
}
.modal-backdrop.open,
.overlay.open,
.backdrop.open,
.scrim.open,
.dim.open,
[data-overlay].open,
#overlay.open{
  display:block;
}

/* Dialog */
dialog{
  border:0;
  border-radius: var(--radius);
  padding:0;
  box-shadow: 0 20px 70px rgba(15,23,42,.22);
  background: rgba(255,255,255,.92);
}
dialog::backdrop{
  background: rgba(15,23,42,.38);
}
dialog:not([open])::backdrop{
  background: transparent;
}