:root{
  --bg0: #070b18;
  --bg1: #0b1026;
  --bg2: #0e1633;
  --line: rgba(255,255,255,.08);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.62);
  --brand1: #6d5efc;
  --brand2: #3bd3d3;
  --card: rgba(255,255,255,.04);
  --card2: rgba(255,255,255,.06);
  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --radius: 18px;
  --radius2: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 35% 20%, rgba(109,94,252,.18), transparent 60%),
    radial-gradient(900px 600px at 70% 30%, rgba(59,211,211,.10), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
}

/* Auth */
body.auth{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}
.auth-card{
  width:min(520px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:28px;
}
.brand{display:flex;align-items:center;gap:12px;margin-bottom:8px}
.brand__logo{
  width:44px;height:44px;border-radius:14px;
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
  display:flex;align-items:center;justify-content:center;
  font-weight:800;
}
.brand__title{font-weight:800;font-size:18px}
.auth-card h1{margin:14px 0 16px 0;font-size:26px}
.field{display:block;margin:12px 0}
.field span,.field label{display:block;color:var(--muted);font-size:13px;margin-bottom:6px}
.field input,.field textarea,.field select,.switcher select{
  width:100%;
  background: rgba(0,0,0,.22);
  border:1px solid var(--line);
  color: var(--text);
  padding:12px 12px;
  border-radius: 12px;
  outline:none;
}
.field textarea{resize:vertical}
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:12px 14px;border-radius: 12px;border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor:pointer;
}
.btn--primary{
  background: linear-gradient(135deg, rgba(109,94,252,.95), rgba(59,211,211,.65));
  border-color: transparent;
  font-weight:700;
}
.btn--sm{
  padding:8px 10px;
  border-radius: 10px;
  font-size: 13px;
}
.actions{display:flex;gap:8px;flex-wrap:wrap}
.field-error{margin-top:6px;font-size:13px;color: rgba(255,80,80,.95)}
.auth-links{margin-top:12px;color:var(--muted);font-size:13px}
.auth-links a{color:rgba(255,255,255,.8);text-decoration:none}
.auth-links .dot{margin:0 8px;opacity:.6}
.alert{
  padding:10px 12px;border-radius:12px;border:1px solid var(--line);
  margin-bottom:12px;
}
.alert--error{background: rgba(255,80,80,.10);border-color: rgba(255,80,80,.25)}
.alert--notice{background: rgba(109,94,252,.10);border-color: rgba(109,94,252,.25)}

/* App layout */
body.app{display:flex;min-height:100vh}
.sidebar{
  width:270px;
  padding:18px 16px;
  border-right:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
}
.main{flex:1;display:flex;flex-direction:column}
.topbar{
  height:70px;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  display:flex;align-items:center;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
}
.content{
  padding:22px;
}

.sidebar__brand{display:flex;align-items:center;gap:12px;margin-bottom:18px}
.sidebar__brand .brand__logo{
  width:44px;height:44px;border-radius:14px;background: linear-gradient(135deg, var(--brand1), var(--brand2));
}
.sidebar__title{font-weight:800;font-size:18px}
.sidebar__subtitle{color:var(--muted);font-size:12px;margin-top:2px}

.nav{display:flex;flex-direction:column;gap:4px}
.nav__section{
  margin-top:14px;margin-bottom:6px;
  color:var(--muted);font-size:12px;letter-spacing:.08em;text-transform:uppercase;
}
.nav__item{
  padding:10px 12px;border-radius: 12px;
  color:rgba(255,255,255,.86);
  text-decoration:none;
  border:1px solid transparent;
}
.nav__item:hover{background: rgba(255,255,255,.04);border-color: rgba(255,255,255,.06)}
.nav__item.is-active{background: rgba(109,94,252,.14);border-color: rgba(109,94,252,.20)}

.topbar__left{flex:1}
.topbar__crumb{color:var(--muted);font-size:14px}
.topbar__right{display:flex;align-items:center;gap:12px}
.topbar__meta{display:flex;flex-direction:column;align-items:flex-end;gap:2px}
.topbar__client{font-weight:700}
.topbar__role{color:var(--muted);font-size:12px}
.userpill{
  padding:10px 12px;border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
}
.userpill__email{font-size:13px;color:rgba(255,255,255,.88)}
.switcher select{
  max-width:260px;
  padding:10px 10px;
}

.flash{
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius: 14px;
  margin-bottom:16px;
  background: rgba(255,255,255,.03);
}
.flash--success{border-color: rgba(59,211,211,.35); background: rgba(59,211,211,.08)}
.flash--error{border-color: rgba(255,80,80,.35); background: rgba(255,80,80,.08)}
.flash--notice{border-color: rgba(109,94,252,.35); background: rgba(109,94,252,.08)}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:18px;
}
.head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:12px}
.head h1{margin:0;font-size:30px}
.muted{color:var(--muted)}
.code{
  background: rgba(0,0,0,.25);
  border:1px solid var(--line);
  border-radius: var(--radius2);
  padding:14px;
  overflow:auto;
}

.tablewrap{overflow:auto;border-radius: 14px;border:1px solid var(--line)}
.table{width:100%;border-collapse:collapse;min-width:860px}
.table th,.table td{padding:12px 12px;border-bottom:1px solid var(--line);text-align:left;font-size:14px}
.table th{color:rgba(255,255,255,.78);font-weight:700;background: rgba(255,255,255,.03)}
.table tr:hover td{background: rgba(255,255,255,.02)}
.truncate{max-width:380px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.pager{display:flex;justify-content:space-between;align-items:center;margin-top:12px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:10px}
.k{color:var(--muted);font-size:12px;margin-bottom:4px}
.v{font-weight:700}

.tabs{display:grid;grid-template-columns:1fr;gap:18px;margin-top:14px}
.tab{
  padding:14px;
  border:1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(0,0,0,.16);
}
.tab h2{margin:0 0 10px 0;font-size:18px}

.details{margin-top:12px}
details summary{cursor:pointer;color:rgba(255,255,255,.84)}

@media (max-width: 980px){
  .sidebar{display:none}
  .table{min-width:720px}
  .grid2{grid-template-columns:1fr}
}
