/* ═══════════════════════════════════════════════════════════
   BOT 911 — Panel  ·  thème « bleu nuit » + glassmorphism
   ═══════════════════════════════════════════════════════════ */
:root {
  --bg: #060a14;
  --text: #e8ecf6;
  --muted: #93a0bd;
  --muted-2: #5d6987;

  --accent: #4f80ff;
  --accent-2: #38bdf8;
  --accent-hover: #6b93ff;
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;
  --orange: #fb923c;

  /* Surfaces verre */
  --glass: rgba(24, 36, 66, 0.45);
  --glass-2: rgba(30, 44, 78, 0.55);
  --glass-hi: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-hi: rgba(120, 160, 255, 0.35);
  --blur: blur(18px) saturate(150%);

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
  --glow: 0 0 24px rgba(79, 128, 255, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
  background:
    radial-gradient(1000px 560px at 12% -12%, rgba(79, 128, 255, 0.20), transparent 60%),
    radial-gradient(820px 560px at 112% 8%, rgba(56, 189, 248, 0.14), transparent 55%),
    radial-gradient(700px 700px at 60% 120%, rgba(99, 102, 241, 0.14), transparent 60%),
    linear-gradient(165deg, #060a14 0%, #0a1224 55%, #0b1630 100%);
  background-attachment: fixed;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; letter-spacing: 0.06em; }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; }

svg { display: block; }
.ico svg { width: 18px; height: 18px; }

/* ── Verre générique ── */
.glass {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* ── Boutons ── */
.btn {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  background: var(--glass-hi);
  backdrop-filter: blur(6px);
  transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--border-hi); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #3b6ef0);
  border-color: transparent; color: #fff;
}
.btn-primary:hover { box-shadow: var(--glow); background: linear-gradient(135deg, var(--accent-hover), #4f80ff); }
.btn-danger { background: linear-gradient(135deg, #f8717133, #ef444433); border-color: rgba(248, 113, 113, 0.4); color: #fecaca; }
.btn-danger:hover { background: linear-gradient(135deg, var(--red), #ef4444); color: #fff; border-color: transparent; }
.btn-green { background: linear-gradient(135deg, #34d39933, #10b98133); border-color: rgba(52, 211, 153, 0.4); color: #a7f3d0; }
.btn-green:hover { background: linear-gradient(135deg, var(--green), #10b981); color: #04241a; border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-icon { padding: 7px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* ── Écran de connexion ── */
.login-screen { height: 100vh; display: grid; place-items: center; }
.login-card {
  border-radius: var(--radius);
  padding: 42px 38px;
  width: 350px;
  text-align: center;
  display: flex; flex-direction: column; gap: 14px;
}
.login-logo { width: 60px; height: 60px; margin: 0 auto; color: var(--accent); filter: drop-shadow(0 0 14px rgba(79,128,255,.5)); }
.login-logo svg { width: 60px; height: 60px; }
.login-card h1 { font-size: 27px; letter-spacing: 0.03em; background: linear-gradient(120deg, #fff, #9db8ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.login-card input {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px; color: var(--text); font-size: 15px;
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,128,255,.18); }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; }

/* ── Layout appli ── */
.app { display: grid; grid-template-columns: 262px 1fr; height: 100vh; padding: 14px; gap: 14px; }

.sidebar {
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  padding: 20px 14px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 10px; }
.brand-logo { width: 30px; height: 30px; color: var(--accent); filter: drop-shadow(0 0 10px rgba(79,128,255,.55)); }
.brand-logo svg { width: 30px; height: 30px; }
.bot-mini svg { width: 26px; height: 26px; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: 0.04em; background: linear-gradient(120deg, #fff, #9db8ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.guild-picker { display: flex; flex-direction: column; gap: 6px; padding: 0 6px; }
.guild-picker select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 11px; font-size: 13.5px; cursor: pointer;
}

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; padding: 0 2px; }
.nav-cat { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); padding: 16px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); cursor: pointer; font-weight: 600; font-size: 14px;
  user-select: none; position: relative;
  transition: background 0.14s, color 0.14s;
}
.nav-item .ico { display: flex; opacity: 0.85; }
.nav-item:hover { background: var(--glass-hi); color: var(--text); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(79,128,255,0.9), rgba(59,110,240,0.75));
  color: #fff; box-shadow: var(--glow);
}
.nav-item.active .ico { opacity: 1; }

.sidebar-footer { display: flex; flex-direction: column; gap: 10px; }
.bot-mini {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; background: var(--glass-hi);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12.5px;
}
.bot-mini img { width: 28px; height: 28px; border-radius: 50%; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); flex-shrink: 0; }
.status-dot.on { background: var(--green); box-shadow: 0 0 10px var(--green); }
.status-dot.off { background: var(--red); box-shadow: 0 0 8px rgba(248,113,113,.6); }

.content {
  border-radius: var(--radius); overflow-y: auto; padding: 28px 32px;
  background: rgba(10, 16, 32, 0.35);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
}

/* ── En-têtes de vue ── */
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.view-head .title { display: flex; align-items: center; gap: 13px; }
.view-head .title-ico {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--accent-2);
  background: linear-gradient(135deg, rgba(79,128,255,0.22), rgba(56,189,248,0.14));
  border: 1px solid var(--border);
}
.view-head .title-ico svg { width: 22px; height: 22px; }
.view-head h2 { font-size: 22px; }
.view-head p { color: var(--muted); margin-top: 3px; font-size: 13px; }

/* ── Cartes ── */
.grid { display: grid; gap: 15px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.card {
  border-radius: var(--radius); padding: 20px;
  background: var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.15s;
}
.card:hover { border-color: var(--border-hi); }

.stat { display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.stat .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--accent-2); background: rgba(79,128,255,0.14); margin-bottom: 4px; }
.stat .ico svg { width: 19px; height: 19px; }
.stat .num { font-size: 32px; font-weight: 800; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 13px; }

.entity-card { display: flex; flex-direction: column; gap: 13px; }
.entity-card .ec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.entity-card .ec-title { font-weight: 700; font-size: 16px; }
.entity-card .ec-id { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.entity-card .ec-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--glass-hi); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 11px; font-size: 11.5px; color: var(--muted);
}
.pill svg { width: 13px; height: 13px; }
.ec-actions { display: flex; gap: 8px; }

/* ── Tables ── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.tbl th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.tbl tbody tr { transition: background 0.12s; }
.tbl tbody tr:hover td { background: var(--glass-hi); }

/* ── Champs ── */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field > label { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.field > label svg { width: 15px; height: 15px; color: var(--accent-2); }
.field .hint { color: var(--muted); font-size: 12px; }
input[type=text], input[type=search], input[type=password], select, textarea {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; color: var(--text); font-size: 14px; width: 100%; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,128,255,.15); }
select option { background: #0c1526; }

/* ── Sélecteur de rôles ── */
.rolepick { position: relative; }
.rolepick-box {
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px; display: flex; flex-wrap: wrap; gap: 6px;
  min-height: 46px; cursor: text; align-items: center;
}
.rolepick-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,128,255,.15); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--glass-hi); border: 1px solid var(--border);
  border-radius: 7px; padding: 3px 8px; font-size: 12.5px;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chip .x { cursor: pointer; color: var(--muted); font-weight: 700; display: flex; }
.chip .x:hover { color: var(--red); }
.rolepick input { border: none; background: transparent; flex: 1; min-width: 90px; padding: 4px; width: auto; box-shadow: none; }
.rolepick input:focus { border: none; box-shadow: none; }
.rolepick-menu {
  position: absolute; z-index: 40; top: calc(100% + 5px); left: 0; right: 0;
  background: rgba(16, 24, 44, 0.92);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  max-height: 250px; overflow-y: auto; box-shadow: var(--shadow);
}
.rolepick-opt { display: flex; align-items: center; gap: 9px; padding: 10px 13px; cursor: pointer; font-size: 13.5px; }
.rolepick-opt:hover, .rolepick-opt.hl { background: var(--glass-hi); }
.rolepick-opt .dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.rolepick-opt.selected { opacity: 0.45; }
.rolepick-opt .chk { margin-left: auto; color: var(--green); display: flex; }

/* ── Modal ── */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 14, 0.55); backdrop-filter: blur(4px); }
.modal-box {
  position: relative; border-radius: var(--radius);
  width: min(560px, 92vw); max-height: 88vh; overflow-y: auto; padding: 26px;
  background: rgba(16, 24, 46, 0.75);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border-hi); box-shadow: var(--shadow);
}
.modal-box h3 { font-size: 19px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ── Toasts ── */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  border-radius: var(--radius-sm); padding: 13px 16px 13px 15px; min-width: 250px;
  background: rgba(20, 30, 56, 0.8);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  box-shadow: var(--shadow); animation: slideIn 0.22s ease;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Logs bot ── */
.logbox {
  border-radius: var(--radius-sm); padding: 15px; height: 420px; overflow-y: auto;
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border);
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12.5px; line-height: 1.65;
}
.logline .err { color: var(--red); }
.logline .sys { color: var(--yellow); }
.logline .ts { color: var(--muted-2); margin-right: 8px; }

/* ── Empty state ── */
.empty { text-align: center; padding: 62px 20px; color: var(--muted); }
.empty .big { width: 54px; height: 54px; margin: 0 auto 14px; color: var(--muted-2); opacity: 0.7; }
.empty .big svg { width: 54px; height: 54px; }

/* ── Members ── */
.member-row { display: flex; align-items: center; gap: 12px; }
.member-row img { width: 36px; height: 36px; border-radius: 50%; }
.role-tags { display: flex; flex-wrap: wrap; gap: 7px; }

/* ── Divers ── */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.section-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin: 22px 0 11px; font-weight: 700; }
a { color: var(--accent); text-decoration: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(120, 150, 220, 0.22); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(120, 150, 220, 0.4); }
::-webkit-scrollbar-track { background: transparent; }

/* ── Connexion Discord ── */
.btn-discord { background: #5865f2; border-color: transparent; color: #fff; justify-content: center; padding: 12px; }
.btn-discord:hover { background: #4a56e0; box-shadow: 0 0 22px rgba(88, 101, 242, 0.45); }
.btn-discord svg { width: 20px; height: 20px; }
.login-pw { display: flex; flex-direction: column; gap: 12px; }
.login-sep { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.login-sep::before, .login-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Sidebar : groupes cachés ── */
.nav-group.hidden { display: none; }

/* ── Vue « Votre faction » ── */
.fac-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.fac-select { max-width: 320px; }
.fac-grade { margin-bottom: 8px; }
.grade-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.grade-head .gname { font-weight: 700; font-size: 15px; }
.grade-head .gcount { background: var(--glass-hi); border: 1px solid var(--border); border-radius: 20px; padding: 2px 10px; font-size: 11.5px; color: var(--muted); }
.grade-head .gdot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.mchips { display: flex; flex-wrap: wrap; gap: 8px; }
.mchip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; background: var(--glass-hi); border: 1px solid var(--border); border-radius: 22px; font-size: 12.5px; }
.mchip img { width: 24px; height: 24px; border-radius: 50%; }
.mchip svg { width: 14px; height: 14px; color: var(--accent-2); }
.mchip.clickable { cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.mchip.clickable:hover { border-color: var(--border-hi); background: rgba(79,128,255,0.14); }
.mempty { color: var(--muted-2); font-size: 12.5px; font-style: italic; }
.div-block { margin-top: 22px; }
.div-block > .dh { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.div-block > .dh svg { color: var(--accent-2); }

/* ── Vue Administrateur ── */
.admin-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: rgba(79,128,255,0.1); border: 1px solid rgba(79,128,255,0.25); margin-bottom: 20px; font-size: 13px; color: var(--muted); }
.admin-note svg { color: var(--accent-2); flex-shrink: 0; margin-top: 1px; }

/* ── Select personnalisé (remplace les <select> natifs) ── */
.cs { position: relative; width: 100%; }
.cs-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 9px;
  cursor: pointer; user-select: none; font-size: 14px; min-height: 44px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cs-box:hover { border-color: var(--border-hi); }
.cs-box:focus, .cs-box.open { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,128,255,.15); }
.cs-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-label.cs-placeholder { color: var(--muted-2); }
.cs-arrow { display: flex; color: var(--muted); transition: transform 0.18s; }
.cs-arrow svg { width: 16px; height: 16px; }
.cs-box.open .cs-arrow { transform: rotate(180deg); }
.cs-box .cs-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.cs-box svg:not(.cs-arrow svg) { width: 16px; height: 16px; color: var(--accent-2); }
.cs-menu {
  position: absolute; z-index: 60; top: calc(100% + 5px); left: 0; right: 0;
  background: rgba(16, 24, 44, 0.96);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  max-height: 280px; overflow-y: auto; box-shadow: var(--shadow); padding: 5px;
}
.cs-opt {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 11px; cursor: pointer; font-size: 13.5px; border-radius: 8px;
}
.cs-opt:hover { background: var(--glass-hi); }
.cs-opt.sel { background: rgba(79,128,255,0.16); }
.cs-opt .cs-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.cs-opt svg { width: 16px; height: 16px; color: var(--accent-2); flex-shrink: 0; }
.cs-opt > span:nth-child(2), .cs-opt > span:first-child { flex: 1; }
.cs-chk { margin-left: auto; color: var(--green); display: flex; flex: 0 !important; }
.cs-chk svg { color: var(--green); }

/* select perso dans la sidebar (guild picker) */
.guild-picker .cs-box { padding: 10px 11px; min-height: 0; font-size: 13.5px; }
