/* ============================================================
   RMA Dashboard — thème premium "Obsidian & Or"
   ============================================================ */
@font-face {
  font-family: "Inter";
  src: url("/vendor/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("/vendor/PlayfairDisplay-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("/vendor/PlayfairDisplay-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg0: #000000;
  --bg1: #050505;
  --glass: rgba(255, 255, 255, 0.03);
  --glass-2: rgba(255, 255, 255, 0.065);
  --stroke: rgba(255, 255, 255, 0.32);
  --stroke-strong: rgba(255, 255, 255, 0.55);
  --text: #f5f6f8;
  --muted: #9ba1ab;
  --faint: #5c6672;

  --gold: #e8c268;
  --gold-soft: rgba(232, 194, 104, 0.14);
  --grad: linear-gradient(135deg, #ffffff 0%, #eceff3 100%);
  --accent: #d7dbe2;

  --st-ouvert: #4f8ff7;
  --st-en_attente: #f5a623;
  --st-valide: #a78bfa;
  --st-rembourse: #34d399;
  --st-refuse: #f87171;

  --r: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg0);
  color: var(--text);
  font: 400 14px/1.5 "Inter", -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv02", "cv03", "tnum" 0;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}
/* Petit effet d'ambiance en arrière-plan : deux halos blancs qui dérivent très
   lentement. Discret, pur CSS (aucun coût JS), fixe pendant le scroll. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(620px 420px at 12% 8%, rgba(255,255,255,0.05), transparent 60%),
    radial-gradient(560px 380px at 92% 82%, rgba(255,255,255,0.035), transparent 60%);
  animation: ambientDrift 26s ease-in-out infinite alternate;
}
@keyframes ambientDrift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(2%, 3%) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}
.shell { position: relative; z-index: 1; }
.boot { padding: 48px; color: var(--muted); font-size: 15px; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(255, 255, 255, 0.20); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Shell : sidebar + main ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 234px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  padding: 22px 14px; display: flex; flex-direction: column; gap: 4px;
  background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.008));
  border-right: 1px solid var(--stroke);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 20px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; background: var(--grad);
  display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #14181f;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.brand-name { font-weight: 700; font-size: 15.5px; letter-spacing: -0.2px; }
.brand-sub { font-size: 10.5px; color: var(--gold); letter-spacing: 1.6px; text-transform: uppercase; font-weight: 600; }

.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 10px 12px; border-radius: 11px; font-size: 13.5px; font-weight: 500;
  transition: all .15s ease; text-align: left;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .8; }
.nav-item:hover { color: var(--text); background: var(--glass-2); }
.nav-item.active {
  color: var(--text); background: var(--glass-2); border-color: var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.nav-item.active svg { color: var(--accent); opacity: 1; }
.nav-item .nbadge {
  margin-left: auto; background: var(--gold-soft); color: var(--gold);
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
}
.side-foot { margin-top: auto; padding: 12px 8px 0; font-size: 11px; color: var(--faint); }
.side-kbd { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
kbd {
  background: var(--glass-2); border: 1px solid var(--stroke); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; font-size: 10.5px; font-family: inherit; color: var(--muted);
}

.main { flex: 1; min-width: 0; padding: 22px 28px 70px; position: relative; }
.app-stars {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none; opacity: .5;
}

/* ---------- Topbar ---------- */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.topbar h1 { font-size: 21px; font-weight: 700; letter-spacing: -0.4px; margin: 0; }
.topbar .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.searchbox {
  margin-left: auto; display: flex; align-items: center; gap: 9px;
  background: var(--glass); border: 1px solid var(--stroke); color: var(--muted);
  padding: 9px 14px; border-radius: 11px; font-size: 13px; min-width: 220px;
  transition: border-color .15s;
}
.searchbox:hover { border-color: var(--stroke-strong); color: var(--text); }
.searchbox kbd { margin-left: auto; }

/* ---------- Buttons ---------- */
.btn {
  background: var(--grad); color: #14181f; border: 0; padding: 10px 18px;
  border-radius: 11px; font-weight: 650; font-size: 13px; letter-spacing: .1px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,.7);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.03); box-shadow: 0 7px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255,255,255,.7); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: var(--glass-2); color: var(--text); border: 1px solid var(--stroke); box-shadow: none;
}
.btn.ghost:hover { border-color: var(--stroke-strong); filter: none; }
.btn.gold { background: linear-gradient(135deg, #d9a941, #f0d489); color: #241a05; box-shadow: 0 4px 18px rgba(232,194,104,.25); }
.btn.danger { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border: 1px solid rgba(248,113,113,.3); box-shadow: none; }
.btn.sm { padding: 7px 12px; font-size: 12px; border-radius: 9px; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 13px; margin-bottom: 20px; }
.kpi {
  background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--r);
  padding: 17px 18px; position: relative; overflow: hidden;
  transition: border-color .2s;
}
.kpi:hover { border-color: var(--stroke-strong); }
.kpi::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
}
.kpi .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.kpi .v { font-size: 26px; font-weight: 750; margin-top: 6px; letter-spacing: -0.6px; font-variant-numeric: tabular-nums; }
.kpi .v.gold { color: var(--gold); }
.kpi .trend { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.kpi .spark { position: absolute; right: 12px; bottom: 10px; opacity: .8; }

/* ---------- Glassmorphism (toutes les box) ---------- */
.panel, .kpi, .table-wrap, .kcol, .scard, .searchbox, .sidebar {
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

/* ---------- Panels & sections ---------- */
.panel {
  background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--r);
  padding: 18px 20px;
}
.panel h3 { margin: 0 0 14px; font-size: 13.5px; font-weight: 650; letter-spacing: -.1px; }
.panel h3 .hint { color: var(--faint); font-weight: 400; font-size: 11.5px; margin-left: 8px; }
.two-col { display: grid; grid-template-columns: 1.1fr .9fr; gap: 13px; margin-bottom: 13px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 13px; margin-bottom: 13px; }
@media (max-width: 1100px) { .two-col, .three-col { grid-template-columns: 1fr; } }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 15px; }
.filters input, .filters select, .field input, .field select, .field textarea {
  background: var(--glass); border: 1px solid var(--stroke); color: var(--text);
  padding: 9px 12px; border-radius: 10px; font-size: 13px; outline: none;
  font-family: inherit; transition: border-color .15s, background .15s;
}
.filters input:focus, .filters select:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); background: rgba(255,255,255,.06);
}
.filters select option, .field select option { background: #12151d; }
.filters .grow { flex: 1; min-width: 190px; }
.seg { display: inline-flex; border: 1px solid var(--stroke); border-radius: 10px; overflow: hidden; background: var(--glass); }
.seg button { background: transparent; color: var(--muted); border: 0; padding: 8px 14px; font-size: 12.5px; font-weight: 600; transition: all .15s; }
.seg button.active { background: var(--grad); color: #14181f; }

.chip {
  background: var(--glass); border: 1px solid var(--stroke); color: var(--muted);
  padding: 6px 13px; border-radius: 20px; font-size: 12px; font-weight: 550; transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--stroke-strong); }
.chip.active { background: var(--gold-soft); border-color: rgba(232,194,104,.4); color: var(--gold); }

/* ---------- Logos ---------- */
.site-logo {
  border-radius: 8px; object-fit: contain; background: #fff; padding: 3px;
  border: 1px solid var(--stroke); flex-shrink: 0;
}
.mono-logo {
  display: inline-grid; place-items: center; border-radius: 8px; color: #fff;
  background: linear-gradient(135deg, #434b63, #232837); font-weight: 700;
  border: 1px solid var(--stroke); flex-shrink: 0; letter-spacing: .5px;
}

/* ---------- Table ---------- */
.table-wrap { background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--r); overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
.data th, .data td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--stroke); white-space: nowrap; }
.data th {
  color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px;
  font-weight: 650; position: sticky; top: 0; background: #10131b; cursor: pointer; user-select: none;
}
.data th:hover { color: var(--text); }
.data th .arrow { color: var(--gold); margin-left: 4px; }
.data tbody tr { transition: background .12s; }
.data tbody tr:hover { background: var(--glass-2); cursor: pointer; }
.data tbody tr:last-child td { border-bottom: 0; }
td.amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
td .cell-site { display: flex; align-items: center; gap: 9px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.empty { padding: 48px; text-align: center; color: var(--muted); }
.empty .big { font-size: 32px; margin-bottom: 10px; }

/* ---------- Status badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .2px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ouvert { background: rgba(79,143,247,.13); color: var(--st-ouvert); }
.badge.en_attente { background: rgba(245,166,35,.13); color: var(--st-en_attente); }
.badge.valide { background: rgba(167,139,250,.13); color: var(--st-valide); }
.badge.rembourse { background: rgba(52,211,153,.13); color: var(--st-rembourse); }
.badge.refuse { background: rgba(248,113,113,.13); color: var(--st-refuse); }
.overdue { color: #fb8f8f; font-weight: 650; }
.duesoon { color: var(--st-en_attente); font-weight: 600; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.kcol { background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--r); padding: 10px; }
.kcol h3 { font-size: 11.5px; margin: 4px 8px 12px; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 650; }
.kcol h3 .count { margin-left: auto; color: var(--faint); }
.kcard {
  background: var(--glass-2); border: 1px solid var(--stroke); border-radius: 11px;
  padding: 11px 12px; margin-bottom: 9px; transition: all .14s ease; position: relative;
}
.kcard:hover { border-color: var(--stroke-strong); transform: translateY(-1px); cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.kcard .khead { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.kcard .ref { font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.kcard .cli { font-weight: 650; font-size: 13px; }
.kcard .prod { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard .amt { font-size: 12.5px; margin-top: 7px; font-weight: 650; color: var(--gold); font-variant-numeric: tabular-nums; }

/* ---------- Cards grid (sites) ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 13px; }
.scard {
  background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--r);
  padding: 16px; transition: all .16s ease; position: relative;
}
.scard:hover { border-color: var(--stroke-strong); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.scard .shead { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.scard h3 { margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: -.1px; }
.scard .meta { color: var(--muted); font-size: 11.5px; margin: 1px 0; }
.scard .open-pill {
  position: absolute; top: 14px; right: 14px; background: var(--gold-soft); color: var(--gold);
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
}
.scard .foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.pill {
  display: inline-block; background: var(--glass-2); border: 1px solid var(--stroke);
  border-radius: 7px; padding: 2px 8px; font-size: 10.5px; color: var(--muted); margin: 2px 3px 0 0;
}

/* ---------- Charts ---------- */
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.dleg { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.dleg .sw { width: 10px; height: 10px; border-radius: 3px; }
.dleg .n { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.hbar { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.hbar .lbl { width: 130px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .track { flex: 1; height: 9px; background: var(--glass-2); border-radius: 6px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--grad); border-radius: 6px; transition: width .5s ease; }
.hbar .val { width: 30px; text-align: right; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- Alerts ---------- */
.alert-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border: 1px solid var(--stroke); border-radius: 11px; margin-bottom: 8px;
  background: var(--glass-2); transition: border-color .14s; cursor: pointer;
}
.alert-item:hover { border-color: var(--stroke-strong); }
.alert-item .adot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.alert-item .atxt { flex: 1; min-width: 0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-item .awhen { font-size: 11.5px; font-weight: 650; flex-shrink: 0; }

/* ---------- Drawer / modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(4, 5, 9, 0.66);
  display: flex; justify-content: flex-end; z-index: 50; backdrop-filter: blur(4px);
  animation: fadein .18s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  width: min(700px, 100%); height: 100%; background: var(--bg1);
  border-left: 1px solid var(--stroke); overflow-y: auto; padding: 26px 28px;
  animation: slidein .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer.center {
  margin: auto; height: auto; max-height: 90vh; border: 1px solid var(--stroke);
  border-radius: 18px; width: min(780px, 96%); box-shadow: var(--shadow);
  animation: popin .2s cubic-bezier(.2,.8,.3,1);
}
@keyframes popin { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.3px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.drawer .close { position: sticky; top: 0; float: right; z-index: 2; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 5px; font-weight: 650; }
.field input, .field select, .field textarea { width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.section-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--gold);
  margin: 22px 0 12px; border-top: 1px solid var(--stroke); padding-top: 16px; font-weight: 700;
}
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { border-left: 2px solid var(--stroke); padding: 4px 0 12px 14px; position: relative; }
.hist li::before {
  content: ""; position: absolute; left: -5px; top: 8px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(255,255,255,.15);
}
.hist li .when { font-size: 11px; color: var(--faint); }
.hist li .what { font-size: 13px; margin-top: 1px; }
.err { color: #fb9d9d; font-size: 12.5px; margin-top: 8px; }
.ok-msg { color: #6ee7a8; font-size: 12.5px; margin-top: 8px; }
.req::after { content: " *"; color: var(--gold); }
.toolbar { display: flex; gap: 9px; align-items: center; margin: 15px 0; flex-wrap: wrap; }
.note-input { display: flex; gap: 9px; margin: 10px 0 14px; }
.note-input input { flex: 1; }

/* ---------- Bulk ---------- */
.bulk-table { width: 100%; border-collapse: collapse; }
.bulk-table th { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; padding: 8px 5px; text-align: left; }
.bulk-table td { padding: 3px; }
.bulk-table input, .bulk-table select {
  width: 100%; min-width: 86px; background: var(--glass); border: 1px solid var(--stroke);
  color: var(--text); padding: 8px; border-radius: 8px; font-size: 12.5px; font-family: inherit;
}
.bulk-table input:focus, .bulk-table select:focus { border-color: var(--accent); outline: none; }
.dropzone {
  border: 1.5px dashed var(--stroke-strong); border-radius: var(--r); padding: 26px;
  text-align: center; color: var(--muted); background: var(--glass); transition: all .2s;
}
.dropzone:hover { border-color: var(--accent); background: rgba(255,255,255,.04); }
.linkish { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: 0; font-size: 13px; }

/* ---------- Command palette ---------- */
.palette-overlay {
  position: fixed; inset: 0; background: rgba(4,5,9,.6); z-index: 90;
  display: flex; justify-content: center; padding-top: 12vh; backdrop-filter: blur(5px);
  animation: fadein .15s ease;
}
.palette {
  width: min(620px, 94%); height: fit-content; max-height: 60vh; overflow: hidden;
  background: var(--bg1); border: 1px solid var(--stroke-strong); border-radius: 16px;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  animation: popin .17s cubic-bezier(.2,.8,.3,1);
}
.palette input {
  background: transparent; border: 0; border-bottom: 1px solid var(--stroke);
  color: var(--text); padding: 17px 20px; font-size: 15px; outline: none; font-family: inherit;
}
.palette .results { overflow-y: auto; padding: 8px; }
.pal-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 13px;
  border-radius: 10px; cursor: pointer; font-size: 13.5px;
}
.pal-item.sel { background: var(--glass-2); }
.pal-item .tag { margin-left: auto; font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .6px; }
.pal-empty { padding: 26px; text-align: center; color: var(--faint); font-size: 13px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 100; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: var(--bg1); border: 1px solid var(--stroke-strong); border-radius: 12px;
  padding: 12px 17px; font-size: 13px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px; min-width: 240px;
  animation: toastin .25s cubic-bezier(.2,.8,.3,1);
}
@keyframes toastin { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast .tdot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-rembourse); }
.toast.error .tdot { background: var(--st-refuse); }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  position: relative; overflow: hidden;
  /* Voile sombre dégradé par-dessus l'image d'espace → carte lisible */
  background:
    linear-gradient(rgba(7, 9, 13, 0.60), rgba(7, 9, 13, 0.86)),
    url("/login-bg.jpg") center / cover no-repeat fixed;
}
.login-stars {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.serif { font-family: "Playfair Display", Georgia, "Times New Roman", serif; }

.login-card {
  position: relative; z-index: 1;
  width: min(410px, 100%);
  background:
    linear-gradient(180deg, rgba(28, 33, 45, 0.72), rgba(12, 15, 22, 0.80));
  border: 1px solid rgba(255, 255, 255, 0.55);   /* contour blanc léger */
  border-radius: 20px; padding: 40px 38px 34px;
  backdrop-filter: blur(20px) saturate(120%);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);      /* liseré clair en haut */
  animation: popin .3s cubic-bezier(.2,.8,.3,1);
}
/* fin trait lumineux qui court sur le bord haut */
.login-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
}
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand.login-brand-logo { justify-content: center; margin-bottom: 4px; }
.brand-logo-img { display: block; max-width: 100%; height: auto; object-fit: contain; }
.login-brand .brand-logo-img { width: 230px; filter: drop-shadow(0 8px 22px rgba(0,0,0,.5)); }
.brand.brand-logo { padding: 2px 8px 20px; display: flex; justify-content: flex-start; }
.sidebar-logo-img { width: 150px; }
.login-title {
  font-size: 26px; font-weight: 600; letter-spacing: .3px; margin: 22px 0 4px; color: #fff;
}
.login-sub { color: var(--muted); font-size: 12.5px; margin: 0 0 24px; }
.login-rule { height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent); margin: 0 0 22px; }

.login-card .field { margin-bottom: 16px; }
.login-card .field label {
  font-size: 10px; letter-spacing: 1.6px; color: var(--accent); text-transform: uppercase; font-weight: 600;
}
.login-card .field input {
  width: 100%; padding: 13px 15px; border-radius: 12px; font-size: 13.5px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.login-card .field input:focus {
  border-color: rgba(255, 255, 255, .55);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, 0.06);
}
.btn-lux {
  width: 100%; padding: 13px; margin-top: 4px; border: 1px solid rgba(255,255,255,.4); border-radius: 12px; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: #f5f6f8; background: transparent;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn-lux:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.06); border-color: rgba(255,255,255,.6); }
.btn-lux:active { transform: translateY(0); }
.btn-lux:disabled { opacity: .6; cursor: default; transform: none; }

/* ---------- Sidebar user ---------- */
.side-user { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--stroke); }
.su-avatar { width: 32px; height: 32px; border-radius: 9px; background: var(--grad); color: #14181f; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.su-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-admin { color: var(--gold); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { padding: 16px; }
  .kanban { grid-template-columns: repeat(5, 240px); }
}
