:root{
  --bg:#0b1220;
  --panel:#0f1a30;
  --panel2:#0c162a;
  --text:#e8eefc;
  --muted:#93a4c7;
  --border:rgba(255,255,255,.10);
  --shadow:0 18px 60px rgba(0,0,0,.45);

  --brand:#4f86ff;
  --brand2:#2ed3b7;

  --good:#2ed3b7;
  --warn:#f7c948;
  --bad:#ff5b6e;

  --radius:14px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

[data-theme="light"]{
  --bg:#f4f7ff;
  --panel:#ffffff;
  --panel2:#f8faff;
  --text:#0b1220;
  --muted:#5c6b85;
  --border:rgba(10,20,40,.12);
  --shadow:0 18px 60px rgba(10,20,40,.14);
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background: var(--bg);
  overflow-x:hidden;
}

a{color:inherit;text-decoration:none}

.container{display:flex;min-height:100vh}

/* ========================
   SIDEBAR
======================== */

.sidebar{
  width:280px;
  padding:18px 16px;
  border-right:1px solid var(--border);
  background:
    radial-gradient(500px 280px at 10% 0%, rgba(79,134,255,.05), transparent 65%),
    radial-gradient(420px 260px at 90% 10%, rgba(46,211,183,.04), transparent 65%),
    var(--panel2);
  position:sticky;
  top:0;
  height:100vh;
}

/* BRAND AREA */

.brand{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:8px;
  padding:6px 4px 18px;
  margin-bottom:18px;
  border-bottom:1px solid var(--border);
}

.logo-wrap{
  width:80px;
  height:80px;
  border-radius:18px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.05);
  border:1px solid var(--border);
}

.logo-wrap img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.brand h1{
  font-size:22px;
  line-height:1.2;
  margin:6px 0 0 0;
  font-weight:900;
  color:#000;
  letter-spacing:.2px;
}

.brand p{
  font-size:12px;
  margin-top:2px;
  color:var(--muted);
}

/* NAVIGATION */

.nav{margin-top:6px}

.nav a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  color:var(--muted);
  border:1px solid transparent;
  transition:all .18s ease;
}

.nav a:hover{
  color:var(--text);
  background:rgba(255,255,255,.04);
  border-color:var(--border);
}

.nav a.active{
  color:var(--text);
  background:linear-gradient(135deg, rgba(79,134,255,.10), rgba(79,134,255,.05));
  border-color:rgba(79,134,255,.22);
}

/* ========================
   MAIN AREA
======================== */

.main{flex:1;padding:18px 22px}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search{
  flex:1;
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: var(--panel2);
}

.search input{
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text);
  font-size:14px;
}

/* BUTTONS */

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  color:var(--text);
  padding:10px 14px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
}

.btn.primary{
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border:none;
  color:#fff;
}

/* GRID */

.grid{
  margin-top:18px;
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
}

.card{
  border:1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}

.card h3{
  margin:0 0 6px 0;
  font-size:13px;
  color:var(--muted);
  font-weight:800;
}

.card .big{
  font-size:26px;
  font-weight:900;
}

.span-3{grid-column: span 3}
.span-4{grid-column: span 4}
.span-6{grid-column: span 6}
.span-12{grid-column: span 12}

/* TABLE */

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  border-radius: var(--radius);
  border:1px solid var(--border);
}

.table th,.table td{
  padding:12px;
  border-bottom:1px solid var(--border);
  font-size:14px;
}

.table th{
  text-align:left;
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
}

.table tr:last-child td{border-bottom:0}

/* SMALL TEXT */

.small{
  color:var(--muted);
  font-size:12px;
}

/* BADGES */

.badge{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  font-weight:800;
  font-size:12px;
}

/* NOTICES */

.notice{
  margin:12px 0 0;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  color:var(--muted);
}

/* =========================
   AUTH — LOGIN PAGE
========================= */

body.auth-page{
  background:
    radial-gradient(900px 650px at 10% -10%, rgba(79,134,255,.18), transparent 62%),
    radial-gradient(900px 650px at 95% 0%, rgba(46,211,183,.14), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 40%),
    var(--bg);
}

.auth-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns: 1.1fr .9fr;
}

.auth-media{
  position:relative;
  overflow:hidden;
  background:
    linear-gradient(120deg, rgba(8,12,20,.55), rgba(8,12,20,.18)),
    url("/assets/img/login.jpg");
  background-size:cover;
  background-position:center;
}

.auth-media-overlay{
  position:absolute;
  inset:0;
  background:
    radial-gradient(1200px 700px at 20% 0%, rgba(79,134,255,.20), transparent 62%),
    radial-gradient(1000px 650px at 90% 0%, rgba(46,211,183,.16), transparent 62%),
    linear-gradient(180deg, rgba(0,0,0,.06), rgba(0,0,0,.40));
}

.auth-media-badge{
  position:absolute;
  top:22px;
  left:22px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(10,16,28,.72);
  box-shadow:
    0 10px 26px rgba(0,0,0,.35),
    0 0 0 1px rgba(255,255,255,.06) inset;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-mark{
  width:38px;
  height:38px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  display:flex;
  align-items:center;
  justify-content:center;
}

.auth-media-title{
  font-weight:950;
  letter-spacing:.2px;
  font-size:15px;
  color:#ffffff;
  text-shadow: 0 2px 10px rgba(0,0,0,.55);
}

.auth-media-sub{
  font-size:12px;
  color:rgba(255,255,255,.76);
  margin-top:2px;
  text-shadow: 0 2px 10px rgba(0,0,0,.55);
}

.auth-media-copy{
  position:absolute;
  left:26px;
  bottom:26px;
  max-width:520px;
}

.auth-media-headline{
  font-size:26px;
  font-weight:950;
  letter-spacing:.2px;
  color:#fff;
  text-shadow: 0 2px 18px rgba(0,0,0,.55);
}

.auth-media-text{
  margin-top:8px;
  color:rgba(255,255,255,.80);
  line-height:1.35;
  max-width:520px;
  text-shadow: 0 2px 14px rgba(0,0,0,.50);
}

.auth-panel{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:34px 28px;
  background:
    radial-gradient(900px 700px at 20% 0%, rgba(79,134,255,.22), transparent 60%),
    radial-gradient(900px 700px at 90% 10%, rgba(46,211,183,.18), transparent 60%),
    linear-gradient(160deg, rgba(16,26,44,.92), rgba(10,16,28,.92));
  border-left:1px solid rgba(255,255,255,.10);
}

.auth-panel-inner{
  width:min(420px, 92vw);
}

.auth-tabs{
  display:flex;
  gap:16px;
  margin-bottom:14px;
  align-items:flex-end;
}

.auth-tab{
  font-weight:950;
  letter-spacing:.2px;
  opacity:.60;
  padding-bottom:8px;
  border-bottom:2px solid transparent;
  color: rgba(255,255,255,.85);
}

.auth-tab.active{
  opacity:1;
  border-bottom-color: rgba(79,134,255,.75);
  color:#fff;
}

.auth-tab.disabled{
  opacity:.25;
  cursor:not-allowed;
}

.auth-form{margin-top:10px}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin:14px 0;
}

.field label{
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.35px;
  color:rgba(255,255,255,.70);
}

.field input{
  padding:12px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color:#fff;
  outline:0;
  font-size:14px;
}

.field input::placeholder{
  color: rgba(255,255,255,.55);
}

.field input:focus{
  border-color: rgba(79,134,255,.85);
  box-shadow: 0 0 0 2px rgba(79,134,255,.22);
  background: rgba(255,255,255,.10);
}

.auth-row{
  margin-top:8px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.auth-check{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color:rgba(255,255,255,.78);
}

.auth-check label{
  margin:0;
  cursor:pointer;
}

.auth-link{
  font-size:12px;
  color:rgba(255,255,255,.78);
  opacity:.92;
}

.auth-link:hover{
  opacity:1;
  text-decoration:underline;
}

.auth-btn{
  width:100%;
  margin-top:14px;
  padding:12px 14px;
  border-radius:999px;
  box-shadow: 0 14px 26px rgba(0,0,0,.28);
}

.auth-foot{
  margin-top:18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.auth-icon-btn{
  width:44px;
  height:44px;
  padding:0;
  border-radius:14px;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
}

.auth-foot-links{
  display:flex;
  align-items:center;
  gap:8px;
  color:rgba(255,255,255,.58);
  font-size:12px;
}

.auth-mini-link{
  opacity:.88;
}

.auth-mini-link:hover{
  opacity:1;
  text-decoration:underline;
}

.dot{
  opacity:.45;
}

/* RESPONSIVE */

@media (max-width:980px){
  .sidebar{
    width:240px;
  }

  .auth-shell{
    grid-template-columns:1fr;
  }

  .auth-media{
    min-height:280px;
  }

  .auth-panel{
    border-left:0;
    border-top:1px solid rgba(255,255,255,.10);
  }

  .auth-media-copy{
    max-width:90vw;
  }
}