:root {
  --tm-primary: #2c4870;
  --tm-primary-dark: #1c2e47;
  --tm-accent: #d99a2b;
}

body {
  background: #f4f6f9;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

#wrapper { min-height: 100vh; }

.sidebar {
  width: 250px;
  min-width: 250px;
  background: linear-gradient(180deg, var(--tm-primary-dark), var(--tm-primary));
  color: #fff;
  min-height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-brand {
  padding: 1.25rem 1rem;
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: .6rem;
}

.sidebar .nav-link {
  color: rgba(255,255,255,.8);
  padding: .7rem 1.25rem;
  border-left: 3px solid transparent;
}

.sidebar .nav-link i { width: 20px; margin-right: 8px; }

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.08);
  border-left-color: var(--tm-accent);
}

.content-wrapper {
  flex: 1;
  min-width: 0;
}

.top-navbar {
  background: #fff;
  border-bottom: 1px solid #e5e9f0;
  padding: .6rem 1rem;
}

.stat-card {
  border: none;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  padding: 1.1rem 1.25rem;
  background: #fff;
  height: 100%;
}

.stat-card .stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: #fff;
}

.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-card .stat-label { color: #6c757d; font-size: .8rem; }

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--tm-primary-dark), var(--tm-primary));
}

.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: 16px;
  border: none;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}

@media (max-width: 992px) {
  .sidebar { position: fixed; left: -260px; z-index: 1050; transition: left .2s ease; }
  .sidebar.show { left: 0; }
}

.receipt-box {
  max-width: 620px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #dee2e6;
  padding: 2rem;
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}

/* ---- Dark mode overrides ---- */
[data-bs-theme="dark"] body {
  background: #12181f;
}

[data-bs-theme="dark"] .content-wrapper {
  background: #12181f;
}

[data-bs-theme="dark"] .top-navbar {
  background: #1a222c;
  border-bottom-color: #2a333f;
}

[data-bs-theme="dark"] .stat-card,
[data-bs-theme="dark"] .card {
  background: #1a222c;
  color: #e6e9ee;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
}

[data-bs-theme="dark"] .card-header {
  background: #1a222c !important;
  border-bottom-color: #2a333f;
  color: #e6e9ee;
}

[data-bs-theme="dark"] .table {
  color: #e6e9ee;
}

[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light > th {
  background: #232c38;
  color: #e6e9ee;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background: #232c38;
  color: #e6e9ee;
  border-color: #384454;
}

[data-bs-theme="dark"] .form-control::placeholder {
  color: #7b8794;
}

[data-bs-theme="dark"] .bg-white {
  background: #1a222c !important;
}

[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .btn-light {
  background: #232c38 !important;
  color: #e6e9ee !important;
}

[data-bs-theme="dark"] .text-muted {
  color: #93a1b0 !important;
}

[data-bs-theme="dark"] .modal-content {
  background: #1a222c;
  color: #e6e9ee;
}

[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top {
  border-color: #2a333f !important;
}
