/* ============================================================
   ChemStock — custom theme layered on top of Bootstrap 5.
   Bootstrap 5 (CSS + JS bundle) is loaded via CDN in header.php.
   This file only supplies brand colors and app-shell layout;
   buttons, cards, tables, forms, alerts, and badges all use
   native Bootstrap classes in the markup.
   ============================================================ */

:root {
  --bs-primary: #0e7490;
  --bs-primary-rgb: 14, 116, 144;
  --brand-dark: #0b5d73;
  --brand-accent: #0ea5e9;
  --sidebar-w: 240px;
}

body {
  background: #f4f6f8;
  font-size: 14.5px;
}

a { color: var(--bs-primary); }

.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark);
}

/* ---------------- App shell ---------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--brand-dark);
  color: #e0f2fe;
  flex-shrink: 0;
  padding: 1.25rem 0;
}
.sidebar .brand { font-size: 1.15rem; font-weight: 700; padding: 0 1.25rem 1.25rem; color: #fff; }
.sidebar .nav-link {
  color: #bae6fd;
  font-weight: 500;
  border-left: 3px solid transparent;
  border-radius: 0;
  padding: 0.65rem 1.25rem;
}
.sidebar .nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar .nav-link.active { background: rgba(255,255,255,0.12); color: #fff; border-left-color: var(--brand-accent); }
.sidebar .nav-divider { padding: 1rem 1.25rem 0.35rem; font-size: 0.68rem; text-transform: uppercase; letter-spacing: .05em; color: #7dd3fc; opacity: 0.85; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar { background: #fff; border-bottom: 1px solid #e1e5ea; padding: 0.9rem 1.5rem; }
.content { padding: 1.5rem; }

/* Offcanvas sidebar reuses the same theme on mobile */
.offcanvas .sidebar { width: 100%; min-height: 100%; }

/* ---------------- Small app-specific bits ---------------- */
.stat-card { background: #fff; border: 1px solid #e1e5ea; border-radius: .5rem; padding: 1rem 1.1rem; height: 100%; }
.stat-card .label { color: #6b7280; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .value { font-size: 1.5rem; font-weight: 700; margin-top: .3rem; color: var(--brand-dark); }

.card { border-color: #e1e5ea; padding: 1.25rem; margin-bottom: 1.25rem; }
.card > .card-body-padded { padding: 0; }

table th { text-transform: uppercase; font-size: .7rem; letter-spacing: .03em; color: #6b7280; background: #f8fafc; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--brand-dark), var(--bs-primary)); }
.login-box { background: #fff; border-radius: .75rem; box-shadow: 0 20px 40px rgba(0,0,0,.2); }

/* ---------------- Small layout convenience classes ----------------
   Bootstrap 5 drives every component (buttons, badges, alerts, cards,
   tables, forms, the offcanvas nav). These few small utilities just
   save repeating "d-flex flex-wrap gap-2" etc. on every page. */
.flex { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 0 1rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.form-actions { margin-top: .75rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.table-wrap { background: #fff; border: 1px solid #e1e5ea; border-radius: .5rem; overflow: hidden; overflow-x: auto; }
.user-box { display: flex; align-items: center; gap: .85rem; font-size: .82rem; color: #6b7280; }
.no-print-toggle { }

@media print { .no-print { display: none !important; } }
