:root{
  --bg: #0b1020;
  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.09);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --stroke: rgba(255,255,255,.12);
  --accent: #6ee7ff;
  --accent2:#a78bfa;
  --danger:#ff6b6b;
  --ok:#4ade80;
  --shadow: 0 20px 60px rgba(0,0,0,.45);
  --radius: 18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(110,231,255,.18), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(167,139,250,.18), transparent 55%),
    radial-gradient(700px 500px at 50% 110%, rgba(74,222,128,.10), transparent 55%),
    var(--bg);
  color:var(--text);
}

a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}

.hidden{display:none !important}

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 22px;
  background: rgba(11,16,32,.62);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke);
}
.brand__title{font-weight:800; font-size:18px; letter-spacing:.2px}
.brand__subtitle{font-size:12px; color:var(--muted); margin-top:2px}
.topbar__right{display:flex; align-items:center; gap:10px}
.user-badge{
  padding:8px 12px;
  background: linear-gradient(135deg, rgba(110,231,255,.16), rgba(167,139,250,.14));
  border:1px solid var(--stroke);
  border-radius:999px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  font-size:13px;
}

/* Auth toggle chips */
.authswitch{display:flex;gap:10px;justify-content:center;margin:4px 0 14px;}
.chip{border:1px solid var(--stroke);background:rgba(255,255,255,.04);color:var(--text);padding:8px 12px;border-radius:999px;cursor:pointer;font-weight:700;}
.chip.active{background:rgba(255,255,255,.10);border-color:rgba(255,255,255,.22);}

/* Profile key-value blocks */
.kv{display:flex;flex-direction:column;gap:10px;}
.kv__row{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid rgba(255,255,255,.10);border-radius:12px;background:rgba(255,255,255,.03);}
.divider{height:1px;background:rgba(255,255,255,.10);margin:14px 0;}

.container{max-width:1100px; margin:24px auto; padding:0 16px}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.05));
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card__subcard{
  margin: 0 18px 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.10);
}
.card__header{padding:18px 18px 8px}
.card__header.row{display:flex; align-items:flex-end; justify-content:space-between; gap:16px}
.rowgap{display:flex; align-items:center; gap:10px}
.card__header h1{margin:0; font-size:20px}
.card__header p{margin:6px 0 0; color:var(--muted); font-size:13px}

.panel{
  background: rgba(255,255,255,.05);
  border:1px solid var(--stroke);
  border-radius: 14px;
  padding:16px;
}
.panel h2{margin:0 0 12px; font-size:16px}

.muted{color:var(--muted)}
.msg{margin-top:10px; font-size:13px; color:var(--muted)}
.msg.ok{color:var(--ok)}
.msg.err{color:var(--danger)}

.tabs{
  display:flex; gap:10px; flex-wrap:wrap;
  margin-bottom:12px;
}
.tab{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding:10px 12px;
  border-radius: 999px;
  cursor:pointer;
  transition: .15s ease;
}
.tab:hover{transform: translateY(-1px); background: rgba(255,255,255,.06)}
.tab.active{
  background: linear-gradient(135deg, rgba(110,231,255,.18), rgba(167,139,250,.16));
  border-color: rgba(110,231,255,.28);
}

.tabpane{display:none}
.tabpane.active{display:block}

.field{display:flex; flex-direction:column; gap:6px; margin-bottom:12px}
.field span{font-size:12px; color:var(--muted)}
input, select{
  width:100%;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  color:var(--text);
  outline:none;
}
input:focus, select:focus{border-color: rgba(110,231,255,.45); box-shadow: 0 0 0 3px rgba(110,231,255,.12)}

.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:12px}
.grid2-span{grid-column: 1 / -1}

.btn{
  padding:10px 14px;
  border-radius: 12px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
  transition:.15s ease;
}
.btn:hover{transform: translateY(-1px); background: rgba(255,255,255,.08)}
.btn--primary{
  background: linear-gradient(135deg, rgba(110,231,255,.22), rgba(167,139,250,.20));
  border-color: rgba(110,231,255,.30);
}
.btn--ghost{background: transparent}
.btn--danger{border-color: rgba(255,107,107,.35); color: rgba(255,235,235,.95)}
.btn--danger:hover{background: rgba(255,107,107,.10)}

.tablewrap{overflow:auto; border-top:1px solid var(--stroke)}
.table{
  width:100%;
  border-collapse: collapse;
  min-width: 720px;
}
.table th, .table td{
  text-align:left;
  padding:12px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
  vertical-align:middle;
  font-size:13px;
}
.table th{color:rgba(255,255,255,.75); font-weight:700; font-size:12px; letter-spacing:.2px}
.table tbody tr:hover{background: rgba(255,255,255,.04)}

.actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 18px 18px;
}
.pill{
  display:flex; gap:18px; flex-wrap:wrap;
  padding:10px 12px;
  border-radius: 999px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.14);
}

.search{min-width: 240px}

.modal{
  position:fixed; inset:0; z-index:100;
  display:flex; align-items:center; justify-content:center;
}
.modal__backdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
}
.modal__card{
  position:relative;
  width:min(520px, 94vw);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.05));
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal__card--wide{width:min(900px, 94vw)}
.modal__header{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid var(--stroke);
}
.modal__header h2{margin:0; font-size:16px}
.iconbtn{
  width:34px; height:34px;
  border-radius: 12px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  cursor:pointer;
  color:var(--text);
}
.modal__body{padding:16px}
.modal__actions{display:flex; gap:10px; justify-content:flex-end; margin-top:10px}

.pre{
  white-space: pre-wrap;
  background: rgba(0,0,0,.18);
  border:1px solid var(--stroke);
  border-radius: 14px;
  padding:14px;
  font-family: var(--mono);
  font-size:12px;
}

.footer{
  max-width:1100px;
  margin: 0 auto 26px;
  padding: 10px 16px 0;
  display:flex;
  justify-content:space-between;
  gap:16px;
  font-size:12px;
  color:var(--muted);
}
@media (max-width: 820px){
  .grid2{grid-template-columns:1fr}
  .footer{flex-direction:column}
  .table{min-width: 860px}
}

/* Dark theme form controls (Windows/Chromium selects can be hard to read) */
:root{ color-scheme: dark; }
select, option, input, textarea{
  background-color:#151821;
  color:#e8eaf0;
  border:1px solid rgba(255,255,255,0.12);
}
select:focus, input:focus, textarea:focus{
  outline:none;
  border-color:rgba(255,255,255,0.28);
  box-shadow:0 0 0 3px rgba(255,255,255,0.08);
}
select option{
  background-color:#151821;
  color:#e8eaf0;
}
