:root {
  --shell-sidebar: 252px;
  --shell-bg: #070b14;
  --shell-surface: #0d1422;
  --shell-surface-raised: #111a2b;
  --shell-line: rgba(148, 163, 184, .14);
  --shell-accent: #6d7cff;
  --shell-accent-strong: #5264f5;
}

body.admin-modern {
  background: radial-gradient(circle at 70% -20%, rgba(82,100,245,.15), transparent 32%), var(--shell-bg);
  color: #edf2ff;
}

.admin-sidebar-shell {
  position: fixed; inset: 0 auto 0 0; z-index: 90; width: var(--shell-sidebar);
  display: flex; flex-direction: column; padding: 20px 14px;
  background: rgba(10, 15, 26, .96); border-right: 1px solid var(--shell-line);
  box-shadow: 20px 0 60px rgba(0,0,0,.18); backdrop-filter: blur(20px);
}
.sidebar-brand { display:flex; align-items:center; gap:12px; padding:4px 8px 25px; }
.sidebar-brand-mark { width:42px; height:42px; display:grid; place-items:center; border-radius:13px; color:#fff; font-size:19px; font-weight:950; background:linear-gradient(145deg,#7885ff,#4658ec); box-shadow:0 10px 26px rgba(82,100,245,.32); }
.sidebar-brand strong,.sidebar-brand span { display:block; }
.sidebar-brand strong { font-size:17px; letter-spacing:.01em; }
.sidebar-brand span { color:#73809a; font-size:11px; margin-top:2px; letter-spacing:.08em; text-transform:uppercase; }
.sidebar-section-label { padding:0 11px 9px; color:#59657b; font-size:10px; font-weight:900; letter-spacing:.13em; text-transform:uppercase; }
.sidebar-nav { display:grid; gap:5px; }
.sidebar-nav-item { display:flex; align-items:center; gap:11px; min-height:52px; padding:8px 10px; color:#93a0b8; text-decoration:none; border:1px solid transparent; border-radius:13px; transition:.16s ease; }
.sidebar-nav-item:hover { color:#e6ebff; background:rgba(255,255,255,.035); border-color:rgba(255,255,255,.06); }
.sidebar-nav-item.active { color:#fff; background:linear-gradient(100deg,rgba(82,100,245,.2),rgba(82,100,245,.08)); border-color:rgba(109,124,255,.28); box-shadow:inset 3px 0 0 #6d7cff; }
.sidebar-nav-item svg,.sidebar-logout svg,.admin-sidebar-toggle svg { width:20px; height:20px; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.sidebar-nav-item span { min-width:0; }
.sidebar-nav-item strong,.sidebar-nav-item small { display:block; }
.sidebar-nav-item strong { color:inherit; font-size:13px; }
.sidebar-nav-item small { margin-top:2px; color:#647089; font-size:10px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.sidebar-nav-item.active small { color:#929eff; }
.sidebar-context-tools { display:grid; gap:5px; margin-top:18px; padding-top:14px; border-top:1px solid var(--shell-line); }
.admin-modern .sidebar-context-button { width:100%; justify-content:flex-start; min-height:39px; padding:8px 11px; color:#8996ad; background:transparent; border:0; text-align:left; }
.admin-modern .sidebar-context-button:hover { color:#e6ebff; background:rgba(255,255,255,.04); }
.sidebar-spacer { flex:1; }
.sidebar-account { margin:14px 5px 8px; padding:12px; border:1px solid var(--shell-line); border-radius:12px; background:rgba(255,255,255,.02); overflow:hidden; }
.sidebar-account-label { display:block; color:#5f6b81; font-size:10px; margin-bottom:4px; }
.sidebar-account strong { display:block; color:#cbd4e7; font-size:12px; overflow:hidden; text-overflow:ellipsis; }
.sidebar-logout { width:100%; display:flex; align-items:center; gap:10px; padding:11px 13px; color:#8390a8; background:transparent; border:0; border-radius:11px; cursor:pointer; font-weight:800; }
.sidebar-logout:hover { color:#ff9ca8; background:rgba(239,68,68,.08); }

.admin-modern .app { width:auto; max-width:none; margin:0 0 0 var(--shell-sidebar); padding:22px 24px 48px; }
.admin-modern .events-app-wide,.admin-modern .statistics-page { width:auto; max-width:none; }
.admin-modern .topbar { min-height:66px; margin:0 0 20px; padding:0 2px 18px; border-bottom:1px solid var(--shell-line); }
.admin-modern .topbar .brand-logo { width:43px; height:43px; border-radius:13px; background:#111a2b; border:1px solid rgba(109,124,255,.25); box-shadow:none; color:#929eff; }
.admin-modern .brand h1 { font-size:23px; letter-spacing:-.02em; }
.admin-modern .brand p { margin-top:4px; color:#71809a; font-size:12px; }
.admin-modern .topbar-actions .link-btn,.admin-modern .topbar-actions > a { display:none !important; }
.admin-modern .topbar-actions #logoutBtn { display:none !important; }
.admin-modern .current-user { color:#8996ad; }
.admin-modern .card,.admin-modern .stat-card { background:var(--shell-surface); border:1px solid var(--shell-line); box-shadow:0 12px 40px rgba(0,0,0,.15); backdrop-filter:none; }
.admin-modern .card { border-radius:16px; padding:18px; margin-bottom:16px; }
.admin-modern .stat-card { position:relative; overflow:hidden; border-radius:14px; padding:17px; }
.admin-modern .stat-card::after { content:""; position:absolute; width:70px; height:70px; right:-25px; top:-28px; border-radius:50%; background:rgba(109,124,255,.12); }
.admin-modern .stat-label { color:#748199; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.admin-modern .stat-card strong { font-size:27px; }
.admin-modern .toolbar-main { align-items:center; padding-bottom:15px; border-bottom:1px solid rgba(148,163,184,.09); }
.admin-modern .toolbar-main h2 { font-size:17px; }
.admin-modern .toolbar-main p { color:#71809a; font-size:12px; line-height:1.45; }
.admin-modern .btn { min-height:38px; padding:9px 13px; border-radius:10px; font-size:12px; letter-spacing:.005em; box-shadow:none; }
.admin-modern .btn:hover { transform:none; filter:brightness(1.08); }
.admin-modern .btn-primary { background:var(--shell-accent-strong); }
.admin-modern .btn-secondary { background:#1b2639; border-color:rgba(148,163,184,.14); color:#dce4f4; }
.admin-modern .btn-ghost { border-color:rgba(148,163,184,.2); color:#aab6ca; }
.admin-modern .btn-danger { background:rgba(220,38,38,.13); border-color:rgba(248,113,113,.25); color:#ff9ca8; }
.admin-modern input,.admin-modern textarea,.admin-modern select { min-height:40px; padding:9px 11px; border-color:rgba(148,163,184,.2); border-radius:10px; background:#090f1b; }
.admin-modern input:focus,.admin-modern textarea:focus,.admin-modern select:focus { border-color:#6979ff; box-shadow:0 0 0 3px rgba(105,121,255,.12); }
.admin-modern .field span { color:#8d9ab0; font-size:11px; letter-spacing:.02em; }
.admin-modern .filters { padding:13px; border:1px solid rgba(148,163,184,.1); border-radius:12px; background:rgba(5,9,16,.35); }
.admin-modern .player-card,.admin-modern .character-card,.admin-modern .event-list-item,.admin-modern .event-column,.admin-modern .party-card { border-color:rgba(148,163,184,.13); background:#0a111e; }
.admin-modern .event-list-item.active { border-color:rgba(109,124,255,.5); background:rgba(82,100,245,.12); box-shadow:inset 3px 0 0 #6d7cff; }
.admin-modern .table-wrap,.admin-modern .activity-table-wrap { border-color:var(--shell-line); border-radius:12px; }
.admin-modern .data-table th,.admin-modern .table th,.admin-modern .activity-table thead th { background:#131d2e; color:#aebaf8; }

.event-action-groups { display:flex; align-items:stretch; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.event-action-group { display:flex; align-items:center; gap:5px; padding:5px; border:1px solid rgba(148,163,184,.12); border-radius:11px; background:rgba(4,8,15,.35); }
.event-action-group-label { padding:0 5px; color:#637089; font-size:9px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
.admin-modern .events-sidebar-head { padding-bottom:12px; border-bottom:1px solid var(--shell-line); }
.admin-modern .events-sidebar-actions { grid-template-columns:1fr !important; }
.admin-modern .events-sidebar-actions .btn { justify-content:flex-start; }
.admin-modern .events-sidebar { top:18px; }
.admin-modern .event-danger-bottom-actions { background:rgba(60,10,18,.18); }
.recognize-help,.recognize-summary,.recognized-unmatched { padding:11px 12px; border:1px solid rgba(109,124,255,.2); border-radius:10px; background:rgba(82,100,245,.07); color:#aeb9cf; font-size:12px; line-height:1.45; }
.recognize-summary { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.recognize-summary strong { color:#eef2ff; }
.recognized-player-list { display:grid; gap:6px; max-height:430px; overflow:auto; }
.recognized-player-row { display:grid; grid-template-columns:20px minmax(150px,1fr) minmax(150px,1fr); align-items:center; gap:10px; padding:9px 10px; border:1px solid rgba(148,163,184,.13); border-radius:10px; background:#090f1b; cursor:pointer; }
.recognized-player-row.recognized-player-uncertain { border-color:rgba(245,158,11,.42); background:rgba(245,158,11,.08); }
.recognized-player-row.recognized-player-uncertain .recognized-player-source { color:#fbbf24; }
.recognized-player-row input { min-height:0; }
.recognized-player-main strong,.recognized-player-main small { display:block; }
.recognized-player-main small,.recognized-player-source { margin-top:2px; color:#76839a; font-size:10px; }
.recognized-player-source { text-align:right; overflow-wrap:anywhere; }
.recognized-unmatched { border-color:rgba(245,158,11,.25); background:rgba(245,158,11,.06); color:#d7b77a; }
.admin-modern .events-layout,.admin-modern .events-layout-compact { grid-template-columns:220px minmax(0,1fr) !important; min-width:0 !important; }
.admin-modern .event-board,.admin-modern .event-board-roster,.admin-modern .event-board-five { grid-template-columns:minmax(0,1fr) !important; min-width:0 !important; }

.admin-tooltip { position:fixed; z-index:1000; max-width:260px; pointer-events:none; opacity:0; transform:translateY(3px); padding:8px 10px; border:1px solid rgba(148,163,184,.25); border-radius:8px; color:#eef2ff; background:#182133; box-shadow:0 12px 32px rgba(0,0,0,.38); font-size:11px; line-height:1.35; transition:opacity .1s,transform .1s; }
.admin-tooltip.visible { opacity:1; transform:none; }
.admin-sidebar-toggle { display:none; position:fixed; z-index:95; top:13px; left:13px; width:42px; height:42px; place-items:center; border:1px solid var(--shell-line); border-radius:12px; color:#e6ebff; background:#111a2b; box-shadow:0 8px 24px rgba(0,0,0,.3); }
.admin-sidebar-backdrop { display:none; position:fixed; inset:0; z-index:85; background:rgba(1,4,10,.66); backdrop-filter:blur(3px); }
.admin-login-mode .admin-sidebar-shell,.admin-login-mode .admin-sidebar-toggle { display:none !important; }
.admin-login-mode .app { margin-left:0; }

@media (max-width: 1100px) {
  :root { --shell-sidebar: 218px; }
  .admin-modern .app { padding-left:16px; padding-right:16px; }
  .sidebar-nav-item small { display:none; }
  .event-action-groups { justify-content:flex-start; }
}
@media (max-width: 820px) {
  .admin-sidebar-shell { width:252px; transform:translateX(-102%); transition:transform .2s ease; }
  .sidebar-open .admin-sidebar-shell { transform:none; }
  .admin-sidebar-toggle { display:grid; }
  .sidebar-open .admin-sidebar-backdrop { display:block; }
  .admin-modern .app { margin-left:0; padding:13px 10px 35px; }
  .admin-modern .topbar { padding-left:54px; min-height:44px; }
  .admin-modern .brand .brand-logo { display:none; }
  .admin-modern .brand h1 { font-size:19px; }
  .admin-modern .brand p { font-size:11px; }
  .admin-modern .topbar-actions { display:none; }
  .admin-modern .card { padding:13px; }
  .admin-modern .toolbar-main { align-items:stretch; }
  .event-action-groups,.event-action-group { width:100%; }
  .event-action-group { display:grid; grid-template-columns:1fr; }
  .event-action-group-label { padding:4px 5px 1px; }
  .admin-modern .event-action-group .btn { width:100%; }
  .recognized-player-row { grid-template-columns:20px 1fr; }
  .recognized-player-source { grid-column:2; text-align:left; }
}
