:root{
  --bg:#0b1220;
  --text:#eaf2ff;
  --muted:#b7c7e6;
  --primary:#2f7dff;
  --primary2:#1a5fe0;
  --border:rgba(255,255,255,.10);
  --shadow: 0 18px 40px rgba(0,0,0,.35);
  --radius: 18px;
}

[data-theme="light"]{
  --bg:#f3f7ff;
  --text:#0b1220;
  --muted:#35527a;
  --primary:#2f7dff;
  --primary2:#1a5fe0;
  --border:rgba(11,18,32,.12);
  --shadow: 0 18px 40px rgba(11,18,32,.12);
}


*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 600px at 20% 10%, rgba(47,125,255,.28), transparent 55%),
              radial-gradient(900px 500px at 80% 0%, rgba(0,196,255,.14), transparent 55%),
              var(--bg);
  color:var(--text);
}

.page.center{min-height:100%; display:flex; align-items:center; justify-content:center; padding:24px;}
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:22px;
  backdrop-filter: blur(10px);
}
.auth-card{width:min(420px, 92vw);}
.brand{display:flex; gap:14px; align-items:center; margin-bottom:16px;}
.logo{
  width:52px; height:52px; border-radius:16px;
  display:flex; align-items:center; justify-content:center;
  font-weight:800;
  background: linear-gradient(135deg, var(--primary), #00c2ff);
  color:white;
  box-shadow: 0 12px 30px rgba(47,125,255,.35);
}
.logo.sm{width:38px;height:38px;border-radius:14px;font-size:14px}
.title{font-weight:800; font-size:18px; line-height:1.2}
.subtitle{color:var(--muted); font-size:13px}

.topbar{
  position:sticky; top:0; z-index:10;
  background: rgba(11,18,32,.65);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
.topbar-inner{
  max-width: 1200px;
  margin:0 auto;
  padding:12px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.brand-inline{display:flex; align-items:center; gap:10px;}
.topbar-actions{display:flex; align-items:center; gap:10px;}
.pill{
  border:1px solid var(--border);
  border-radius:999px;
  padding:8px 10px;
  font-size:12px;
  color:var(--muted);
}

.layout{max-width:1200px; margin:0 auto; padding:18px 16px; display:grid; grid-template-columns: 240px 1fr; gap:16px;}
.sidebar{
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
  padding:10px;
  height: fit-content;
}
.nav-item{
  display:block;
  padding:12px 12px;
  border-radius:14px;
  color:var(--text);
  text-decoration:none;
  border:1px solid transparent;
}
.nav-item:hover{background: rgba(255,255,255,.04); border-color: var(--border);}
.nav-item.active{background: rgba(47,125,255,.18); border-color: rgba(47,125,255,.35);}

.content .card{padding:18px;}
.h1{margin:0 0 6px; font-size:20px;}
.p{margin:0 0 14px; color:var(--muted);}

.card-head{display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:10px;}
.divider{height:1px; background: var(--border); margin:14px 0;}

.form{display:flex; flex-direction:column; gap:10px;}
.form.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.field{display:flex; flex-direction:column; gap:6px;}
.field.full{grid-column: 1 / -1;}
.field.actions{grid-column: 1 / -1; display:flex; gap:10px; justify-content:flex-end; align-items:center; padding-top:6px;}

.label{font-size:12px; color:var(--muted);}
.input{
  width:100%;
  padding:11px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(15,27,51,.55);
  color:var(--text);
  outline:none;
}
.input:focus{border-color: rgba(47,125,255,.6); box-shadow: 0 0 0 3px rgba(47,125,255,.18);}
.textarea{min-height:86px; resize:vertical; line-height:1.35;}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  color:var(--text);
  text-decoration:none;
  background: rgba(255,255,255,.04);
  cursor:pointer;
}
.btn:hover{background: rgba(255,255,255,.06);}
.btn.primary{
  border-color: rgba(47,125,255,.55);
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  box-shadow: 0 14px 30px rgba(47,125,255,.25);
}
.btn.primary:hover{filter:brightness(1.05);}
.btn.ghost{background: transparent;}
.btn.small{padding:8px 10px; border-radius:12px; font-size:12px;}
.right{text-align:right;}

.alert{
  border:1px solid rgba(255,140,0,.35);
  background: rgba(255,140,0,.10);
  border-radius: 16px;
  padding:12px;
  color: #ffe6c7;
  margin:12px 0;
}
.alert.ok{
  border-color: rgba(0,255,155,.25);
  background: rgba(0,255,155,.10);
  color:#d6ffef;
}
.ul{margin:8px 0 0 16px; color:inherit;}
.hint{margin-top:12px; color:var(--muted); font-size:12px;}
code{background: rgba(255,255,255,.06); padding:2px 6px; border-radius:10px; border:1px solid var(--border);}

.table-wrap{overflow:auto; border-radius: 16px; border:1px solid var(--border);}
.table{width:100%; border-collapse:separate; border-spacing:0; min-width:1100px;}
.table th, .table td{padding:10px 10px; vertical-align:top; border-bottom:1px solid var(--border);}
.table th{font-size:12px; color:var(--muted); text-align:left; background: rgba(255,255,255,.03); position:sticky; top:0;}
.table tr:hover td{background: rgba(255,255,255,.03);}
.muted{color:var(--muted); padding:14px;}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:12px; color:var(--muted);}

.date-wrap{display:flex; gap:8px; align-items:center;}
.icon-btn{
  width:42px; height:42px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
}
.icon-btn:hover{background: rgba(255,255,255,.06);}

@media (max-width: 980px){
  .layout{grid-template-columns: 1fr;}
  .form.grid{grid-template-columns:1fr;}
}


/* Light theme tweaks */
[data-theme="light"] body{
  background: radial-gradient(1200px 600px at 20% 10%, rgba(47,125,255,.20), transparent 55%),
              radial-gradient(900px 500px at 80% 0%, rgba(0,196,255,.10), transparent 55%),
              var(--bg);
}
[data-theme="light"] .topbar{
  background: rgba(243,247,255,.75);
}
[data-theme="light"] .input{
  background: rgba(255,255,255,.85);
}
[data-theme="light"] .table th{
  background: rgba(255,255,255,.65);
}



[data-theme="light"] .card{
  background: rgba(255,255,255,.82);
  border-color: rgba(11,18,32,.10);
}
[data-theme="light"] .sidebar{
  background: rgba(255,255,255,.70);
}
[data-theme="light"] .nav-item:hover{background: rgba(11,18,32,.04);}
[data-theme="light"] .nav-item.active{background: rgba(47,125,255,.12);}
[data-theme="light"] .table-wrap{background: rgba(255,255,255,.75);}
[data-theme="light"] .btn{background: rgba(11,18,32,.03);}
[data-theme="light"] .btn:hover{background: rgba(11,18,32,.05);}
[data-theme="light"] .btn.primary{color:white;}



/* Make LIGHT theme unmistakably light */
html[data-theme="light"], html[data-theme="light"] body{
  color: var(--text);
}
html[data-theme="light"] .card,
html[data-theme="light"] .sidebar,
html[data-theme="light"] .table-wrap{
  backdrop-filter: none;
}
html[data-theme="light"] .card{ background: #ffffff; }
html[data-theme="light"] .sidebar{ background: #ffffff; }
html[data-theme="light"] .topbar{ background: rgba(255,255,255,.85); }
html[data-theme="light"] .table th{ background: #f6f8ff; }
html[data-theme="light"] .table tr:hover td{ background: rgba(11,18,32,.04); }
html[data-theme="light"] .alert{ background: rgba(255,140,0,.10); }
html[data-theme="light"] .alert.ok{ background: rgba(0,255,155,.10); }

