/* =========================================================
   ROOT THEME VARIABLES
========================================================= */
:root{
  --bg:#07070b;
  --panel:#0d0d14;
  --panel2:#121221;
  --text:#eaeaf2;
  --muted:#a9aac0;
  --border: rgba(255,255,255,.08);
  --red:#7a0014;
  --red2:#a4001c;
  --radius:16px;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  --transition:.18s ease;
}

/* =========================================================
   RESET
========================================================= */
*{
  box-sizing:border-box;
}

html,body{
  height:100%;
}

body{
  margin:0;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(164,0,28,.25), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(122,0,20,.18), transparent 55%),
    var(--bg);
  color:var(--text);
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial;
  -webkit-font-smoothing:antialiased;
}

/* Scrollbar */
::-webkit-scrollbar{
  width:10px;
}
::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.12);
  border-radius:10px;
}
::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,.22);
}

/* =========================================================
   LINKS
========================================================= */
a{
  color:#ffb3c0;
  text-decoration:none;
}
a:hover{
  color:#ffd1da;
}

/* =========================================================
   CARD
========================================================= */
.cardx{
  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:18px;
}

/* =========================================================
   BADGE
========================================================= */
.badgex{
  padding:.25rem .6rem;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  font-size:.85rem;
  white-space:nowrap;
}

/* =========================================================
   BUTTONS
========================================================= */
.btnx{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding:.55rem .9rem;
  border-radius:12px;
  cursor:pointer;
  transition:var(--transition);
}
.btnx:hover{
  border-color: rgba(255,255,255,.25);
}
.btnx.red{
  background: linear-gradient(180deg, var(--red2), var(--red));
  border-color: rgba(255,255,255,.15);
}
.btnx.red:hover{
  filter:brightness(1.08);
}
.btnx:disabled{
  opacity:.5;
  cursor:not-allowed;
}

/* =========================================================
   INPUTS
========================================================= */
.inputx,
select,
textarea{
  width:100%;
  background: rgba(0,0,0,.25);
  border:1px solid rgba(255,255,255,.12);
  color:var(--text);
  border-radius:12px;
  padding:.6rem .75rem;
  outline:none;
  transition:var(--transition);
}
.inputx:focus,
select:focus,
textarea:focus{
  border-color: rgba(255,179,192,.6);
  box-shadow: 0 0 0 4px rgba(164,0,28,.18);
}

/* =========================================================
   TABLE
========================================================= */
.tableWrap{
  overflow:auto;
}
.tablex{
  width:100%;
  border-collapse: collapse;
  border-radius:14px;
  border:1px solid var(--border);
}
.tablex th,
.tablex td{
  padding:.7rem .8rem;
  border-bottom:1px solid var(--border);
}
.tablex th{
  text-align:left;
  color:var(--muted);
  background: rgba(255,255,255,.03);
}

/* =========================================================
   UTILITIES
========================================================= */
.small{
  font-size:.9rem;
  color:var(--muted);
}
.hr{
  height:1px;
  background:var(--border);
  margin:14px 0;
}
.flex{
  display:flex;
}
.center{
  display:flex;
  align-items:center;
  justify-content:center;
}
.gap10{ gap:10px; }
.gap20{ gap:20px; }

.grid2{
  display:grid;
  grid-template-columns: repeat(2,1fr);
  gap:20px;
}
.grid3{
  display:grid;
  grid-template-columns: repeat(3,1fr);
  gap:20px;
}
.grid4{
  display:grid;
  grid-template-columns: repeat(4,1fr);
  gap:20px;
}

/* =========================================================
   SIDEBAR (DESKTOP)
========================================================= */
.sidebar{
  width:270px;
  position:fixed;
  top:0;
  left:0;
  bottom:0;
  padding:18px;
  background: rgba(0,0,0,.25);
  border-right:1px solid var(--border);
  backdrop-filter: blur(10px);
  z-index:50;
  overflow:auto;
}

.navitem{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid transparent;
  transition:var(--transition);
}
.navitem:hover{
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.15);
}
.navitem.active{
  background: rgba(164,0,28,.18);
  border-color: rgba(255,179,192,.25);
}

/* =========================================================
   MAIN CONTENT
========================================================= */
.main{
  margin-left:290px;
  padding:22px;
  min-height:100vh;
}

/* =========================================================
   MOBILE TOPBAR
========================================================= */
.topbar{
  display:none;
  position:sticky;
  top:0;
  padding:12px 14px;
  background: rgba(0,0,0,.45);
  border-bottom:1px solid var(--border);
  backdrop-filter: blur(10px);
  z-index:60;
}

/* =========================================================
   MOBILE DRAWER
========================================================= */
.drawerOverlay{
  display:none;
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.65);
  z-index:70;
}

.drawer{
  display:none;
  position:fixed;
  top:0;
  left:-320px;
  width:300px;
  bottom:0;
  padding:18px;
  background: rgba(0,0,0,.55);
  border-right:1px solid var(--border);
  backdrop-filter: blur(10px);
  z-index:80;
  transition:left var(--transition);
  overflow:auto;
}
.drawer.open{
  left:0;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media(max-width:980px){

  .sidebar{
    display:none;
  }

  .main{
    margin-left:0;
    padding:16px;
  }

  .topbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
  }

  .drawer{
    display:block;
  }

  .drawerOverlay.show{
    display:block;
  }
}

@media(max-width:820px){
  .grid2,
  .grid3,
  .grid4{
    grid-template-columns:1fr !important;
  }
}

/* =========================================================
   ANIMATIONS
========================================================= */
.fadeIn{
  animation:fadeIn .3s ease;
}
@keyframes fadeIn{
  from{opacity:0;transform:translateY(6px);}
  to{opacity:1;transform:translateY(0);}
}

/* =========================================================
   PRINT MODE
========================================================= */
@media print{
  body{
    background:#fff;
    color:#000;
  }
  .no-print{
    display:none !important;
  }
  .cardx{
    box-shadow:none !important;
    border:1px solid #ddd !important;
    background:#fff !important;
    color:#000 !important;
  }
}