:root{
  --bg:#0b1220;
  --card:#121a2b;
  --card2:#0e1630;
  --text:#e9eefc;
  --muted:#b9c6e8;
  --line:#263055;
  --line2:#2a3553;
  --primary:#4f7cff;
  --danger:#ff4f6a;
  --shadow: 0 10px 30px rgba(0,0,0,.25);
  --radius:14px;
}
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}
.bg{
  position:fixed; inset:0;
  background:
    radial-gradient(900px 500px at 10% 10%, rgba(79,124,255,.18), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(255,79,106,.12), transparent 60%),
    radial-gradient(900px 600px at 50% 100%, rgba(79,124,255,.10), transparent 60%);
  pointer-events:none; z-index:-1;
}
.container{ width:min(1150px, calc(100% - 32px)); margin:0 auto; }
.topbar{
  position:sticky; top:0;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,.75);
  border-bottom:1px solid rgba(38,48,85,.6);
  z-index:50;
}
.topbar-inner{ display:flex; align-items:center; justify-content:space-between; padding:14px 0; gap:14px; }
.brand{ display:flex; align-items:center; gap:12px; }
.logo{
  width:40px; height:40px; border-radius:12px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(79,124,255,.95), rgba(79,124,255,.55));
  box-shadow: 0 8px 20px rgba(79,124,255,.25);
  font-weight:800;
}
.brand-title{ font-weight:800; }
.brand-sub{ color:var(--muted); font-size:12px; margin-top:2px; }
.topbar-right{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.chip{
  border:1px solid rgba(42,53,83,.9);
  background: rgba(18,26,43,.6);
  padding:8px 10px;
  border-radius:999px;
  color:var(--muted);
  font-size:13px;
}
main.container{ padding:18px 0 40px; }
.toast-wrap{ display:flex; flex-direction:column; gap:10px; margin:16px 0; }
.toast{ border:1px solid var(--line2); background: rgba(14,22,48,.85); padding:12px 14px; border-radius:12px; }
.toast-ok{ border-color: rgba(79,124,255,.4); }
.toast-error{ border-color: rgba(255,79,106,.45); }
.h1{ font-size:28px; margin:0; }
.h2{ font-size:18px; margin:0; }
.muted{ color:var(--muted); }
.help{ color:var(--muted); font-size:12px; margin-top:6px; }
.strong{ font-weight:700; }
.right{ text-align:right; }
code{
  background: rgba(14,22,48,.8);
  border:1px solid rgba(42,53,83,.9);
  padding:2px 6px;
  border-radius:8px;
  color:#d6e0ff;
}
.center{ min-height: calc(100vh - 80px); display:grid; place-items:center; padding:18px 0; }
.grid{ display:grid; grid-template-columns: 1fr; gap:16px; }
@media (min-width: 980px){ .grid{ grid-template-columns: 420px 1fr; align-items:start; } }
.card{
  background: rgba(18,26,43,.9);
  border:1px solid rgba(38,48,85,.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}
.card-lg{ width:min(440px, 100%); }
.card-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:12px; }
.card-head-split{ align-items:center; gap:14px; }
.form{ display:flex; flex-direction:column; gap:12px; }
.field{ display:flex; flex-direction:column; gap:8px; }
.label{ font-size:13px; color:var(--muted); }
.row{ display:grid; grid-template-columns: 1fr; gap:12px; }
@media (min-width: 680px){ .row{ grid-template-columns: 1fr 1fr; } }
.input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(42,53,83,.95);
  background: rgba(14,22,48,.85);
  color: var(--text);
  outline:none;
}
.input:focus{ border-color: rgba(79,124,255,.7); box-shadow: 0 0 0 3px rgba(79,124,255,.15); }
.actions{ display:flex; justify-content:flex-end; }
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:10px 12px; border-radius:12px;
  border:1px solid transparent; cursor:pointer; text-decoration:none;
  font-weight:700; font-size:14px; user-select:none;
}
.btn-full{ width:100%; }
.btn-primary{
  background: linear-gradient(135deg, rgba(79,124,255,1), rgba(79,124,255,.75));
  color:white; box-shadow: 0 12px 24px rgba(79,124,255,.18);
}
.btn-primary:hover{ filter: brightness(1.03); }
.btn-ghost{
  background: rgba(14,22,48,.7);
  border-color: rgba(42,53,83,.95);
  color: var(--text);
}
.btn-ghost:hover{ border-color: rgba(79,124,255,.55); }
.btn-danger{
  background: rgba(255,79,106,.15);
  border-color: rgba(255,79,106,.45);
  color: #ffd6dd;
}
.btn-danger:hover{ background: rgba(255,79,106,.20); }
.btn.disabled{ opacity:.55; cursor:not-allowed; pointer-events:none; }
.table-wrap{ overflow:auto; border-radius:12px; border:1px solid rgba(38,48,85,.75); }
.table{
  width:100%;
  border-collapse: collapse;
  min-width: 920px;
  background: rgba(14,22,48,.35);
}
.table thead th{
  text-align:left; font-size:12px; color: var(--muted);
  padding:12px; border-bottom:1px solid rgba(38,48,85,.75);
}
.table tbody td{
  padding:12px; border-bottom:1px solid rgba(38,48,85,.55); vertical-align:middle;
}
.linkcell{ word-break: break-all; }
.btnrow{ display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.inline{ display:inline; margin:0; }
.pager{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 4px 0; flex-wrap:wrap; }
.pager-right{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.dots{ color:var(--muted); padding:0 6px; }

/* truncate */
.truncate{
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* thumbnails */
.thumb{
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(38,48,85,.75);
  background: rgba(14,22,48,.55);
}
