/* ═══════════════════════════════════════════════
   LTD — Comptabilité  ·  Thème Bleu / Blanc / Rouge
   ═══════════════════════════════════════════════ */
:root {
  --bg: #060b1a;
  --bg-2: #0a1228;
  --panel: #0e1833;
  --panel-2: #132044;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #eef3ff;
  --muted: #8d9bc0;
  --blue: #1f5fe0;
  --blue-2: #2f7bff;
  --blue-glow: rgba(47, 123, 255, .35);
  --red: #e3101c;
  --red-2: #ff3742;
  --white: #ffffff;
  --green: #19c37d;
  --green-bg: rgba(25, 195, 125, .12);
  --neg: #ff4d57;
  --neg-bg: rgba(255, 77, 87, .12);
  --amber: #f5a524;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .7);
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: 'Rajdhani', 'Inter', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sidebar: 268px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: clip; }
/* Aucune barre de défilement visible (le défilement reste actif) */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
body {
  font-family: var(--font);
  font-size: 14.5px;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(47, 123, 255, .16), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(227, 16, 28, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--blue-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: .02em; margin: 0; font-weight: 700; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--green) !important; }
.neg { color: var(--neg) !important; }
::selection { background: var(--blue); color: #fff; }

/* Tricolore */
.tricolor { display: flex; height: 4px; border-radius: 4px; overflow: hidden; }
.tricolor i { flex: 1; }
.tricolor i:nth-child(1) { background: var(--blue-2); }
.tricolor i:nth-child(2) { background: #fff; }
.tricolor i:nth-child(3) { background: var(--red); }

/* ─────────── Login ─────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login-bg {
  position: absolute; inset: -20%;
  background:
    repeating-linear-gradient(115deg, transparent 0 80px, rgba(47, 123, 255, .06) 80px 160px, transparent 160px 240px, rgba(227, 16, 28, .05) 240px 320px);
  animation: drift 40s linear infinite;
}
@keyframes drift { to { transform: translateX(320px); } }
.login-card {
  position: relative; width: 100%; max-width: 420px;
  background: linear-gradient(180deg, rgba(19, 32, 68, .92), rgba(10, 18, 40, .95));
  border: 1px solid var(--line-2); border-radius: 22px; padding: 34px 30px 26px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, .03) inset;
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column; gap: 14px; text-align: center;
}
.login-logo { width: 170px; margin: 0 auto 4px; filter: drop-shadow(0 12px 30px var(--blue-glow)); }
.login-card h1 { font-size: 30px; text-transform: uppercase; }
.login-card .muted { margin: -8px 0 8px; }
.login-card .field { text-align: left; }
.login-card .tricolor { margin-top: 8px; }

/* ─────────── Shell ─────────── */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, #0b1530 0%, #070d1f 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; color: var(--text); text-decoration: none !important; }
.brand img { width: 74px; filter: drop-shadow(0 6px 16px var(--blue-glow)); }
.brand strong { display: block; font-family: var(--display); font-size: 20px; text-transform: uppercase; letter-spacing: .04em; line-height: 1; }
.brand small { color: var(--red-2); font-weight: 700; text-transform: uppercase; letter-spacing: .2em; font-size: 10.5px; }
#nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .18em; color: var(--muted);
  padding: 16px 12px 6px; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.nav-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #c6d1ee; font-weight: 500; text-decoration: none !important; position: relative;
  transition: background .15s, color .15s;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.nav-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-link.active {
  background: linear-gradient(90deg, rgba(47, 123, 255, .25), rgba(47, 123, 255, .04));
  color: #fff;
}
.nav-link.active::before {
  content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--blue-2), var(--red));
}
.nav-link.active svg { opacity: 1; color: var(--blue-2); }
.nav-link.danger.active svg { color: var(--red-2); }
.sidebar-foot { padding: 16px 8px 4px; display: flex; flex-direction: column; gap: 10px; font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 14px 28px; background: rgba(6, 11, 26, .78); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 26px; text-transform: uppercase; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title span { font-size: 12.5px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.user-chip .avatar { width: 32px; height: 32px; }
.user-chip b { display: block; font-size: 13px; line-height: 1.1; }
.user-chip small { font-size: 11px; }
.duty-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--green-bg); color: var(--green); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
}
.duty-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 var(--green); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(25, 195, 125, .6); } 100% { box-shadow: 0 0 0 10px rgba(25, 195, 125, 0); } }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); display: inline-grid; place-items: center; cursor: pointer; transition: .15s;
}
.icon-btn:hover { border-color: var(--red); color: var(--red-2); }
.menu-btn { display: none; }
.view { padding: 26px 28px 60px; max-width: 1480px; width: 100%; margin: 0 auto; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ─────────── Composants ─────────── */
.avatar {
  border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-family: var(--display);
  color: #fff; font-size: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue-2), #0b3aa8);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .12);
}
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 19px; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.card-head h2::before, .card-head h3::before { content: ''; width: 4px; height: 18px; border-radius: 3px; background: linear-gradient(180deg, var(--blue-2), var(--red)); }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-form { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.4fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Hero */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 26px 28px; margin-bottom: 20px;
  background:
    linear-gradient(110deg, rgba(31, 95, 224, .95) 0%, rgba(11, 58, 168, .95) 55%, rgba(8, 24, 70, .95) 100%);
  border: 1px solid rgba(255, 255, 255, .15); box-shadow: 0 25px 60px -25px var(--blue-glow);
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.hero::before {
  content: ''; position: absolute; right: -60px; top: 0; bottom: 0; width: 360px;
  background: repeating-linear-gradient(115deg, #fff 0 18px, transparent 18px 36px, var(--red) 36px 54px, transparent 54px 72px);
  opacity: .12; mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--blue-2) 33%, #fff 33% 66%, var(--red) 66%); }
.hero img { width: 120px; position: relative; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .35)); }
.hero-text { position: relative; flex: 1; min-width: 220px; }
.hero-text h2 { font-size: 32px; text-transform: uppercase; line-height: 1; }
.hero-text p { margin: 8px 0 0; color: rgba(255, 255, 255, .8); }
.hero-stat { position: relative; text-align: right; }
.hero-stat small { display: block; text-transform: uppercase; letter-spacing: .15em; font-size: 11px; color: rgba(255, 255, 255, .75); font-weight: 700; }
.hero-stat strong { font-family: var(--display); font-size: 40px; line-height: 1.1; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.kpi {
  position: relative; overflow: hidden; padding: 18px 20px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
  transition: transform .15s, border-color .15s;
}
.kpi:hover { transform: translateY(-2px); border-color: var(--line-2); }
.kpi::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent, var(--blue-2)); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.kpi-ico {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent, var(--blue-2)) 16%, transparent); color: var(--accent, var(--blue-2));
}
.kpi-ico svg { width: 18px; height: 18px; }
.kpi-value { font-family: var(--display); font-size: 31px; font-weight: 700; margin-top: 10px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kpi.is-pos { --accent: var(--green); }
.kpi.is-neg { --accent: var(--neg); }
.kpi.is-pos .kpi-value { color: var(--green); }
.kpi.is-neg .kpi-value { color: var(--neg); }
.kpi.big { grid-column: span 2; }
.kpi.big .kpi-value { font-size: 40px; }

/* Tables */
.table-wrap { overflow: visible; }
.card { container-type: inline-size; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; white-space: normal; overflow-wrap: anywhere; }
td .money, td.money, .plate, .badge, .btn, .rank { white-space: nowrap; overflow-wrap: normal; }
thead th { overflow-wrap: normal; }
thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700;
  background: rgba(255, 255, 255, .02); border-bottom: 1px solid var(--line);
}
tbody tr { border-bottom: 1px solid var(--line); transition: background .12s; }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: rgba(47, 123, 255, .06); }
td.r, th.r { text-align: right; }
tfoot td { font-weight: 700; background: rgba(255, 255, 255, .03); border-top: 1px solid var(--line-2); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .4; display: block; margin: 0 auto 10px; }
.money { font-family: var(--mono); font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.plate {
  display: inline-block; font-family: var(--mono); font-weight: 700; font-size: 12.5px; letter-spacing: .1em;
  padding: 3px 9px; border-radius: 5px; background: #fff; color: #0b2a7a; border: 2px solid #0b2a7a;
  box-shadow: inset 0 -3px 0 rgba(227, 16, 28, .9);
}
.who { display: flex; align-items: center; gap: 10px; }
.who .avatar { width: 30px; height: 30px; font-size: 12px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: color-mix(in srgb, var(--c, var(--blue-2)) 18%, transparent); color: var(--c, var(--blue-2));
  border: 1px solid color-mix(in srgb, var(--c, var(--blue-2)) 35%, transparent);
}
.badge.red { --c: var(--red-2); }
.badge.green { --c: var(--green); }
.badge.gray { --c: #8d9bc0; }
.badge.amber { --c: var(--amber); }

/* Formulaires */
.form { display: grid; gap: 14px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: #b5c2e6; }
.field > span em { font-style: normal; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 500; }
input, select, textarea {
  font: inherit; color: var(--text); background: #081127; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 11px 13px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px var(--blue-glow); }
input[type=color] { padding: 3px; height: 44px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue-2); }
.input-money { position: relative; }
.input-money input { padding-right: 34px; font-family: var(--mono); font-weight: 700; }
.input-money::after { content: var(--cur, '$'); position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--green); font-weight: 700; }
.check {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02); cursor: pointer; transition: .15s;
}
.check:hover { border-color: var(--line-2); }
.check:has(input:checked) { border-color: rgba(47, 123, 255, .5); background: rgba(47, 123, 255, .08); }
.check b { display: block; font-size: 13px; }
.check small { color: var(--muted); font-size: 12px; }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-error { color: var(--neg); background: var(--neg-bg); border: 1px solid rgba(255, 77, 87, .3); padding: 10px 12px; border-radius: 10px; margin: 0; font-size: 13px; text-align: left; }

/* Sélecteur à tuiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.tile {
  position: relative; padding: 14px 10px; border-radius: 12px; border: 1px solid var(--line-2); background: #081127;
  cursor: pointer; text-align: center; transition: .15s; font-weight: 600;
}
.tile input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; padding: 0; inset: 0; }
.tile .t-ico { font-size: 24px; display: block; margin-bottom: 4px; }
.tile:hover { border-color: var(--blue-2); }
.tile:has(input:checked) { border-color: var(--blue-2); background: linear-gradient(180deg, rgba(47, 123, 255, .25), rgba(47, 123, 255, .06)); box-shadow: 0 0 0 3px var(--blue-glow); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03);
  color: var(--text); font-size: 12px; cursor: pointer; font-weight: 600;
}
.chip:hover { border-color: var(--blue-2); color: #fff; background: rgba(47, 123, 255, .15); }

/* Boutons */
.btn {
  font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  cursor: pointer; transition: .15s; white-space: nowrap; text-decoration: none !important;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--blue-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, var(--blue-2), var(--blue)); border-color: transparent; color: #fff; box-shadow: 0 8px 24px -8px var(--blue-glow); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-danger { background: linear-gradient(180deg, var(--red-2), var(--red)); border-color: transparent; color: #fff; box-shadow: 0 8px 24px -8px rgba(227, 16, 28, .5); }
.btn-danger:hover { filter: brightness(1.1); }
.btn-success { background: linear-gradient(180deg, #23d68b, #12a466); border-color: transparent; color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { padding: 13px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 6px; width: 32px; height: 32px; }
.btn-icon.del:hover { border-color: var(--red); color: var(--red-2); background: var(--neg-bg); }

/* Tarifs */
.price-card { overflow: hidden; }
.price-card .pc-head {
  padding: 18px 20px; display: flex; align-items: center; gap: 14px;
  background: linear-gradient(110deg, rgba(47, 123, 255, .22), transparent); border-bottom: 1px solid var(--line);
}
.price-card .pc-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2); }
.price-card h3 { font-size: 21px; text-transform: uppercase; }
.price-line { display: flex; align-items: center; gap: 10px; padding: 13px 20px; border-bottom: 1px dashed var(--line); }
.price-line:last-child { border-bottom: 0; }
.price-line .pl-label { flex: 1; }
.price-line .pl-price { font-family: var(--display); font-weight: 700; font-size: 22px; }
.price-line .pl-price.free { color: var(--green); }

/* Calculatrice */
.calc-screen {
  background: #040915; border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 16px; text-align: right;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, .6); margin-bottom: 12px;
}
.calc-screen .expr { font-family: var(--mono); color: var(--muted); min-height: 20px; font-size: 13px; word-break: break-all; }
.calc-screen .res { font-family: var(--mono); font-size: 32px; font-weight: 700; word-break: break-all; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.calc-keys button {
  font: inherit; font-family: var(--mono); font-size: 18px; font-weight: 700; padding: 14px 0; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); cursor: pointer; transition: .1s;
}
.calc-keys button:hover { border-color: var(--blue-2); }
.calc-keys button:active { transform: scale(.96); }
.calc-keys .op { color: var(--blue-2); }
.calc-keys .eq { background: linear-gradient(180deg, var(--blue-2), var(--blue)); color: #fff; border-color: transparent; }
.calc-keys .clr { color: var(--red-2); }
.sim-line { display: grid; grid-template-columns: 1fr 110px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.sim-line input { text-align: center; font-family: var(--mono); font-weight: 700; }
.sim-total {
  margin-top: 14px; padding: 16px 18px; border-radius: 14px; display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(110deg, rgba(25, 195, 125, .18), rgba(25, 195, 125, .04)); border: 1px solid rgba(25, 195, 125, .35);
}
.sim-total strong { font-family: var(--display); font-size: 32px; color: var(--green); }
.seg { display: inline-flex; padding: 4px; background: #081127; border: 1px solid var(--line-2); border-radius: 12px; gap: 4px; flex-wrap: wrap; }
.seg button { font: inherit; font-weight: 600; font-size: 13px; padding: 7px 12px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--blue); color: #fff; }

/* Leaderboard */
.bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .06); overflow: hidden; min-width: 120px; }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--blue-2), var(--red)); }
.rank { font-family: var(--display); font-weight: 700; font-size: 18px; width: 28px; color: var(--muted); }
.rank.r1 { color: #ffd34d; } .rank.r2 { color: #d9e2f5; } .rank.r3 { color: #e39b5a; }

/* Équipe */
.team-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; text-decoration: none !important; color: var(--text); transition: .15s; }
.team-card:hover { transform: translateY(-3px); border-color: rgba(47, 123, 255, .5); }
.team-card .who .avatar { width: 46px; height: 46px; font-size: 16px; }
.team-card .who b { font-size: 16px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-stats div { background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.mini-stats small { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.mini-stats b { font-family: var(--mono); font-size: 13px; }

/* Profil employé */
.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px; }
.profile-head .avatar { width: 70px; height: 70px; font-size: 26px; }
.profile-head h2 { font-size: 30px; text-transform: uppercase; }

/* Planning */
.duty-card { display: flex; align-items: center; gap: 20px; padding: 22px; flex-wrap: wrap; }
.duty-status { flex: 1; min-width: 200px; }
.duty-status h3 { font-size: 24px; text-transform: uppercase; }
.duty-clock { font-family: var(--mono); font-size: 34px; font-weight: 700; color: var(--green); }
.on-duty-list { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px 22px; }
.on-duty-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--green-bg); border: 1px solid rgba(25, 195, 125, .3); }
.on-duty-item .avatar { width: 30px; height: 30px; font-size: 12px; }
.on-duty-item small { color: var(--green); font-family: var(--mono); }
.week-grid { display: grid; grid-template-columns: 170px repeat(7, minmax(0, 1fr)) 70px; }
.week-grid > div { min-width: 0; overflow-wrap: anywhere; }
.week-hint { display: none; }
input, select, textarea { min-width: 0; }
.form-2 > *, .grid > *, .field { min-width: 0; }
.audit-row > * { min-width: 0; }
.kv span { max-width: 100%; }
.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.week-grid > div { padding: 10px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); font-size: 12.5px; }
.week-grid .wh { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); background: rgba(255, 255, 255, .02); }
.week-grid .wh.today { color: var(--blue-2); }
.shift { display: block; margin: 2px 0; padding: 3px 7px; border-radius: 6px; background: rgba(47, 123, 255, .16); border-left: 3px solid var(--blue-2); font-family: var(--mono); font-size: 11.5px; }
.shift.live { background: var(--green-bg); border-left-color: var(--green); }

/* Archives */
.archive-item { display: flex; align-items: center; gap: 16px; padding: 16px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.archive-item:last-child { border-bottom: 0; }
.archive-item .a-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(47, 123, 255, .14); color: var(--blue-2); }
.archive-item .a-main { flex: 1; min-width: 200px; }
.archive-item .a-main b { font-size: 15px; }
.archive-item .a-nums { display: flex; gap: 22px; flex-wrap: wrap; }
.archive-item .a-nums small { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.danger-zone {
  border: 1px solid rgba(227, 16, 28, .4); border-radius: var(--radius); padding: 20px 22px;
  background: linear-gradient(110deg, rgba(227, 16, 28, .14), rgba(227, 16, 28, .02));
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.danger-zone div { flex: 1; min-width: 220px; }
.danger-zone h3 { font-size: 20px; text-transform: uppercase; color: var(--red-2); }
.danger-zone p { margin: 4px 0 0; color: #f0c2c5; font-size: 13px; }

/* Modal */
.modal-back {
  position: fixed; inset: 0; z-index: 100; background: rgba(3, 6, 15, .72); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px 16px; animation: fade .15s; overflow-y: auto;
}
.modal { width: 100%; max-width: 640px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.wide { max-width: 1100px; }
.modal .card-head { flex-shrink: 0; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); flex-shrink: 0; }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 40px); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; min-width: 260px;
  background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 600;
  border-left: 4px solid var(--green); animation: slide .2s ease;
}
.toast.err { border-left-color: var(--red); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--green); }
.toast.err svg { color: var(--red-2); }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } }

.section-title { display: flex; align-items: center; gap: 12px; margin: 30px 0 14px; }
.section-title h2 { font-size: 21px; text-transform: uppercase; }
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.note { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.note b { color: #c6d1ee; }
.loader { display: grid; place-items: center; padding: 80px; }
.loader i { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--blue-2); border-right-color: var(--red); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Administration */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 28px 0; max-width: 1480px; width: 100%; margin: 0 auto; }
.admin-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--panel); color: #c6d1ee; white-space: nowrap; font-weight: 600; text-decoration: none !important; transition: .15s;
}
.admin-tab svg { width: 16px; height: 16px; }
.admin-tab:hover { border-color: var(--line-2); color: #fff; }
.admin-tab.active { background: linear-gradient(180deg, var(--blue-2), var(--blue)); color: #fff; border-color: transparent; box-shadow: 0 8px 22px -10px var(--blue-glow); }
.admin-tab.dev { border-color: rgba(245, 165, 36, .4); color: var(--amber); }
.admin-tab.dev.active { background: linear-gradient(180deg, #f5a524, #c27c00); color: #fff; }
.copy-box {
  cursor: pointer; font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: .14em; text-align: center;
  padding: 18px; border: 2px dashed var(--blue-2); border-radius: 14px; background: #040915; transition: .15s; user-select: all;
}
.copy-box:hover { background: rgba(47, 123, 255, .08); }
.copy-box.copied { border-color: var(--green); color: var(--green); }
.copy-hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 6px; }
.audit-row { display: grid; grid-template-columns: 150px 210px 1fr; gap: 14px; align-items: start; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.audit-row:last-child { border-bottom: 0; }
.audit-row .when { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.audit-row .what b { display: block; }
.kv { display: flex; flex-wrap: wrap; gap: 6px; }
.kv span { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); color: #c6d1ee; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv span i { font-style: normal; color: var(--muted); }
.clickable { cursor: pointer; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #56607a; margin-right: 6px; vertical-align: middle; }
.status-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(25, 195, 125, .2); }

/* Tableaux en cartes quand la place manque (jamais de défilement horizontal) */
@container (max-width: 760px) {
  .table-wrap table, .table-wrap tbody, .table-wrap tfoot, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { padding: 10px 16px; border-bottom: 1px solid var(--line); }
  .table-wrap tfoot tr { background: rgba(255, 255, 255, .03); }
  .table-wrap td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; text-align: right; border: 0; background: none; }
  .table-wrap td::before { content: attr(data-label); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; text-align: left; flex-shrink: 0; }
  .table-wrap td[data-label=""]::before { content: none; }
  .table-wrap td[data-label=""] { justify-content: flex-end; }
  .table-wrap td .who, .table-wrap td > .row { justify-content: flex-end; }
  .table-wrap td input, .table-wrap td select, .table-wrap td .input-money { max-width: 62%; }
  .week-grid { display: none; }
  .week-hint { display: block; }
}
@container (max-width: 1080px) {
  .table-wrap.wide table, .table-wrap.wide tbody, .table-wrap.wide tr, .table-wrap.wide td { display: block; width: 100%; }
  .table-wrap.wide thead { display: none; }
  .table-wrap.wide tr { padding: 10px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 20px; }
  .table-wrap.wide td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; text-align: right; }
  .table-wrap.wide td::before { content: attr(data-label); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; text-align: left; }
  .table-wrap.wide td:first-child { grid-column: 1 / -1; }
  .table-wrap.wide td:first-child::before, .table-wrap.wide td[data-label=""]::before { content: none; }
}

/* ─────────── Responsive ─────────── */
@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-form { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; box-shadow: 30px 0 60px rgba(0, 0, 0, .6); }
  .sidebar-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 35; display: none; }
  .sidebar.open + .sidebar-scrim { display: block; }
  .menu-btn { display: inline-grid; }
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .user-chip div { display: none; }
  .user-chip { padding: 4px; }
}
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .topbar-title h1 { font-size: 20px; }
  .view { padding: 18px 16px 50px; }
  .admin-tabs { padding: 14px 16px 0; }
  .audit-row { grid-template-columns: 1fr; gap: 4px; padding: 12px 16px; }
  .g-4, .form-2, .perm-grid { grid-template-columns: 1fr; }
  .kpi.big { grid-column: auto; }
  .hero { padding: 20px; }
  .hero img { width: 84px; }
  .hero-stat { text-align: left; }
  .duty-pill { display: none !important; }
}
