/* Crystal — Kuyat Group | Built & Powered by Robust Technologies Ltd */
:root {
  --sp-primary: #2575ba;
  --sp-primary-dark: #1a5690;
  --sp-accent: #58595b;
  --sp-bg: #f3f5f9;
  --sp-sidebar-w: 240px;
}
body { background: var(--sp-bg); font-size: .95rem; }
.topbar { background: linear-gradient(90deg, var(--sp-primary-dark), var(--sp-primary)); }
.btn-primary { --bs-btn-bg: var(--sp-primary); --bs-btn-border-color: var(--sp-primary); --bs-btn-hover-bg: var(--sp-primary-dark); --bs-btn-hover-border-color: var(--sp-primary-dark); --bs-btn-active-bg: var(--sp-primary-dark); }
.text-primary { color: var(--sp-primary) !important; }
.app-wrap { min-height: calc(100vh - 56px); }
.sidebar { background: #fff; border-right: 1px solid #e3e7ef; }
@media (min-width: 992px) {
  .sidebar { width: var(--sp-sidebar-w); flex: 0 0 var(--sp-sidebar-w); position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
}
.sidebar .nav-link { color: #3a4556; border-radius: .5rem; padding: .55rem .75rem; margin-bottom: 2px; }
.sidebar .nav-link:hover { background: #eef2fa; }
.sidebar .nav-link.active { background: var(--sp-primary); color: #fff; }
.nav-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #8a94a6; padding: .9rem .75rem .3rem; }
.main-content { min-width: 0; display: flex; flex-direction: column; }
.main-content > .container-fluid, .main-content > .container { flex: 1; }
.app-footer { text-align: center; font-size: .8rem; color: #6c757d; padding: 1rem; border-top: 1px solid #e3e7ef; background: #fff; }
.card { border: 0; border-radius: .8rem; box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.card-header { background: #fff; border-bottom: 1px solid #eef0f4; font-weight: 600; }
.kpi .label { font-size: .78rem; color: #6c757d; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 1.35rem; font-weight: 700; }
.kpi .icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 1.25rem; }
.page-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.35rem; margin: 0; font-weight: 700; }
.table thead th { font-size: .78rem; text-transform: uppercase; color: #6c757d; white-space: nowrap; background: #f8f9fb; }
.table td { vertical-align: middle; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.low-stock { background: #fff3f3 !important; }
.login-wrap { min-height: 80vh; display: grid; place-items: center; }
.login-card { max-width: 400px; width: 100%; }
.login-logo { width: 64px; height: 64px; }
/* POS */
.pos-search-results { position: absolute; z-index: 1050; width: 100%; max-height: 320px; overflow-y: auto; }
.pos-lines input { min-width: 70px; }
.pos-total { font-size: 1.6rem; font-weight: 800; color: var(--sp-primary); }
.sticky-summary { position: sticky; top: 72px; }
@media (max-width: 991px) { .sticky-summary { position: static; } }
/* Receipt */
.receipt { max-width: 320px; margin: 0 auto; background: #fff; padding: 12px; font-family: "Courier New", monospace; font-size: 12px; }
.receipt table { width: 100%; }
.receipt hr { border-top: 1px dashed #000; opacity: 1; margin: 6px 0; }
@media print {
  body { background: #fff; }
  .card { box-shadow: none; }
  .main-content > .container-fluid { padding: 0 !important; }
  .print-footer { display: block !important; }
}
.print-footer { display: none; text-align: center; font-size: 11px; margin-top: 10px; }
.btn-outline-primary { --bs-btn-color: var(--sp-primary); --bs-btn-border-color: var(--sp-primary); --bs-btn-hover-bg: var(--sp-primary); --bs-btn-hover-border-color: var(--sp-primary); --bs-btn-active-bg: var(--sp-primary); --bs-btn-active-border-color: var(--sp-primary); }
a { color: var(--sp-primary); }
.list-group-item.active { background: var(--sp-primary); border-color: var(--sp-primary); }
/* ---- Crystal additions ---- */
.topbar .unit-pill { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: #fff; }
.topbar .form-select { max-width: 220px; }
.nav-soon { color: #adb5bd !important; cursor: default; }
.bell { position: relative; }
.bell .badge { position: absolute; top: -4px; right: -6px; font-size: .65rem; }
.brand-mark { height: 28px; background: #fff; border-radius: 4px; padding: 1px; }
.unit-banner { border-left: 4px solid var(--sp-primary); }
.acct-card { border-top: 4px solid var(--sp-primary); }
.acct-card.neg { border-top-color: #dc3545; }
.balance { font-size: 1.6rem; font-weight: 800; }
.balance.neg { color: #dc3545; }
.balance.pos { color: #198754; }
.ledger td { font-size: .88rem; }
.portal-top { background: linear-gradient(90deg, var(--sp-primary-dark), var(--sp-primary)); color: #fff; }
.portal-top a { color: #fff; }
.small-label { font-size: .75rem; color: #6c757d; text-transform: uppercase; letter-spacing: .04em; }
.table-tight td, .table-tight th { padding: .3rem .4rem; }
.pending-row { background: #fff8e1 !important; }
.chip { display: inline-block; padding: .1rem .5rem; border-radius: 1rem; background: #eef2fa; font-size: .78rem; }
@media print { .no-print { display: none !important; } }
