* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, Arial, sans-serif; background:#f6f7fb; color:#1f2937; }
a { text-decoration: none; }

.topbar {
  display:flex; justify-content: space-between; align-items:center;
  padding:14px 18px; background:#111827; color:#fff;
}
.brand { font-weight: 700; }
.nav a { color:#fff; margin-left:14px; opacity:0.9; }
.nav a:hover { opacity:1; }
.nav .logout { color:#fca5a5; }

.container { max-width: 1100px; margin: 18px auto; padding: 0 14px; }

.footer { text-align:center; padding: 20px; color:#6b7280; }

.card {
  background:#fff; border-radius: 14px; padding: 16px;
  box-shadow: 0 8px 24px rgba(17,24,39,0.08);
  margin-bottom: 14px;
}

.page-head { display:flex; justify-content: space-between; align-items:center; margin-bottom: 12px; }
h1 { margin: 0; font-size: 22px; }
h2 { margin: 0 0 8px; }
h3 { margin: 0 0 8px; }

.btn {
  display:inline-block; padding: 10px 14px; border-radius: 10px;
  background:#2563eb; color:#fff; border:none; cursor:pointer;
  font-weight:600;
}
.btn:hover { filter: brightness(0.95); }
.btn.secondary { background:#e5e7eb; color:#111827; }

.alert { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.alert.success { background:#ecfdf5; color:#065f46; }
.alert.error { background:#fef2f2; color:#991b1b; }

label { display:block; margin-top: 10px; margin-bottom: 6px; font-weight:600; }
input, select {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid #e5e7eb; outline:none;
}
input:focus, select:focus { border-color:#2563eb; }

.table { width:100%; border-collapse: collapse; }
.table th, .table td { padding: 10px; border-bottom: 1px solid #f1f5f9; text-align:left; }
.table th { font-size: 13px; color:#6b7280; }

.link { color:#2563eb; margin-right: 10px; font-weight:600; }
.link.danger { color:#dc2626; }

.muted { color:#6b7280; }

.search { display:flex; gap: 10px; margin-bottom: 12px; }
.search input { flex: 1; }

.grid { display:grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stats { list-style:none; padding-left:0; margin:0; }
.stats li { margin: 8px 0; }

.actions { display:flex; gap: 10px; flex-wrap: wrap; }

.two-col { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.hint { color:#6b7280; font-size: 13px; margin-top: 10px; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .search { flex-direction: column; }
}

/* ===== Dashboard Layout ===== */
:root{
  --bg: #0b1220;
  --panel: #0f1a2d;
  --panel2: #0c1526;
  --text: #e8eefc;
  --muted: rgba(232,238,252,.75);
  --line: rgba(255,255,255,.08);
  --accent: #5b9bff;
  --accent2: #7c5cff;
  --good: #2dd4bf;
}

body{
  margin:0;
  background:#f4f6fb;
}

/* Layout grid */
.layout{
  display:flex;
  min-height:100vh;
}

/* Sidebar */
.sidebar{
  width:260px;
  background: linear-gradient(180deg, var(--bg), var(--panel));
  color:var(--text);
  border-right:1px solid var(--line);
  position:sticky;
  top:0;
  height:100vh;
  display:flex;
  flex-direction:column;
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
  padding:18px 16px;
  border-bottom:1px solid var(--line);
}

.brand-logo{
  width:42px;
  height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  font-weight:800;
  background: radial-gradient(circle at top left, var(--accent), var(--accent2));
  color:white;
}

.brand-title{
  font-size:14px;
  font-weight:700;
}
.brand-sub{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}

.nav{
  padding:12px 10px;
  display:flex;
  flex-direction:column;
  gap:6px;
  flex:1;
}

.nav-section{
  padding:10px 10px 6px;
  font-size:11px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
}

.nav-item{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border-radius:14px;
  color:var(--text);
  text-decoration:none;
  border:1px solid transparent;
  transition: all .15s ease;
}

.nav-item:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.08);
  transform: translateX(2px);
}

.nav-icon{
  width:22px;
  display:inline-flex;
  justify-content:center;
  opacity:.9;
}

/* ✅ Active link color */
.nav-item.active{
  background: linear-gradient(90deg, rgba(91,155,255,.25), rgba(124,92,255,.18));
  border-color: rgba(91,155,255,.35);
  box-shadow: 0 10px 24px rgba(91,155,255,.18);
}

.nav-item.active .nav-icon{
  opacity:1;
}

/* Sidebar footer */
.sidebar-footer{
  padding:14px 12px 16px;
  border-top:1px solid var(--line);
}

.user-chip{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 10px;
  border-radius:14px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
  margin-bottom:10px;
}

.user-dot{
  width:10px;height:10px;border-radius:999px;
  background: var(--good);
  box-shadow: 0 0 0 6px rgba(45,212,191,.12);
}

.user-name{ font-weight:700; font-size:13px; }
.user-role{ font-size:12px; color:var(--muted); margin-top:2px; }

.logout{
  display:block;
  text-align:center;
  text-decoration:none;
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
}
.logout:hover{ background: rgba(255,255,255,.10); }

/* Main area */
.main{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
}

.topbar{
  height:60px;
  background:white;
  border-bottom:1px solid #e8edf6;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 16px;
  position:sticky;
  top:0;
  z-index:10;
}

.topbar-title{
  font-weight:800;
  color:#0b1220;
}

.pill{
  font-size:12px;
  padding:6px 10px;
  border:1px solid #e8edf6;
  border-radius:999px;
  background:#fbfcff;
  color:#0b1220;
}

.content{
  padding:18px;
}

/* Mobile sidebar */
.burger{
  display:none;
  border:1px solid #e8edf6;
  background:#fff;
  border-radius:12px;
  padding:8px 10px;
  font-size:16px;
}

@media (max-width: 980px){
  .burger{ display:inline-flex; }
  .sidebar{
    position:fixed;
    left:-280px;
    top:0;
    height:100vh;
    z-index:50;
    transition:left .2s ease;
  }
  .sidebar.open{ left:0; }
}