:root {
  --sidebar-w: 250px;
  --sidebar-bg: #1f2a44;
  --sidebar-bg-2: #16203a;
  --accent: #4e73df;
}

* { box-sizing: border-box; }

body {
  background: #f4f6f9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
  font-size: 15px;
  margin: 0;
}

/* ---------- Layout ---------- */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
  color: #cbd5e1;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  transition: transform .25s ease;
  z-index: 1040;
}
.sidebar-brand {
  padding: 18px 20px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo { font-size: 1.4rem; }
.sidebar-nav { padding: 10px 0 30px; display: flex; flex-direction: column; }
.sidebar-nav .nav-link {
  color: #b6c2d9;
  padding: 11px 20px;
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .94rem;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav .nav-link.active {
  background: rgba(78,115,223,.22);
  border-left-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.sidebar-nav .nav-link i { width: 18px; text-align: center; }
.nav-logout { margin-top: 12px; border-top: 1px solid rgba(255,255,255,.08); color: #f8a5a5 !important; }

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid #e3e6f0;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 1030;
}
.page-title { margin: 0; font-size: 1.1rem; font-weight: 700; color: #3a3b45; }
.topbar-right { margin-left: auto; }
.admin-user { font-size: .9rem; color: #6e707e; white-space: nowrap; }
.btn-toggle {
  display: none;
  background: transparent;
  border: 1px solid #dcdfe8;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  color: #3a3b45;
}
.content { padding: 22px; flex: 1; }
.footer {
  padding: 14px 22px;
  border-top: 1px solid #e3e6f0;
  background: #fff;
  font-size: .82rem;
  color: #858796;
  text-align: center;
}

/* ---------- Cards ---------- */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(31,42,68,.08);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #eef0f5;
  font-weight: 600;
  border-radius: 10px 10px 0 0 !important;
  padding: 13px 18px;
}

/* ---------- Stat cards ---------- */
.stat-card { color: #fff; border-radius: 10px; }
.stat-card .stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1.2; }
.stat-blue   { background: linear-gradient(135deg, #4e73df, #224abe); }
.stat-green  { background: linear-gradient(135deg, #1cc88a, #13855c); }
.stat-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.stat-orange { background: linear-gradient(135deg, #f6ad55, #dd6b20); }
.stat-pink   { background: linear-gradient(135deg, #ec4899, #be185d); }
.stat-teal   { background: linear-gradient(135deg, #36b9cc, #258391); }

/* ---------- Tables ---------- */
.table > :not(caption) > * > * { padding: .6rem .65rem; }
.table thead th {
  background: #f8f9fc;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6e707e;
  border-bottom: 2px solid #e3e6f0;
  white-space: nowrap;
}
code { color: #d63384; }
textarea.form-control { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; }

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2a44, #4e73df);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
  background: #fff;
  padding: 32px 28px;
  text-align: center;
}
.login-logo { font-size: 2.6rem; }
.login-title { font-weight: 700; margin: 6px 0 2px; font-size: 1.35rem; }
.login-sub { color: #858796; font-size: .88rem; margin-bottom: 20px; }
.login-card form { text-align: left; }

/* ---------- Responsive ---------- */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1035;
}
body.sidebar-open .sidebar-backdrop { display: block; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 14px; }
  .btn-toggle { display: inline-block; }
  .stat-card .stat-value { font-size: 1.5rem; }
}
