@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700&display=swap');
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:#06060e; --panel:rgba(255,255,255,0.04); --line:rgba(255,255,255,0.08); --line2:rgba(255,255,255,0.14);
  --acc:#4d9fff; --acc2:#7c4dff; --red:#e63946; --green:#4ade80; --amber:#fbbf24;
  --text:#e6e6f5; --muted:#7a7a98; --dim:#4a4a68;
}
body { font-family:'Inter',system-ui,sans-serif; background:var(--bg); color:var(--text); min-height:100vh; }
.app-bg, .auth-bg { position:fixed; inset:0; z-index:-2;
  background:radial-gradient(900px 500px at 15% -10%, rgba(77,159,255,0.12), transparent 60%),
             radial-gradient(800px 500px at 100% 0%, rgba(124,77,255,0.1), transparent 55%), #06060e; }
.glass { background:linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border:1px solid var(--line); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); }
::-webkit-scrollbar{width:6px;height:6px} ::-webkit-scrollbar-thumb{background:#222238;border-radius:3px}

/* ── Auth ── */
.auth-body { display:flex; align-items:center; justify-content:center; padding:20px; }
.auth-card { width:100%; max-width:400px; border-radius:20px; padding:40px 34px; }
.auth-logo { font-family:'Space Grotesk'; font-size:26px; font-weight:700; letter-spacing:-0.02em; margin-bottom:6px; }
.auth-logo span { color:var(--acc); font-weight:800; margin-left:6px; font-size:14px; letter-spacing:0.15em; }
.auth-sub { color:var(--muted); font-size:13.5px; margin-bottom:26px; }
.auth-form { display:flex; flex-direction:column; gap:14px; }
.field { display:flex; flex-direction:column; gap:6px; }
.field label { font-size:12px; color:var(--muted); font-weight:500; }
.field input, .frow input, .frow select, .search {
  background:rgba(0,0,0,0.3); border:1px solid var(--line); border-radius:10px; padding:11px 13px;
  color:var(--text); font-size:14px; outline:none; font-family:inherit; transition:border-color .2s; }
.field input:focus { border-color:var(--acc); }
.remember { font-size:12.5px; color:var(--muted); display:flex; align-items:center; gap:7px; cursor:pointer; }
.btn-primary { background:linear-gradient(135deg,var(--acc),var(--acc2)); color:#fff; border:none; padding:12px;
  border-radius:10px; font-size:14px; font-weight:700; cursor:pointer; transition:transform .15s, box-shadow .2s; }
.btn-primary:hover { transform:translateY(-1px); box-shadow:0 12px 30px rgba(77,159,255,0.3); }
.btn-ghost { background:rgba(255,255,255,0.05); border:1px solid var(--line); color:var(--muted); padding:9px;
  border-radius:9px; font-size:13px; cursor:pointer; width:100%; transition:all .2s; font-family:inherit; }
.btn-ghost:hover { color:#fff; border-color:var(--line2); }
.auth-err { color:#ff6b75; font-size:12.5px; min-height:16px; }
.auth-switch { font-size:12.5px; color:var(--muted); text-align:center; }
.auth-switch a { color:var(--acc); text-decoration:none; }

/* ── Layout ── */
.layout { display:flex; min-height:100vh; }
.sidebar { width:240px; flex-shrink:0; display:flex; flex-direction:column; padding:22px 16px; border-radius:0; border-left:none; border-top:none; border-bottom:none; position:sticky; top:0; height:100vh; }
.side-logo { font-family:'Space Grotesk'; font-size:20px; font-weight:700; padding:0 8px 22px; }
.side-logo span { color:var(--acc); font-size:11px; font-weight:800; letter-spacing:0.16em; margin-left:6px; }
.side-nav { display:flex; flex-direction:column; gap:3px; flex:1; }
.nav-link { display:flex; align-items:center; gap:11px; padding:11px 13px; border-radius:10px; color:var(--muted);
  font-size:14px; font-weight:500; cursor:pointer; transition:all .15s; }
.nav-link .ni { width:18px; text-align:center; font-size:14px; }
.nav-link:hover { background:rgba(255,255,255,0.04); color:var(--text); }
.nav-link.active { background:linear-gradient(135deg,rgba(77,159,255,0.18),rgba(124,77,255,0.1)); color:#fff; border:1px solid rgba(77,159,255,0.25); }
.side-foot { border-top:1px solid var(--line); padding-top:16px; display:flex; flex-direction:column; gap:12px; }
.side-user { display:flex; align-items:center; gap:10px; }
.side-avatar { width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg,var(--acc),var(--acc2));
  display:flex; align-items:center; justify-content:center; font-weight:800; font-size:14px; color:#fff; }
.side-name { font-size:13.5px; font-weight:600; } .side-role { font-size:11px; color:var(--muted); text-transform:capitalize; }

.main { flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar { height:64px; display:flex; align-items:center; justify-content:space-between; padding:0 28px; border-radius:0; border-left:none; border-right:none; border-top:none; position:sticky; top:0; z-index:50; }
.topbar h1 { font-family:'Space Grotesk'; font-size:20px; font-weight:700; }
.top-actions { display:flex; align-items:center; gap:14px; }
.search { width:260px; padding:9px 14px; }
.status-pill { display:flex; align-items:center; gap:7px; font-size:12.5px; color:var(--green);
  background:rgba(74,222,128,0.08); border:1px solid rgba(74,222,128,0.25); padding:6px 14px; border-radius:999px; }
.status-pill .dot { width:7px; height:7px; border-radius:50%; background:var(--green); animation:pulse 2s infinite; }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(74,222,128,0.5)} 50%{box-shadow:0 0 0 5px rgba(74,222,128,0)} }

.content { padding:28px; flex:1; }

/* ── Stat cards ── */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:16px; margin-bottom:24px; }
.stat-card { border-radius:16px; padding:22px; border:1px solid var(--line); background:var(--panel); transition:transform .2s,border-color .2s; }
.stat-card:hover { transform:translateY(-3px); border-color:var(--line2); }
.stat-ic { font-size:18px; opacity:.7; margin-bottom:12px; }
.stat-val { font-family:'Space Grotesk'; font-size:34px; font-weight:700; line-height:1; letter-spacing:-0.02em; }
.stat-label { font-size:12.5px; color:var(--muted); margin-top:7px; text-transform:uppercase; letter-spacing:0.05em; }

/* ── Panels / tables ── */
.panel { border-radius:16px; border:1px solid var(--line); background:var(--panel); overflow:hidden; margin-bottom:20px; }
.panel-head { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--line); }
.panel-head h2 { font-size:15px; font-weight:700; }
.panel-body { padding:6px 0; }
.toolbar { display:flex; gap:10px; padding:14px 20px; flex-wrap:wrap; align-items:center; }
.toolbar select, .toolbar input { background:rgba(0,0,0,0.3); border:1px solid var(--line); border-radius:9px; padding:8px 12px; color:var(--text); font-size:13px; outline:none; font-family:inherit; }
.btn-sm { background:rgba(77,159,255,0.14); border:1px solid rgba(77,159,255,0.3); color:var(--acc); padding:8px 14px; border-radius:9px; font-size:13px; font-weight:600; cursor:pointer; transition:all .15s; font-family:inherit; }
.btn-sm:hover { background:rgba(77,159,255,0.24); }
.btn-sm.green { background:rgba(74,222,128,0.12); border-color:rgba(74,222,128,0.3); color:var(--green); }
.btn-sm.red { background:rgba(230,57,70,0.12); border-color:rgba(230,57,70,0.3); color:#ff6b75; }

table { width:100%; border-collapse:collapse; font-size:13px; }
thead th { text-align:left; padding:12px 20px; color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:0.05em; font-weight:600; border-bottom:1px solid var(--line); }
tbody td { padding:13px 20px; border-bottom:1px solid rgba(255,255,255,0.04); }
tbody tr:hover { background:rgba(255,255,255,0.02); }
.mono { font-family:'Space Grotesk',monospace; font-size:12.5px; }
.badge { font-size:10.5px; font-weight:700; padding:3px 9px; border-radius:6px; text-transform:uppercase; letter-spacing:0.04em; }
.b-active{background:rgba(74,222,128,0.12);color:var(--green);border:1px solid rgba(74,222,128,0.25)}
.b-unused{background:rgba(122,122,152,0.12);color:var(--muted);border:1px solid var(--line)}
.b-suspended{background:rgba(251,191,36,0.12);color:var(--amber);border:1px solid rgba(251,191,36,0.25)}
.b-expired{background:rgba(230,57,70,0.12);color:#ff6b75;border:1px solid rgba(230,57,70,0.25)}
.b-gp{background:rgba(77,159,255,0.12);color:var(--acc);border:1px solid rgba(77,159,255,0.25)}
.b-bfx{background:rgba(230,57,70,0.12);color:#ff6b75;border:1px solid rgba(230,57,70,0.25)}
.b-both{background:rgba(124,77,255,0.12);color:#a78bff;border:1px solid rgba(124,77,255,0.25)}
.row-actions { display:flex; gap:6px; flex-wrap:wrap; }
.ico-btn { background:rgba(255,255,255,0.05); border:1px solid var(--line); color:var(--muted); width:28px; height:28px; border-radius:7px; cursor:pointer; font-size:12px; transition:all .15s; }
.ico-btn:hover { color:#fff; border-color:var(--line2); }

/* ── Bars chart ── */
.bars { display:flex; align-items:flex-end; gap:6px; height:160px; padding:20px; }
.bar { flex:1; background:linear-gradient(180deg,var(--acc),rgba(77,159,255,0.2)); border-radius:5px 5px 0 0; min-height:3px; position:relative; transition:height .4s; }
.bar span { position:absolute; bottom:-20px; left:0; right:0; text-align:center; font-size:9px; color:var(--dim); }

/* ── Skeletons ── */
.skeleton-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.skel { height:110px; border-radius:16px; background:linear-gradient(90deg,rgba(255,255,255,0.03),rgba(255,255,255,0.07),rgba(255,255,255,0.03)); background-size:200% 100%; animation:shim 1.4s infinite; }
@keyframes shim { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Activity feed ── */
.feed { display:flex; flex-direction:column; }
.feed-item { display:flex; align-items:center; gap:12px; padding:12px 20px; border-bottom:1px solid rgba(255,255,255,0.04); font-size:13px; }
.feed-dot { width:8px; height:8px; border-radius:50%; background:var(--acc); flex-shrink:0; }
.feed-time { margin-left:auto; color:var(--dim); font-size:11px; }

/* ── Modal ── */
.modal { position:fixed; inset:0; background:rgba(0,0,0,0.7); backdrop-filter:blur(6px); display:none; align-items:center; justify-content:center; z-index:200; padding:20px; }
.modal.open { display:flex; }
.modal-box { width:100%; max-width:440px; border-radius:18px; overflow:hidden; }
.modal-head { display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--line); }
.modal-head h3 { font-size:16px; font-weight:700; }
.x { background:none; border:none; color:var(--muted); font-size:16px; cursor:pointer; }
.modal-body { padding:20px 22px; display:flex; flex-direction:column; gap:12px; }
.frow { display:flex; flex-direction:column; gap:6px; }
.frow label { font-size:12px; color:var(--muted); }
.frow.toggles { flex-direction:row; gap:20px; }
.frow.toggles label { flex-direction:row; align-items:center; gap:7px; color:var(--text); font-size:13px; cursor:pointer; }
.gen-out { background:rgba(0,0,0,0.4); border:1px solid var(--line); border-radius:10px; padding:14px; font-family:'Space Grotesk',monospace; font-size:12px; color:var(--green); max-height:220px; overflow:auto; white-space:pre-wrap; word-break:break-all; }

.settings-card { max-width:560px; }
.kv { display:flex; justify-content:space-between; padding:14px 20px; border-bottom:1px solid rgba(255,255,255,0.04); font-size:13.5px; }
.kv span:first-child { color:var(--muted); }
.empty { padding:50px; text-align:center; color:var(--dim); font-size:14px; }

@media (max-width:880px){
  .sidebar{ position:fixed; left:-260px; z-index:300; transition:left .2s; } .sidebar.open{ left:0; }
  .skeleton-grid{ grid-template-columns:1fr 1fr; }
}

/* ── Toasts ── */
#toastHost { position:fixed; bottom:24px; right:24px; z-index:500; display:flex; flex-direction:column; gap:10px; }
.toast { background:rgba(15,15,28,0.96); border:1px solid var(--line2); border-radius:11px; padding:12px 18px;
  font-size:13px; color:var(--text); transform:translateX(120%); opacity:0; transition:all .3s cubic-bezier(.34,1.56,.64,1);
  backdrop-filter:blur(12px); max-width:320px; box-shadow:0 12px 30px rgba(0,0,0,0.4); }
.toast.show { transform:translateX(0); opacity:1; }
.toast.t-ok { border-left:3px solid var(--green); }
.toast.t-err { border-left:3px solid var(--red); }

/* ── Context / action menu ── */
.ctxmenu { position:fixed; z-index:9000; width:210px; border-radius:12px; padding:6px; overflow:hidden; box-shadow:0 16px 40px rgba(0,0,0,0.5); background:#0e1521 !important; border:1px solid var(--line); }
.ctx-item { padding:9px 12px; font-size:13px; border-radius:8px; cursor:pointer; color:var(--text); transition:background .12s; white-space:nowrap; }
.ctx-item:hover { background:rgba(77,159,255,0.14); }
.ctx-sep { height:1px; background:var(--line); margin:5px 4px; }

/* ── Bulk bar ── */
.bulkbar { display:flex; align-items:center; gap:10px; padding:12px 20px; background:rgba(77,159,255,0.06); border-top:1px solid var(--line); border-bottom:1px solid var(--line); font-size:13px; flex-wrap:wrap; }
.bulkbar span { color:var(--muted); margin-right:6px; }

/* clickable cells */
.cclick { cursor:pointer; } .cclick:hover { color:var(--acc); }
.ownerlink { cursor:pointer; color:var(--acc); } .ownerlink:hover { text-decoration:underline; }

/* online dot already in status pill; smaller table tweaks */
tbody td { white-space:nowrap; }
h4 { font-weight:700; letter-spacing:0.04em; text-transform:uppercase; }

/* ── Upload dropzone ── */
.dropzone { border:1.5px dashed var(--line2); border-radius:12px; padding:26px 18px; text-align:center;
  cursor:pointer; transition:all .18s; background:rgba(255,255,255,0.02); }
.dropzone:hover { border-color:var(--acc); background:rgba(77,159,255,0.05); }
.dropzone.drag { border-color:var(--acc); background:rgba(77,159,255,0.1); transform:scale(1.01); }
.dropzone.has-file { border-style:solid; border-color:rgba(74,222,128,0.4); background:rgba(74,222,128,0.05); }
.dz-icon { font-size:26px; margin-bottom:8px; }
.dz-text { font-size:13.5px; color:var(--text); }
.dz-sub { font-size:11.5px; color:var(--dim); margin-top:4px; }

/* ── Overview quick-issue buttons ── */
.quick-grid { display:flex; flex-wrap:wrap; gap:10px; padding:16px 20px; }
.qgen { display:flex; align-items:center; gap:6px; padding:13px 20px; border-radius:11px; cursor:pointer;
  font-size:13.5px; font-weight:600; font-family:inherit; color:var(--text);
  background:rgba(255,255,255,0.04); border:1px solid var(--line); transition:all .15s; }
.qgen b { font-family:'Space Grotesk',sans-serif; }
.qgen:hover { transform:translateY(-2px); border-color:var(--line2); }
.qgen.gp   { box-shadow:inset 3px 0 0 var(--acc); }
.qgen.gp b { color:var(--acc); }
.qgen.bfx  { box-shadow:inset 3px 0 0 var(--red); }
.qgen.bfx b{ color:#ff6b75; }
.qgen.both { box-shadow:inset 3px 0 0 var(--acc2); }
.qgen.both b{ color:#a78bff; }

/* keyboard hint chips */
.kbd { font-family:'Space Grotesk',monospace; font-size:10px; background:rgba(255,255,255,0.06); border:1px solid var(--line); border-radius:4px; padding:1px 5px; color:var(--muted); }
