/* ==========================================================================
   Bazes Shop — Panel admin
   ========================================================================== */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(../fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url(../fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url(../fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 500; font-display: swap; src: url(../fonts/space-grotesk-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 600; font-display: swap; src: url(../fonts/space-grotesk-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 700; font-display: swap; src: url(../fonts/space-grotesk-latin-700-normal.woff2) format('woff2'); }

:root {
  --bg: #F4F4F9;
  --bg-grad: radial-gradient(1200px 600px at 85% -10%, rgba(124,108,255,.10), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(94,230,255,.10), transparent 60%);
  --surface: #FFFFFF;
  --surface-2: #F6F6FB;
  --surface-3: #EEEEF6;
  --border: #E5E5EF;
  --border-strong: #D6D6E4;
  --text: #14142B;
  --text-2: #3D3D57;
  --muted: #64647E;
  --brand: #6553E8;
  --brand-2: #7C6CFF;
  --brand-soft: rgba(124,108,255,.12);
  --neon: #0891B2;
  --neon-soft: rgba(8,145,178,.12);
  --success: #15803D; --success-soft: rgba(21,128,61,.12);
  --danger: #DC2626; --danger-soft: rgba(220,38,38,.10);
  --warn: #B45309; --warn-soft: rgba(217,119,6,.12);
  --shadow-sm: 0 1px 2px rgba(20,20,43,.05), 0 1px 1px rgba(20,20,43,.03);
  --shadow: 0 1px 2px rgba(20,20,43,.04), 0 8px 24px -8px rgba(20,20,43,.10);
  --shadow-lg: 0 24px 60px -18px rgba(20,20,43,.30);
  --glow: 0 10px 30px -10px rgba(101,83,232,.55);
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  --font: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #07080F;
  --bg-grad: radial-gradient(1100px 600px at 90% -10%, rgba(124,108,255,.22), transparent 60%), radial-gradient(900px 600px at -10% 110%, rgba(94,230,255,.12), transparent 60%);
  --surface: #0E1020;
  --surface-2: #131528;
  --surface-3: #1A1D33;
  --border: #20233B;
  --border-strong: #2C3050;
  --text: #EDEDF7;
  --text-2: #C4C4D8;
  --muted: #9192AE;
  --brand: #9D8FFF;
  --brand-2: #7C6CFF;
  --brand-soft: rgba(124,108,255,.18);
  --neon: #5EE6FF;
  --neon-soft: rgba(94,230,255,.12);
  --success: #4ADE80; --success-soft: rgba(74,222,128,.12);
  --danger: #F87171; --danger-soft: rgba(248,113,113,.12);
  --warn: #FBBF24; --warn-soft: rgba(251,191,36,.12);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.8);
  --glow: 0 10px 34px -8px rgba(124,108,255,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text);
  background: var(--bg-grad), var(--bg); background-attachment: fixed;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -.02em; margin: 0; color: var(--text); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--brand-soft); }
.i { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 22px; height: 22px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.between { justify-content: space-between; }
.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(18px); border-right: 1px solid var(--border); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 16px; }
.brand img { width: 42px; height: 42px; border-radius: 13px; box-shadow: var(--glow); }
.brand b { font-family: var(--display); font-size: 17px; display: block; line-height: 1.1; }
.brand span { font-size: 12px; color: var(--muted); }
.nav { position: relative; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.nav a {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px;
  color: var(--text-2); font-weight: 500; text-decoration: none; transition: color .2s var(--ease), background .2s var(--ease);
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { color: var(--brand); }
.nav a .i { opacity: .85; }
.nav a .badge { margin-left: auto; }
.nav-indicator {
  position: absolute; left: 4px; right: 4px; height: 40px; border-radius: 11px; z-index: 0;
  background: var(--brand-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent);
  transition: transform .45s var(--spring), height .3s var(--ease), opacity .2s; pointer-events: none;
}
.nav-indicator::before { content: ''; position: absolute; left: -4px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--brand); }
.sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.bot-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.bot-chip img { width: 30px; height: 30px; border-radius: 50%; }
.bot-chip b { font-size: 13px; display: block; }
.bot-chip small { color: var(--muted); font-size: 11.5px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 14px; padding: 16px 32px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.topbar h1 { font-size: 22px; }
.topbar .crumb { color: var(--muted); font-size: 13px; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); position: relative; flex: none; }
.dot.on { background: #22C55E; }
.dot.on::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #22C55E; animation: ping 1.8s var(--ease) infinite; }
.dot.off { background: var(--danger); }
.dot.warn { background: #F59E0B; }
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
.view { padding: 28px 32px 60px; max-width: 1480px; width: 100%; }
.btn.menu-btn { display: none; }

/* ---------- Animations d'entrée ---------- */
.enter > * , .anim { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.view.leaving { animation: leave .18s var(--ease) both; }
@keyframes leave { to { opacity: 0; transform: translateY(-6px); filter: blur(3px); } }
.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0% { background: color-mix(in srgb, var(--brand) 18%, transparent); } 100% { background: transparent; } }
.slide-in { animation: slideIn .5s var(--spring) both; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); max-height: 0; } to { opacity: 1; transform: none; max-height: 200px; } }

/* ---------- Cartes & grilles ---------- */
.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-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease), border-color .3s;
}
.card.pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15.5px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; }
.card-body { padding: 18px 20px; }
.card.hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border-strong); }
.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; }
.section-title h2 { font-size: 17px; }

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi .ico.neon { background: var(--neon-soft); color: var(--neon); }
.kpi .ico.ok { background: var(--success-soft); color: var(--success); }
.kpi .ico.warn { background: var(--warn-soft); color: var(--warn); }
.kpi .ico.danger { background: var(--danger-soft); color: var(--danger); }
.kpi .val { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 14px; line-height: 1; }
.kpi .lbl { color: var(--muted); font-size: 13px; margin-top: 6px; }
.kpi .trend { position: absolute; top: 18px; right: 18px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.kpi::after { content: ''; position: absolute; right: -40px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--brand-soft), transparent 70%); opacity: 0; transition: opacity .4s; }
.kpi:hover::after { opacity: 1; }

.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 26px 28px; color: #fff;
  background: #0B0C18; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 22px;
}
.hero::before { content: ''; position: absolute; inset: -40%; background: radial-gradient(40% 50% at 20% 30%, rgba(124,108,255,.75), transparent 70%), radial-gradient(35% 45% at 85% 80%, rgba(94,230,255,.45), transparent 70%), radial-gradient(30% 40% at 60% 10%, rgba(192,132,252,.35), transparent 70%); animation: aurora 18s ease-in-out infinite alternate; }
.hero > * { position: relative; }
.hero img.icon { width: 76px; height: 76px; border-radius: 22px; box-shadow: 0 10px 40px -6px rgba(124,108,255,.8); }
.hero h2 { color: #fff; font-size: 26px; }
.hero p { margin: 4px 0 0; color: rgba(255,255,255,.75); }
.hero .chips { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.hero .chip { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(8px); }
@keyframes aurora { 0% { transform: translate(0,0) rotate(0deg) scale(1); } 50% { transform: translate(4%, -3%) rotate(8deg) scale(1.05); } 100% { transform: translate(-3%, 4%) rotate(-6deg) scale(1.08); } }

/* ---------- Boutons & formulaires ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .25s var(--ease), background .2s, border-color .2s, color .2s; white-space: nowrap; user-select: none;
}
.btn:hover { border-color: var(--brand-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--brand-2), var(--brand)); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 14px 34px -10px rgba(101,83,232,.7); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-soft); }
.btn.danger:hover { border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn.loading::after { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border-strong); background: var(--surface);
  transition: border-color .2s, box-shadow .2s; outline: none;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px var(--brand-soft); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.input-icon { position: relative; }
.input-icon .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
input[type=color].swatch { width: 40px; height: 40px; padding: 0; border: 1px solid var(--border-strong); border-radius: 11px; background: none; cursor: pointer; }
input[type=color].swatch::-webkit-color-swatch-wrapper { padding: 4px; }
input[type=color].swatch::-webkit-color-swatch { border: none; border-radius: 7px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 42px; height: 24px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: background .25s var(--ease), border-color .25s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .35s var(--spring); }
.switch input:checked + .track { background: var(--brand-2); border-color: var(--brand-2); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.switch b { font-weight: 600; font-size: 13.5px; display: block; }
.switch small { color: var(--muted); font-size: 12.5px; }

.segmented { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); gap: 2px; }
.segmented button { border: 0; background: none; padding: 6px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .2s var(--ease); }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Badges, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.ok { background: var(--success-soft); color: var(--success); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.neon { background: var(--neon-soft); color: var(--neon); }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all .2s var(--ease); }
.chip:hover { border-color: var(--border-strong); }
.chip.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip .swatch-dot { width: 8px; height: 8px; border-radius: 50%; }
.chip .count { font-weight: 500; opacity: .65; }

/* ---------- Avatars ---------- */
.av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--brand); }
.av.sm { width: 26px; height: 26px; font-size: 11px; }
.av.lg { width: 64px; height: 64px; font-size: 22px; }

/* ---------- Tableaux & listes ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); transition: background .15s; }
.list-item:last-child { border-bottom: 0; }
.list-item.click { cursor: pointer; }
.list-item.click:hover { background: var(--surface-2); }
.list-item.selected { background: var(--brand-soft); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .i { width: 40px; height: 40px; opacity: .45; margin-bottom: 10px; }
.empty b { display: block; color: var(--text-2); font-size: 15px; margin-bottom: 4px; }

/* ---------- Logs ---------- */
.log { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.log:hover { background: var(--surface-2); }
.log .lic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.log .lt { font-weight: 600; font-size: 13.5px; }
.log .lmeta { font-size: 12.5px; color: var(--muted); }
.log .lcontent { font-size: 13px; color: var(--text-2); margin-top: 3px; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.log .ltime { font-size: 12px; color: var(--muted); white-space: nowrap; text-align: right; }
.logs-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.cat-list { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.cat-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-weight: 500; font-size: 13.5px; color: var(--text-2); transition: background .15s; border: 0; background: none; text-align: left; width: 100%; }
.cat-item:hover { background: var(--surface-2); }
.cat-item.on { background: var(--brand-soft); color: var(--text); }
.cat-item .ci { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.cat-item .n { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Tickets ---------- */
.tickets-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; height: calc(100vh - 170px); min-height: 520px; }
.tickets-layout > .card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.scroll { overflow-y: auto; min-height: 0; flex: 1; }
.chat { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; background: var(--surface-2); }
.msg { display: flex; gap: 10px; max-width: 86%; animation: rise .4s var(--ease) both; }
.msg .bubble { background: var(--surface); border: 1px solid var(--border); padding: 10px 14px; border-radius: 4px 16px 16px 16px; box-shadow: var(--shadow-sm); }
.msg .who { font-size: 12.5px; font-weight: 600; margin-bottom: 2px; display: flex; gap: 8px; align-items: baseline; }
.msg .who small { font-weight: 400; color: var(--muted); }
.msg .text { white-space: pre-wrap; word-break: break-word; }
.msg.bot { align-self: flex-end; flex-direction: row-reverse; }
.msg.bot .bubble { background: var(--brand-soft); border-color: transparent; border-radius: 16px 4px 16px 16px; }
.msg .emb { border-left: 3px solid var(--brand-2); padding: 6px 10px; margin-top: 6px; background: var(--surface-2); border-radius: 6px; font-size: 13px; }
.composer { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); background: var(--surface); }
.composer .textarea { min-height: 44px; height: 44px; max-height: 160px; }

/* ---------- Modal, tiroir, toasts ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(10,10,25,.38); backdrop-filter: blur(6px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fadeIn .2s var(--ease) both; }
.backdrop.closing { animation: fadeOut .18s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); animation: pop .4s var(--spring) both; }
.modal.wide { width: min(760px, 100%); }
.backdrop.closing .modal { animation: popOut .18s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.95); } }
@keyframes popOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 0; }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 18px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; }
.drawer-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(10,10,25,.25); backdrop-filter: blur(3px); animation: fadeIn .2s both; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: drawerIn .45s var(--spring) both; }
.drawer-wrap.closing { animation: fadeOut .2s both; }
.drawer-wrap.closing .drawer { animation: drawerOut .2s var(--ease) both; }
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } }
@keyframes drawerOut { to { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 18px; }
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: 420px; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-weight: 500; animation: toastIn .5s var(--spring) both; }
.toast.out { animation: toastOut .25s var(--ease) both; }
.toast .ti { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.14); flex: none; }
.toast.error .ti { background: var(--danger); color: #fff; }
.toast.success .ti { background: #22C55E; color: #fff; }
.toast.alert { background: #2A0C12; color: #fff; border: 1px solid rgba(248,113,113,.5); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.92); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ---------- Divers ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.stars { color: #F59E0B; letter-spacing: 1px; font-size: 14px; }
.stars .off { color: var(--border-strong); }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-2), var(--neon)); transform-origin: left; animation: grow 1s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .line { fill: none; stroke: var(--brand-2); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.6s var(--ease) forwards .2s; }
.chart .area { fill: url(#areaGrad); opacity: 0; animation: fadeIn .9s var(--ease) forwards .7s; animation-name: areaIn; }
@keyframes areaIn { to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .gridline { stroke: var(--border); stroke-dasharray: 3 4; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.donut circle { transition: stroke-dashoffset 1.2s var(--ease); }
.kbd { font-family: var(--font); font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs button { position: relative; border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; transition: color .2s; }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand-2); animation: grow .35s var(--ease); }
.status-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.status-tile .st-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.status-tile b { display: block; font-size: 13.5px; }
.status-tile small { color: var(--muted); font-size: 12px; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--brand-soft); color: var(--text-2); font-size: 13.5px; }
.callout.warn { background: var(--warn-soft); }
.callout .i { color: var(--brand); margin-top: 1px; }
.callout.warn .i { color: var(--warn); }
.discord-preview { background: #313338; color: #DBDEE1; border-radius: 14px; padding: 16px; font-family: 'Inter', sans-serif; }
.discord-preview .dp-head { display: flex; gap: 12px; }
.discord-preview .dp-name { font-weight: 600; color: #F2F3F5; }
.discord-preview .dp-tag { background: #5865F2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; margin-left: 6px; }
.discord-preview .dp-embed { margin-top: 8px; background: #2B2D31; border-left: 4px solid var(--c, #7C6CFF); border-radius: 4px; padding: 10px 14px; max-width: 520px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.discord-preview .dp-title { font-weight: 700; color: #F2F3F5; }
.discord-preview .dp-desc { font-size: 14px; white-space: pre-wrap; margin-top: 4px; }
.discord-preview .dp-img { grid-column: 1/-1; max-width: 100%; border-radius: 6px; margin-top: 6px; }
.discord-preview .dp-thumb { width: 72px; height: 72px; border-radius: 6px; object-fit: cover; }
.discord-preview .dp-foot { grid-column: 1/-1; font-size: 12px; color: #B5BAC1; }
.jarvis-orb { width: 92px; height: 92px; border-radius: 50%; position: relative; flex: none; background: radial-gradient(circle at 35% 30%, #fff 0%, #9D8FFF 18%, #7C6CFF 40%, #1B1446 75%); box-shadow: 0 0 40px rgba(124,108,255,.6), inset 0 0 20px rgba(94,230,255,.5); animation: orb 4s ease-in-out infinite; }
.jarvis-orb::before, .jarvis-orb::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 1.5px solid rgba(94,230,255,.45); animation: ring 3s var(--ease) infinite; }
.jarvis-orb::after { animation-delay: 1.5s; }
.jarvis-orb.off { filter: grayscale(1) brightness(.7); animation: none; }
.jarvis-orb.off::before, .jarvis-orb.off::after { display: none; }
@keyframes orb { 50% { transform: scale(1.04); box-shadow: 0 0 60px rgba(124,108,255,.8), inset 0 0 24px rgba(94,230,255,.7); } }
@keyframes ring { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.45); opacity: 0; } }
.cmd-list code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); }

@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-105%); transition: transform .4s var(--spring); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .view, .topbar { padding-left: 18px; padding-right: 18px; }
  .g-3, .g-2, .form-grid { grid-template-columns: 1fr; }
  .logs-layout, .tickets-layout { grid-template-columns: 1fr; height: auto; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero .chips { margin-left: 0; justify-content: flex-start; }
}
@media (max-width: 560px) { .g-4 { grid-template-columns: 1fr; } .topbar h1 { font-size: 18px; } .live { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ==========================================================================
   Page de connexion
   ========================================================================== */
.login-page { min-height: 100vh; display: grid; place-items: center; background: #05060C; color: #EDEDF7; overflow: hidden; position: relative; padding: 20px; }
.aurora { position: fixed; inset: 0; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .7; mix-blend-mode: screen; }
.aurora .a1 { width: 620px; height: 620px; background: #7C6CFF; top: -180px; left: -120px; animation: drift1 16s ease-in-out infinite alternate; }
.aurora .a2 { width: 520px; height: 520px; background: #22D3EE; bottom: -200px; right: -120px; opacity: .45; animation: drift2 19s ease-in-out infinite alternate; }
.aurora .a3 { width: 380px; height: 380px; background: #C084FC; top: 40%; left: 55%; opacity: .35; animation: drift3 13s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(140px, 120px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-160px, -90px) scale(1.2); } }
@keyframes drift3 { to { transform: translate(-220px, 80px) scale(.85); } }
.grain { position: fixed; inset: 0; pointer-events: none; opacity: .08; background-image: radial-gradient(rgba(255,255,255,.6) 1px, transparent 1px); background-size: 3px 3px; mask-image: radial-gradient(circle at center, #000, transparent 75%); }
.gridlines { position: fixed; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 64px 64px; mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%); animation: gridMove 30s linear infinite; }
@keyframes gridMove { to { background-position: 64px 64px; } }
.sparkle { position: fixed; width: 14px; height: 14px; pointer-events: none; color: #fff; animation: twinkle 3.6s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: .9; transform: scale(1) rotate(45deg); } }
.login-card {
  position: relative; width: min(420px, 100%); padding: 38px 34px 30px; border-radius: 28px;
  background: linear-gradient(180deg, rgba(22,24,44,.78), rgba(12,13,26,.82)); border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 40px 120px -30px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.08); backdrop-filter: blur(24px);
  animation: cardIn 1s var(--spring) both .15s;
}
.login-card::before { content: ''; position: absolute; inset: -1px; border-radius: 28px; padding: 1px; background: conic-gradient(from var(--ang, 0deg), transparent 0 70%, rgba(124,108,255,.9) 80%, rgba(94,230,255,.9) 88%, transparent 96%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spinBorder 6s linear infinite; pointer-events: none; }
@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes spinBorder { to { --ang: 360deg; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) scale(.94); filter: blur(10px); } }
.login-logo { width: 96px; height: 96px; margin: -86px auto 18px; display: block; border-radius: 30px; box-shadow: 0 20px 60px -10px rgba(124,108,255,.9), 0 0 0 1px rgba(255,255,255,.1); animation: logoIn 1.1s var(--spring) both .35s, float 6s ease-in-out infinite 1.5s; }
@keyframes logoIn { from { opacity: 0; transform: scale(.4) rotate(-12deg); } }
@keyframes float { 50% { transform: translateY(-6px); } }
.login-card h1 { color: #fff; text-align: center; font-size: 26px; }
.login-card .lead { text-align: center; color: rgba(237,237,247,.62); margin: 6px 0 26px; }
.login-card .field label { color: rgba(237,237,247,.8); }
.login-card .input { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); color: #fff; height: 46px; border-radius: 13px; }
.login-card .input:focus { border-color: #7C6CFF; box-shadow: 0 0 0 4px rgba(124,108,255,.25); }
.login-card .input::placeholder { color: rgba(237,237,247,.35); }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { text-align: center; font-family: var(--display); font-size: 20px; font-weight: 600; padding: 0; }
.login-card .btn.primary { height: 48px; width: 100%; border-radius: 13px; font-size: 15px; margin-top: 8px; position: relative; overflow: hidden; }
.login-card .btn.primary::before { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-100%); animation: sheen 3.5s ease-in-out infinite 1.5s; }
@keyframes sheen { 60%, 100% { transform: translateX(100%); } }
.login-err { min-height: 20px; color: #FCA5A5; font-size: 13px; text-align: center; margin-top: 12px; }
.shake { animation: shake .5s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.login-ok { position: absolute; inset: 0; border-radius: 28px; display: grid; place-items: center; background: rgba(12,13,26,.9); opacity: 0; pointer-events: none; transition: opacity .3s; }
.login-ok.show { opacity: 1; }
.login-ok svg { width: 74px; height: 74px; }
.login-ok circle { stroke: #7C6CFF; stroke-width: 3; fill: none; stroke-dasharray: 220; stroke-dashoffset: 220; }
.login-ok path { stroke: #5EE6FF; stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; }
.login-ok.show circle { animation: dash .6s var(--ease) forwards; }
.login-ok.show path { animation: dash .4s var(--ease) forwards .45s; }
@keyframes dash { to { stroke-dashoffset: 0; } }
.login-foot { text-align: center; margin-top: 22px; font-size: 12px; color: rgba(237,237,247,.4); display: flex; align-items: center; justify-content: center; gap: 6px; }
