:root {
  --brand: #1f3a5f;
  --brand-dark: #162b47;
  --brand-tint: #e8eef5;
  --page: #f4f6f9;
  --bs-primary: #1f3a5f;
  --bs-primary-rgb: 31, 58, 95;
  --bs-link-color-rgb: 31, 86, 150;
  --bs-link-hover-color-rgb: 22, 43, 71;
}
body { background: var(--page); font-size: 0.925rem; }
.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-primary {
  --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand);
}

/* Layout: fixed sidebar on desktop, slide-in menu on phones and tablets. */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex-shrink: 0; background-color: var(--brand) !important; color: #fff; --bs-offcanvas-width: 270px; }
.sidebar.offcanvas-lg { color: #fff; }
@media (min-width: 992px) {
  .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
.sidebar .brand { font-weight: 700; font-size: 1.1rem; padding: 1.1rem 1.25rem 0.9rem; letter-spacing: 0.01em; }
.sidebar .brand small { display: block; font-weight: 400; opacity: 0.7; font-size: 0.75rem; }
.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.82); padding: 0.55rem 1.25rem; border-left: 3px solid transparent;
  display: flex; justify-content: space-between; align-items: center;
}
.sidebar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.sidebar .nav-link.active { color: #fff; background: rgba(255, 255, 255, 0.14); border-left-color: #fff; font-weight: 600; }
.sidebar .nav-section { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.55; padding: 1rem 1.25rem 0.3rem; }
.sidebar .user-box { border-top: 1px solid rgba(255, 255, 255, 0.15); padding: 0.9rem 1.25rem; font-size: 0.85rem; }
.sidebar .user-box a, .sidebar .user-box button { color: rgba(255, 255, 255, 0.82); }
.topbar { background: var(--brand); color: #fff; }
.content { flex: 1; min-width: 0; padding: 1.25rem; }
@media (min-width: 992px) { .content { padding: 1.75rem 2rem; } }
.page-head { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; align-items: center; margin-bottom: 1.1rem; }
.page-head h1 { font-size: 1.45rem; font-weight: 700; margin: 0; color: var(--brand-dark); }

.card { border: 1px solid #e1e6ed; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04); }
.card-header { background: #fff; font-weight: 600; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: #5b6676; white-space: nowrap; background: #f8fafc; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td, .table tr.total td { font-weight: 700; background: var(--brand-tint); }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover { text-decoration: underline; }

.stat { display: block; background: #fff; border: 1px solid #e1e6ed; border-radius: 0.5rem; padding: 0.9rem 1rem; height: 100%; color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(31, 58, 95, 0.12); }
.stat .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: #5b6676; }
.stat .value { font-size: 1.6rem; font-weight: 700; color: var(--brand-dark); font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat .hint { font-size: 0.78rem; color: #6b7686; }
.stat.pending { border-left: 4px solid #eda100; }
.stat.approved { border-left: 4px solid #198754; }

.chart-box { position: relative; min-height: 220px; }
.chart-box canvas { cursor: pointer; }
.bulk-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid #e1e6ed; padding: 0.6rem 1rem; z-index: 5; }
.reject-reason { color: #b02a37; font-size: 0.82rem; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%); }
.login-card { width: 100%; max-width: 400px; }
.audit-change { font-size: 0.82rem; }
.audit-change del { color: #b02a37; }
.audit-change ins { color: #146c43; text-decoration: none; }
@media print { .sidebar, .topbar, .no-print { display: none !important; } .content { padding: 0; } }
