:root{
  --bg:#0b0f14;
  --card:#111826;
  --line:#1f2a3a;
  --text:#e6edf3;
  --muted:#9fb1c7;

  --ok:#38bdf8;
  --warn:#fbbf24;
  --bad:#fb7185;

  --shadow: 0 12px 30px rgba(0,0,0,.28);
  --radius: 14px;

  --focus: rgba(56,189,248,.55);
  --focusRing: 0 0 0 4px rgba(56,189,248,.12);
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:16px;
  font-family:system-ui, Segoe UI, Arial;
  background:
    radial-gradient(900px 600px at 10% 0%, rgba(56,189,248,.08), transparent 55%),
    radial-gradient(900px 600px at 90% 0%, rgba(251,191,36,.07), transparent 60%),
    var(--bg);
  color:var(--text);
}

a{color:var(--ok);text-decoration:none}
a:hover{text-decoration:underline}

.container{max-width:1400px;margin:0 auto}

/* Headings helpers */
.h1{font-weight:900;font-size:16px}
.h2{font-weight:900;font-size:14px}

.mt8{margin-top:8px}
.mt10{margin-top:10px}
.mt12{margin-top:12px}

.top{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:stretch;
  margin-bottom:12px;
}

.header-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
}

/* Cards */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)) , var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px;
  box-shadow: var(--shadow);
}

.card .title{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.title.split{justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap;}

.brand{display:flex; gap:10px; align-items:center;}
.right{margin-left:auto}

.badge{
  padding:4px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  font-size:12px;
  color:var(--muted);
  background: rgba(0,0,0,.15);
}

.muted{color:var(--muted)}
.muted2{opacity:.75;font-size:12px}
.nowrap{white-space:nowrap}

/* KPI */
.kpi{
  display:grid;
  grid-template-columns: repeat(6, minmax(170px, 1fr));
  gap:12px;
}
@media (max-width:1200px){
  .kpi{grid-template-columns: repeat(3, minmax(170px, 1fr))}
}
@media (max-width:700px){
  .kpi{grid-template-columns: repeat(2, minmax(160px, 1fr))}
}

.kpi .item .label{
  color:var(--muted);
  font-size:12px;
  margin-bottom:6px;
  letter-spacing:.2px;
}
.kpi .item .value{
  font-size:22px;
  font-weight:750;
  line-height:1.1;
}

/* Actions row */
.actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
}

/* Buttons */
.btn{
  appearance:none;
  border:1px solid var(--line);
  border-radius:12px;
  padding:9px 12px;
  font-weight:800;
  cursor:pointer;
  color:var(--text);
  background: rgba(255,255,255,.03);
  transition: transform .04s ease, background .12s ease, border-color .12s ease, opacity .12s ease;
  display:inline-flex;
  align-items:center;
  gap:8px;
  text-decoration:none;
}
.btn:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(56,189,248,.35);
  text-decoration:none;
}
.btn:active{transform: translateY(1px)}
.btn:disabled{opacity:.6;cursor:not-allowed}

.btn-ghost{background: transparent; border-color: rgba(255,255,255,.14);}
.btn-ok{background: rgba(56,189,248,.18); border-color: rgba(56,189,248,.35);}
.btn-warn{background: rgba(251,191,36,.14); border-color: rgba(251,191,36,.35);}
.btn-bad{background: rgba(251,113,133,.14); border-color: rgba(251,113,133,.35);}

.mini{padding:6px 9px; border-radius:10px; font-size:12px; font-weight:900;}
.btn-wide{min-width:140px; justify-content:center;}

/* Inputs */
input{
  border-radius:12px;
  padding:10px 12px;
  font-size:14px;
  min-width:260px;
  background: rgba(0,0,0,.25);
  color:var(--text);
  border:1px solid var(--line);
  outline:none;
}
input:focus{
  border-color: var(--focus);
  box-shadow: var(--focusRing);
}

.search{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.06);
  color:inherit;
  outline:none;
  min-width: unset;
}

/* Table */
.table-wrap{
  overflow:auto;
  border-radius:var(--radius);
  border:1px solid rgba(255,255,255,.06);
}

table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
  min-width:980px;
}

th,td{
  padding:10px 10px;
  border-bottom:1px solid var(--line);
  font-size:13px;
  vertical-align:middle;
}

th{
  position:sticky;
  top:0;
  background: rgba(17,24,38,.95);
  backdrop-filter: blur(8px);
  text-align:left;
  color:var(--muted);
  z-index:2;
}

tbody tr:nth-child(even) td{background: rgba(255,255,255,.01);}
tr:hover td{background: rgba(255,255,255,.03);}

th.actions-col, td.actions-col{width:260px;}
td.actions-col{text-align:right;}

/* status colors */
.ok{color:var(--ok)}
.warn{color:var(--warn)}
.bad{color:var(--bad)}

/* pills */
.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:3px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  font-size:12px;
  background: rgba(0,0,0,.14);
}
.pill.ok{border-color: rgba(56,189,248,.35); color: var(--ok)}
.pill.warn{border-color: rgba(251,191,36,.35); color: var(--warn)}
.pill.bad{border-color: rgba(251,113,133,.35); color: var(--bad)}
.pill.muted{color: var(--muted)}

/* hr */
.hr{height:1px; background: var(--line); margin:10px 0; opacity:.9;}

.footer-note{font-size:12px; color:var(--muted);}

/* toast */
.toast{
  position:fixed;
  right:16px;
  bottom:16px;
  z-index:9999;
  background: rgba(0,0,0,.78);
  color:#fff;
  padding:10px 12px;
  border-radius:12px;
  max-width:420px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  display:none;
}

/* blocked page helper */
.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width:960px){
  .grid2{grid-template-columns: 1fr}
}
.rowline{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:6px 0;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.rowline:last-child{border-bottom:0;}
.left{display:flex; align-items:center; gap:10px; min-width:0;}
.acc{
  font-weight:900;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width: 320px;
}

/* login page */
.login-wrap{
  min-height: calc(100vh - 32px);
  display:flex;
  align-items:center;
  justify-content:center;
}
.login-card{width:100%; max-width:520px;}
.login-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.logo{display:flex; gap:10px; align-items:center;}
.dot{
  width:12px;height:12px;border-radius:99px;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(56,189,248,.12);
}
.field{display:flex; flex-direction:column; gap:8px; margin-top:12px;}
.field label{
  font-size:12px;
  color: var(--muted);
  font-weight:700;
  letter-spacing:.2px;
}
.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
  align-items:center;
  justify-content:space-between;
}
.row .left{display:flex; gap:10px; flex-wrap:wrap; align-items:center;}
.hint{margin-top:10px; font-size:12px; color:var(--muted); line-height:1.4;}
.error{
  margin-top:12px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(251,113,133,.35);
  background: rgba(251,113,133,.10);
  color: var(--text);
  font-size:13px;
}
input.token{
  width:100%;
  min-width:unset;
  font-size:15px;
  padding:12px 12px;
}
