:root {
  --pharma-primary: #0f766e;
  --pharma-primary-dark: #0b5750;
  --pharma-accent: #2563eb;
  --pharma-bg: #f4f7f8;
  --pharma-sidebar-bg: #0b3b38;
  --pharma-sidebar-active: #0f766e;
}

body { background: var(--pharma-bg); }

.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--pharma-sidebar-bg), var(--pharma-primary) 70%);
}

/* Topbar */
.app-topbar {
  background: var(--pharma-sidebar-bg);
  z-index: 1030;
}
.app-topbar .navbar-brand { color: #fff; }
.demo-warning { background: #fff3cd; color: #664d03; border-bottom: 1px solid #ffe69c; }

/* Shell layout */
.app-shell { display: flex; align-items: stretch; min-height: calc(100vh - 56px); }

.app-sidebar {
  width: 230px;
  flex: 0 0 230px;
  background: var(--pharma-sidebar-bg);
  min-height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
  align-self: flex-start;
}
.app-sidebar .nav-link,
.offcanvas-body .nav-link {
  color: rgba(255,255,255,.8);
  border-radius: .5rem;
  padding: .6rem .8rem;
  margin-bottom: .15rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .93rem;
}
.app-sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-sidebar .nav-link.active { background: var(--pharma-sidebar-active); color: #fff; font-weight: 600; }
.offcanvas-body .nav-link { color: #212529; }
.offcanvas-body .nav-link.active { background: var(--pharma-primary); color: #fff; }

.app-main { flex: 1 1 auto; min-width: 0; padding-bottom: 4.5rem; }

/* Mobile bottom nav */
.app-bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid #dee2e6;
  display: flex; align-items: center; justify-content: space-around;
  padding: .35rem 0; z-index: 1030;
}
.app-bottomnav a { color: #6c757d; text-decoration: none; font-size: .68rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .25rem .4rem; }
.app-bottomnav a i { font-size: 1.25rem; }
.app-bottomnav a.active { color: var(--pharma-primary); font-weight: 600; }
.app-bottomnav-fab { background: var(--pharma-primary); color: #fff !important; border-radius: 50%; width: 3rem; height: 3rem; display: flex; align-items: center; justify-content: center; margin-top: -1.4rem; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.app-bottomnav-fab i { font-size: 1.6rem; }

/* Cards & dashboard */
.stat-card { border: none; border-radius: .9rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat-card .stat-icon { width: 42px; height: 42px; border-radius: .7rem; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; }
.chart-card { border: none; border-radius: .9rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

.table-responsive-card .table td, .table-responsive-card .table th { vertical-align: middle; }

.toast-stack { position: fixed; top: 70px; right: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; }

.badge-status-draft { background: #6c757d; }
.badge-status-final { background: #198754; }
.badge-status-cancelled { background: #dc3545; }

.searchable-row:hover { background: #f8f9fa; cursor: pointer; }

.empty-state { text-align: center; padding: 3rem 1rem; color: #6c757d; }
.empty-state i { font-size: 2.5rem; opacity: .5; }

@media (max-width: 767.98px) {
  .app-main { padding-bottom: 5rem; }
}

/* Print */
@media print {
  .app-topbar, .app-sidebar, .app-bottomnav, .offcanvas, .no-print, .demo-warning, .toast-stack { display: none !important; }
  .app-main { padding: 0 !important; }
  body { background: #fff !important; }
  .card { border: none !important; box-shadow: none !important; }
}

/* Invoice print sheet (used by invoice_print.php) */
.invoice-sheet {
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  padding: 28px;
  font-size: .92rem;
  color: #111;
}
.invoice-sheet table { font-size: .85rem; }
.invoice-sheet .brand-title { color: var(--pharma-primary-dark); font-weight: 800; letter-spacing: .5px; }
.invoice-sheet .totals-table td { padding: .2rem .5rem; }
.invoice-sheet .stamp-box { border: 1px dashed #999; height: 90px; }
@media print {
  @page { size: A4; margin: 10mm; }
  .invoice-sheet { padding: 0; max-width: 100%; }
  .invoice-toolbar { display: none !important; }
}
