/* POS back office + checkout styles. No inline styles are used anywhere (strict CSP). */
:root {
  --pos-sidebar-w: 236px;
  --pos-accent: #0b6e4f;
  --pos-accent-soft: #e5f3ee;
  --bs-primary: #0b6e4f;
  --bs-primary-rgb: 11, 110, 79;
  --bs-link-color: #0b6e4f;
  --bs-link-color-rgb: 11, 110, 79;
  --bs-link-hover-color: #08513a;
  --bs-body-bg: #f6f7f5;
  --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}
.btn-primary { --bs-btn-bg: #0b6e4f; --bs-btn-border-color: #0b6e4f; --bs-btn-hover-bg: #08583f; --bs-btn-hover-border-color: #08583f; --bs-btn-active-bg: #06472f; --bs-btn-disabled-bg: #0b6e4f; --bs-btn-disabled-border-color: #0b6e4f; }
.btn-outline-primary { --bs-btn-color: #0b6e4f; --bs-btn-border-color: #0b6e4f; --bs-btn-hover-bg: #0b6e4f; --bs-btn-hover-border-color: #0b6e4f; --bs-btn-active-bg: #08583f; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: #4fa587; box-shadow: 0 0 0 .2rem rgba(11,110,79,.2); }
.form-check-input:checked { background-color: #0b6e4f; border-color: #0b6e4f; }
.page-link { color: #0b6e4f; } .active > .page-link { background: #0b6e4f; border-color: #0b6e4f; }

.skip-link { position: absolute; left: 8px; top: 8px; z-index: 2000; background: #fff; padding: 6px 10px; border-radius: 6px; }
.topbar { position: sticky; top: 0; z-index: 1030; height: 56px; }
.location-switch select { min-width: 180px; max-width: 280px; }
.app-shell { display: flex; min-height: calc(100vh - 56px); }
.sidebar { width: var(--pos-sidebar-w); background: #fff; border-right: 1px solid var(--bs-border-color); }
@media (min-width: 992px) {
  .sidebar { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; flex-shrink: 0; }
  .sidebar .offcanvas-body { display: flex; padding: .5rem; }
}
.sidebar .nav-link { color: #2b3330; border-radius: 8px; padding: .45rem .7rem; display: flex; gap: .55rem; align-items: center; font-size: .925rem; }
.sidebar .nav-link:hover { background: #f0f2ef; }
.sidebar .nav-link.active { background: var(--pos-accent-soft); color: var(--pos-accent); font-weight: 600; }
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #6c757d; margin: .9rem .7rem .25rem; }
.content { flex: 1; min-width: 0; padding: 1.25rem; }
@media (max-width: 575.98px) { .content { padding: .75rem; } }

.page-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.35rem; margin: 0; }
.card { border-color: #e3e6e2; }
.card-stat .value { font-size: 1.5rem; font-weight: 600; }
.card-stat .label { color: #6c757d; font-size: .85rem; }
.table-responsive { background: #fff; border: 1px solid #e3e6e2; border-radius: .5rem; }
.table { margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .55rem .7rem; }
.table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: #5c655f; background: #fafbf9; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.filters .form-control, .filters .form-select { width: auto; min-width: 140px; }
.filters .grow { flex: 1 1 220px; }
.badge-status { text-transform: capitalize; }
.perm-grid { columns: 2 260px; }
.perm-grid fieldset { break-inside: avoid; margin-bottom: 1rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.text-pre { white-space: pre-wrap; }
.w-qty { width: 110px; } .w-money { width: 130px; }
.min-w-0 { min-width: 0; }
.hidden { display: none !important; }

.support-banner { background: #7a2e00; color: #fff; padding: .5rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; position: sticky; top: 0; z-index: 1040; }
.support-banner a { color: #fff; text-decoration: underline; }

/* Sign-in pages */
.bare-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.bare-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid #e3e6e2; border-radius: 12px; padding: 1.75rem; }
.brand-icon { font-size: 2.25rem; color: var(--pos-accent); }

/* POS checkout */
body.pos-mode .content { padding: 0; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 420px; height: calc(100vh - 56px); }
.pos-left { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid #e3e6e2; }
.pos-search { padding: .75rem; background: #fff; border-bottom: 1px solid #e3e6e2; position: relative; }
.pos-search input { font-size: 1.1rem; }
.pos-results { position: absolute; left: .75rem; right: .75rem; top: calc(100% - .25rem); z-index: 20; max-height: 60vh; overflow-y: auto; background: #fff; border: 1px solid #d5d9d4; border-radius: 0 0 .5rem .5rem; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.pos-results button { display: flex; width: 100%; justify-content: space-between; gap: .5rem; padding: .6rem .8rem; border: 0; background: none; text-align: left; border-bottom: 1px solid #f0f1ef; }
.pos-results button:hover, .pos-results button.active { background: var(--pos-accent-soft); }
.pos-cart { flex: 1; overflow-y: auto; background: #fff; }
.pos-cart table td { vertical-align: middle; }
.pos-cart .line-name { font-weight: 500; }
.pos-cart .qty-input { width: 84px; }
.pos-empty { color: #8a938d; text-align: center; padding: 3rem 1rem; }
.pos-right { display: flex; flex-direction: column; background: #fbfcfa; min-height: 0; }
.pos-right .section { padding: .75rem 1rem; border-bottom: 1px solid #e3e6e2; }
.pos-totals { margin-top: auto; padding: 1rem; background: #fff; border-top: 1px solid #e3e6e2; }
.pos-totals .row-total { display: flex; justify-content: space-between; padding: .15rem 0; font-variant-numeric: tabular-nums; }
.pos-totals .grand { font-size: 1.6rem; font-weight: 700; }
.pos-pay-btn { font-size: 1.25rem; padding: .8rem; }
.tender-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.tender-grid .btn { padding: .7rem .25rem; }
.payment-row { display: flex; justify-content: space-between; align-items: center; padding: .3rem 0; border-bottom: 1px dashed #e3e6e2; }
@media (max-width: 991.98px) {
  .pos { grid-template-columns: 1fr; height: auto; }
  .pos-cart { min-height: 40vh; }
  .pos-left { border-right: 0; }
}

/* Receipts (screen preview; print rules in print.css) */
.receipt { background: #fff; margin: 1rem auto; padding: 10px; font-family: ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace; font-size: 12px; color: #000; }
.receipt.w58 { width: 58mm; } .receipt.w80 { width: 80mm; }
.receipt .c { text-align: center; } .receipt .r { text-align: right; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 4px 0; opacity: 1; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 1px 0; vertical-align: top; }
.receipt .big { font-size: 15px; font-weight: 700; }
.receipt-actions { text-align: center; margin: 1rem; }

/* Small phones */
@media (max-width: 575.98px) {
  .location-switch select { min-width: 0; max-width: 44vw; }
  .navbar-brand { font-size: 1rem; margin-right: .25rem; }
  .topbar .container-fluid { flex-wrap: nowrap; }
  .pos-cart .qty-input { width: 52px; }
  .pos-cart td { padding-left: .35rem; padding-right: .35rem; }
  .pos-cart .line-name { font-size: .9rem; }
  .pos-cart td.unit { display: none; } /* unit price stays visible in the line-edit dialog */
  .page-head h1 { font-size: 1.15rem; }
}

/* Language picker on sign-in and portal pages */
.lang-links { display: inline-flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: center; }
/* Indic scripts need a little more line height to avoid clipped matras */
:lang(hi), :lang(pa), :lang(mr), :lang(bn), :lang(gu), :lang(ta), :lang(te), :lang(kn), :lang(ml), :lang(or), :lang(as) { line-height: 1.6; }
