:root{--bg:#0b0f17;--muted:#9aa4b2;--text:#e5e7eb;--border:rgba(255,255,255,.08);--accent:#60a5fa;--danger:#ef4444;--ok:#22c55e}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:system-ui,Segoe UI,Roboto,Arial;background:var(--bg);color:var(--text)}
.container{max-width:1100px;margin:0 auto;padding:16px}
.row{display:flex;gap:12px}
.stack{display:flex;flex-direction:column;gap:10px}
.topbar{position:sticky;top:0;z-index:20;background:rgba(10,14,22,.75);backdrop-filter:blur(10px);border-bottom:1px solid var(--border)}
.brand{display:flex;gap:12px;align-items:center}
.logo{font-size:20px}
.brand-title{font-weight:800}
.nav{margin-left:auto;display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.nav a{color:var(--text);text-decoration:none;opacity:.9}
.nav a:hover{opacity:1}
.link.danger{color:#ffb4b4}
.page-head{margin:18px 0 12px}
.h1{font-size:26px;margin:0 0 6px;font-weight:900}
.h2{font-size:18px;font-weight:800;margin:0 0 6px}
.muted{color:var(--muted)}
.small{font-size:12px}
.card{background:rgba(255,255,255,.04);border:1px solid var(--border);border-radius:16px}
.card-body{padding:16px}
.btn{background:var(--accent);color:#0b1020;border:0;border-radius:12px;padding:10px 14px;font-weight:800;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}
.btn-sm{padding:7px 10px;border-radius:10px;font-size:12px}
.btn-ghost{background:transparent;color:var(--text);border:1px solid var(--border)}
.btn.danger{background:rgba(239,68,68,.22);border:1px solid rgba(239,68,68,.35);color:#fff}
.input{width:100%;padding:10px 12px;border-radius:12px;border:1px solid var(--border);background:rgba(17,24,39,.75);color:var(--text);outline:none}
label{font-size:12px;color:var(--muted);margin-bottom:6px;display:block}
.grid{display:grid;gap:12px}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
@media(max-width:900px){.grid-2{grid-template-columns:1fr}.grid-4{grid-template-columns:1fr 1fr}}
.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:10px 8px;border-bottom:1px solid var(--border);text-align:left}
.table th{font-size:12px;color:var(--muted);font-weight:900}
.right{text-align:right}
.mono{font-family:Consolas,monospace}
.kpi{font-size:34px;font-weight:1000}
.chip{padding:6px 10px;border-radius:999px;background:rgba(255,255,255,.06);border:1px solid var(--border);font-size:12px}
.pill{padding:4px 8px;border-radius:999px;border:1px solid var(--border);font-size:12px}
.filters{display:grid;grid-template-columns:2fr 1fr 1fr 1fr 1fr auto auto;gap:10px;align-items:end}
@media(max-width:1000px){.filters{grid-template-columns:1fr}}
.alert{padding:10px 12px;border-radius:14px;border:1px solid var(--border);background:rgba(255,255,255,.04)}
.alert.error{border-color:rgba(239,68,68,.35);background:rgba(239,68,68,.18)}
.alert.ok{border-color:rgba(34,197,94,.28);background:rgba(34,197,94,.14)}
.footer{padding:18px 0;color:var(--muted)}
.auth-wrap{display:flex;justify-content:center;align-items:center;min-height:65vh}
.kv{display:grid;grid-template-columns:160px 1fr;gap:8px}
@media(max-width:700px){.kv{grid-template-columns:1fr}}
.perm-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-top:10px}
@media(max-width:900px){.perm-grid{grid-template-columns:1fr}}
.perm-item{display:flex;gap:10px;align-items:center;padding:10px;border-radius:12px;border:1px solid var(--border);background:rgba(255,255,255,.03)}


/* --- Modals (Surpuls Tire) --- */
.modal{
  position:fixed; inset:0;
  display:flex; align-items:center; justify-content:center;
  background:rgba(0,0,0,.55);
  z-index:9999;
  padding:16px;
}
.modal-card{
  width:min(720px, 100%);
  background:rgba(15, 23, 42, .98);
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  padding:16px;
  box-shadow:0 18px 60px rgba(0,0,0,.45);
}
.grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
@media (max-width: 760px){
  .grid-2{grid-template-columns:1fr;}
}

/* small chips for services */
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chipbtn{border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.06);color:var(--text);padding:8px 10px;border-radius:999px;cursor:pointer}
.chipbtn:hover{border-color:rgba(96,165,250,.45)}
