:root {
  --primary: #3949ab;
  --primary-dark: #283593;
  --sidebar-w: 250px;
  --success: #2e7d32;
  --warning: #ef6c00;
  --danger: #c62828;
  --bg: #f4f6fb;
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #1f2430;
}

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

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--primary-dark), var(--primary));
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 1030;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px; font-weight: 700; font-size: 1.05rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.sidebar-brand i { font-size: 1.4rem; }
.sidebar-nav { padding: 10px 0 30px; }
.nav-heading {
  text-transform: uppercase; font-size: .7rem; letter-spacing: .06em;
  color: rgba(255,255,255,.55); padding: 14px 20px 6px;
}
.sidebar-nav .nav-link {
  color: rgba(255,255,255,.88);
  padding: 10px 20px;
  display: flex; align-items: center; gap: 10px;
  font-size: .92rem;
  border-left: 3px solid transparent;
}
.sidebar-nav .nav-link i { width: 18px; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.08); }
.sidebar-nav .nav-link.active {
  background: rgba(255,255,255,.14);
  border-left-color: #fff;
  font-weight: 600;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1025;
}

/* ---------- Main ---------- */
.main-content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-content.no-sidebar { margin-left: 0; }
.topbar {
  background: #fff; padding: 12px 20px; display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid #e6e8f0; position: sticky; top: 0; z-index: 1010;
}
.btn-icon { background: none; border: none; font-size: 1.4rem; color: #333; }
.page-content { padding: 22px; flex: 1; }

/* ---------- Cards ---------- */
.stat-card {
  background: #fff; border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(20,20,50,.06);
  display: flex; align-items: center; gap: 14px;
  height: 100%;
}
.stat-card .icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: #fff; flex-shrink:0;
}
.stat-card .value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.stat-card .label { font-size: .8rem; color: #6b7280; }

.card { border: none; border-radius: 14px; box-shadow: 0 2px 10px rgba(20,20,50,.06); }
.card-header { background: #fff; border-bottom: 1px solid #eef0f6; font-weight: 600; border-radius: 14px 14px 0 0 !important; }

.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7280; border-bottom-width: 1px; white-space: nowrap; }
.table td { vertical-align: middle; }

.badge-status { padding: 5px 10px; border-radius: 20px; font-weight: 600; font-size: .72rem; }

.login-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 20px;
}
.login-card { background: #fff; border-radius: 16px; padding: 40px 34px; width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-overlay.show { display: block; }
}

.quick-actions .btn { border-radius: 10px; }
.receipt-box { max-width: 480px; margin: 0 auto; background: #fff; padding: 26px; border-radius: 10px; }
@media print {
  .no-print { display: none !important; }
  .sidebar, .topbar { display: none !important; }
  .main-content { margin-left: 0 !important; }
}
