/* MediTrack - colour system
   blue = primary actions | green = safe | orange = upcoming/warning | red = expired/critical */
:root {
  --mt-blue: #1d5fd1;
  --mt-navy: #0f1f3d;
  --mt-green: #1a9553;
  --mt-orange: #e8890c;
  --mt-red: #d3322f;
  --mt-bg: #f3f6fb;
  --bs-primary: var(--mt-blue);
  --bs-primary-rgb: 29, 95, 209;
}
body { background: var(--mt-bg); font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: #1c2a3f; }
.btn-primary { --bs-btn-bg: var(--mt-blue); --bs-btn-border-color: var(--mt-blue);
  --bs-btn-hover-bg: #174fb0; --bs-btn-hover-border-color: #174fb0; }
a { color: var(--mt-blue); }

/* Layout */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: 0 0 252px; background: var(--mt-navy); color: #c7d2e6; padding: 1rem .75rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: block; color: #fff; font-size: 1.35rem; font-weight: 700; padding: .5rem .75rem 1.25rem; text-decoration: none; }
.sidebar .brand i { color: #5fa0ff; }
.sidebar .nav-heading { text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; color: #7d8db0; padding: 1rem .75rem .35rem; }
.sidebar .nav-link { color: #c7d2e6; border-radius: .5rem; padding: .5rem .75rem; display: flex; align-items: center; gap: .6rem; font-size: .93rem; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link.active { background: var(--mt-blue); color: #fff; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid #e3e9f3; padding: .65rem 1.5rem; display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 10; }
.page-title { font-size: 1.25rem; font-weight: 600; margin: 0; }
.content { padding: 1.5rem; flex: 1; }
.footer { padding: .9rem 1.5rem; font-size: .8rem; color: #6b7a94; border-top: 1px solid #e3e9f3; background: #fff; }

@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: -260px; z-index: 1040; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.4); }
}

/* Cards */
.card { border: 1px solid #e3e9f3; border-radius: .75rem; box-shadow: 0 1px 2px rgba(15,31,61,.04); }
.card-header { background: #fff; border-bottom: 1px solid #eef2f8; font-weight: 600; }
.stat-card { border-left: 4px solid var(--mt-blue); }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-icon { font-size: 1.8rem; opacity: .25; }
.stat-card.green { border-left-color: var(--mt-green); }
.stat-card.orange { border-left-color: var(--mt-orange); }
.stat-card.red { border-left-color: var(--mt-red); }
.chart-box { position: relative; height: 270px; }

/* Tables */
.table > :not(caption) > * > * { padding: .6rem .75rem; vertical-align: middle; }
.table thead th { background: #f7f9fd; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #52627f; white-space: nowrap; }
.table-hover tbody tr:hover { background: #f4f8ff; }
tr.row-expired td { background: #fff3f2; }
tr.row-soon td { background: #fff8ec; }

.filter-bar .form-control, .filter-bar .form-select { min-width: 140px; }
.badge { font-weight: 600; }
.empty-state i { opacity: .4; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--mt-navy), #1d4a9a); padding: 1rem; }
.login-card { width: 100%; max-width: 410px; border-radius: 1rem; }
.btn.loading { pointer-events: none; opacity: .8; }

/* Print-friendly reports */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .footer, .btn, .filter-bar, .alert { display: none !important; }
  .content { padding: 0; }
  .card { border: none; box-shadow: none; }
  .table { font-size: 11px; }
  .table thead th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge { border: 1px solid #999; color: #000 !important; background: #fff !important; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
