:root {
  --pms-sidebar-w: 250px;
  --pms-sidebar-bg: #0f172a;      /* slate-900 */
  --pms-sidebar-bg-2: #1e293b;    /* slate-800 */
  --pms-accent: #0ea5e9;          /* sky-500  */
}

* { box-sizing: border-box; }
body { min-height: 100vh; background: var(--bs-body-bg); }

/* ---------- Shell layout ---------- */
.pms-shell { display: flex; min-height: 100vh; }

.pms-sidebar {
  width: var(--pms-sidebar-w);
  min-width: var(--pms-sidebar-w);
  background: linear-gradient(180deg, var(--pms-sidebar-bg), var(--pms-sidebar-bg-2));
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: margin-left .2s ease;
}
.pms-shell.collapsed .pms-sidebar { margin-left: calc(-1 * var(--pms-sidebar-w)); }

.pms-brand {
  font-size: 1.15rem; font-weight: 700; padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: .5rem; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.pms-brand i { color: var(--pms-accent); }
.pms-tenant { padding: .6rem 1.25rem; font-size: .85rem; color: #94a3b8;
  border-bottom: 1px solid rgba(255,255,255,.06); }

.pms-nav { padding: .5rem; overflow-y: auto; flex: 1; }
.pms-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem .85rem; margin: .1rem 0; border-radius: .5rem;
  color: #cbd5e1; text-decoration: none; font-size: .92rem;
  transition: background .15s, color .15s;
}
.pms-link i { width: 1.1rem; text-align: center; }
.pms-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.pms-link.active { background: var(--pms-accent); color: #fff; font-weight: 600; }
.pms-sidebar-foot { padding: .5rem 0; border-top: 1px solid rgba(255,255,255,.08); }

.pms-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pms-topbar {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem 1rem; background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color); position: sticky; top: 0; z-index: 5;
}
.pms-content { padding: 1.25rem; flex: 1; }

/* ---------- Auth ---------- */
.pms-auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a, #0ea5e9);
}
.pms-auth-card { width: 100%; max-width: 400px; }

/* ---------- Badges / status ---------- */
.badge-low   { background: #f59e0b; color: #1f2937; }   /* amber */
.badge-ok    { background: #16a34a; }                     /* green */
.badge-expired { background: #dc2626; }                   /* red   */

/* ---------- POS ---------- */
.pos-grid { display: grid; grid-template-columns: 1fr 380px; gap: 1rem; }
@media (max-width: 992px) { .pos-grid { grid-template-columns: 1fr; } }
.pos-results { max-height: 340px; overflow-y: auto; }
.pos-cart-table td { vertical-align: middle; }
.pos-qty { width: 72px; }

/* POS loading overlay (shown while a sale is being completed) */
.pos-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.pos-overlay.d-none { display: none !important; }
.pos-overlay-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.1rem 1.6rem;
  border-radius: .75rem;
  font-weight: 600;
  background: var(--bs-body-bg, #fff);
  color: var(--bs-body-color, #212529);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .28);
}

/* KPI cards */
.kpi-card { border: none; border-radius: .9rem; }
.kpi-card .kpi-icon { font-size: 1.5rem; opacity: .85; }

/* ---------- Thermal receipt (80mm) ---------- */
.receipt {
  width: 80mm; margin: 0 auto; padding: 6px 8px;
  font-family: "Courier New", monospace; font-size: 12px; color: #000;
}
.receipt h1 { font-size: 15px; text-align: center; margin: 4px 0; }
.receipt .muted { text-align: center; font-size: 11px; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt hr { border: none; border-top: 1px dashed #000; margin: 6px 0; }
.receipt .r { text-align: right; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}
