:root{
  --sidebar-bg:#070b18;
  --sidebar-accent:#6e0ba6;
  --sidebar-text:#e5e7eb;
  --sidebar-muted:#9ca3af;

  --header-bg:#0b1020;
  --body-bg:#0f172a;
  --card-bg:#111827;
  --border:#1f2937;
  --text:#e5e7eb;
  --muted:#9ca3af;

  --radius-lg:14px;
  --shadow-soft:0 16px 35px rgba(0,0,0,0.55);
  --brand:#6e0ba6;
  --brand-soft:rgba(110,11,166,0.18);
}

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;
  background:radial-gradient(circle at top, #111827 0, #020617 55%);
  color:var(--text);
  min-height:100vh;
  display:flex;
  overflow:hidden;
}

/* SIDEBAR */

.sidebar{
  width:260px;
  background:radial-gradient(circle at top, #0b1020 0, #020617 55%);
  border-right:1px solid #111827;
  padding:18px 16px;
  display:flex;
  flex-direction:column;
  gap:20px;
  transition:transform .25s ease, opacity .25s ease;
}

.sidebar .logo{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 8px;
}

.logo-mark{
  width:34px;
  height:34px;
  border-radius:999px;
  background:conic-gradient(from 180deg, #6e0ba6, #8b5cf6,#ec4899,#6e0ba6);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 0 18px rgba(110,11,166,0.8);
  font-size:16px;
  color:#fff;
  font-weight:700;
}

.logo-text{
  display:flex;
  flex-direction:column;
}

.logo-text span:first-child{
  font-weight:600;
  letter-spacing:.03em;
  font-size:14px;
  text-transform:uppercase;
  color:#f9fafb;
}

.logo-text span:last-child{
  font-size:11px;
  letter-spacing:.09em;
  color:var(--sidebar-muted);
  text-transform:uppercase;
}

.sidebar-section-title{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.16em;
  color:var(--sidebar-muted);
  margin:8px 4px;
}

.nav-list{
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.nav-item{
  border-radius:10px;
  padding:8px 10px;
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--sidebar-text);
  font-size:13px;
  cursor:pointer;
  transition:background .18s, transform .12s, box-shadow .18s;
}

.nav-item i{
  width:18px;
  text-align:center;
  font-size:14px;
  color:var(--sidebar-muted);
}

.nav-item span{
  flex:1;
}

.nav-item small{
  font-size:10px;
  color:var(--sidebar-muted);
  text-transform:uppercase;
  letter-spacing:.12em;
}

.nav-item:hover{
  background:rgba(15,23,42,0.9);
  transform:translateX(2px);
}

.nav-item.active{
  background:linear-gradient(135deg, rgba(110,11,166,0.32), rgba(37,99,235,0.28));
  box-shadow:0 0 22px rgba(110,11,166,0.8);
}

.nav-item.active i{
  color:#e5e7eb;
}

.sidebar-footer{
  margin-top:auto;
  padding:10px;
  border-radius:var(--radius-lg);
  background:linear-gradient(135deg, rgba(15,23,42,0.95), rgba(15,23,42,0.7));
  border:1px solid rgba(148,163,184,0.25);
  font-size:11px;
  color:var(--sidebar-muted);
}

.sidebar-footer strong{
  color:var(--sidebar-text);
  font-size:12px;
}

/* MAIN LAYOUT */

.main{
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
  overflow:hidden;
}

header{
  height:64px;
  background:var(--header-bg);
  border-bottom:1px solid #111827;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 20px;
  box-shadow:0 10px 25px rgba(0,0,0,0.55);
  position:sticky;
  top:0;
  z-index:10;
}

/* MOBIL MENU BUTTON */
.menu-toggle{
  display:none;
  border-radius:999px;
  border:1px solid var(--border);
  background:transparent;
  width:34px;
  height:34px;
  align-items:center;
  justify-content:center;
  color:var(--text);
  cursor:pointer;
}
.menu-toggle i{
  font-size:16px;
}

.header-left{
  display:flex;
  align-items:center;
  gap:10px;
}

.header-left h1{
  font-size:16px;
  font-weight:600;
  display:flex;
  align-items:center;
  gap:8px;
}

.header-left h1 i{
  color:var(--brand);
  font-size:18px;
}

.header-left span{
  font-size:11px;
  color:var(--muted);
}

.header-right{
  display:flex;
  align-items:center;
  gap:14px;
}

.chip{
  font-size:11px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,0.4);
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:6px;
  background:rgba(15,23,42,0.8);
}

.user-avatar{
  width:32px;
  height:32px;
  border-radius:999px;
  background:linear-gradient(135deg,#6e0ba6,#4f46e5);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  font-weight:600;
  box-shadow:0 0 16px rgba(79,70,229,0.9);
}

.main-content{
  padding:18px 20px 24px;
  overflow:auto;
  height:calc(100vh - 64px);
}

.breadcrumbs{
  font-size:11px;
  color:var(--muted);
  margin-bottom:10px;
}

.breadcrumbs span{
  color:#e5e7eb;
}

.grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin-bottom:18px;
}

.card{
  background:radial-gradient(circle at top left, rgba(148,163,184,0.18) 0, #020617 55%);
  border-radius:var(--radius-lg);
  border:1px solid var(--border);
  padding:12px 14px;
  box-shadow:var(--shadow-soft);
  position:relative;
  overflow:hidden;
}

.card h3{
  font-size:12px;
  color:var(--muted);
  margin-bottom:4px;
}

.card .value{
  font-size:18px;
  font-weight:600;
}

.card small{
  font-size:11px;
  color:var(--muted);
}

.card .pill{
  position:absolute;
  right:10px;
  top:10px;
  font-size:10px;
  padding:3px 8px;
  border-radius:999px;
  background:rgba(15,23,42,0.9);
  border:1px solid rgba(148,163,184,0.4);
  color:var(--muted);
}

/* === 👇 RESPONSIVE - TABLET & MOBILE === */

@media (max-width:1100px){
  body{
    flex-direction:column;
    overflow:auto;
  }

  .sidebar{
    position:fixed;
    top:0;
    left:0;
    bottom:0;
    transform:translateX(-100%);
    z-index:999;
    box-shadow:0 0 35px rgba(0,0,0,0.8);
  }

  body.sidebar-open .sidebar{
    transform:translateX(0);
  }

  .menu-toggle{
    display:inline-flex;
  }

  .layout-2col,
  .grid,
  .form-grid{
    grid-template-columns:1fr !important;
  }

  .main{
    width:100%;
  }
}

/* === 👇 SMALL MOBILE === */

@media (max-width:640px){
  header{
    padding:6px 10px;
    gap:10px;
  }

  .header-left h1{
    font-size:14px;
  }

  .header-left span{
    font-size:10px;
  }

  table{
    font-size:11px;
  }

  .form-input,
  .form-select,
  .form-textarea{
    font-size:11px;
  }

  td,th{
    padding:6px 6px;
  }

  .btn-xs,
  .btn,
  .btn-sm{
    font-size:10px !important;
  }
}
