:root { --brand: #0f5132; --brand-2: #146c43; }
body { background: #f4f6f5; }
.bg-brand { background: var(--brand) !important; }
.btn-brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-2); color: #fff; }
.sidebar { width: 230px; flex: 0 0 230px; min-height: calc(100vh - 56px); background: #fff; border-right: 1px solid #e3e6e4; }
@media (min-width: 992px) { .sidebar { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; } }
.sidebar .nav-link { color: #334; border-radius: .4rem; padding: .45rem .7rem; }
.sidebar .nav-link i { width: 1.4rem; display: inline-block; }
.sidebar .nav-link.active, .sidebar .nav-link:hover { background: #e8f3ed; color: var(--brand); font-weight: 600; }
.main { min-width: 0; }
.card { border: 1px solid #e3e6e4; box-shadow: none; }
.stat .label { font-size: .8rem; color: #6c757d; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 1.45rem; font-weight: 700; }
.table-sm td, .table-sm th { vertical-align: middle; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table thead th { background: #f1f4f2; font-weight: 600; font-size: .85rem; }
.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; }
.typeahead { position: relative; }
.typeahead .results { position: fixed; z-index: 1065; max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid #ccd; border-radius: .3rem; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.typeahead .results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .35rem .6rem; }
.typeahead .results button:hover, .typeahead .results button.active { background: #e8f3ed; }
.report-table td.indent-1 { padding-left: 1.5rem; }
.report-table tr.total td { font-weight: 700; border-top: 2px solid #333; }
.report-table tr.subtotal td { font-weight: 600; border-top: 1px solid #999; }
.bar { background: var(--brand); height: 100%; border-radius: 2px 2px 0 0; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; }
.bars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bars small { font-size: .65rem; color: #6c757d; text-align: center; }
/* POS */
.pos-wrap { display: grid; grid-template-columns: 1fr 420px; gap: 1rem; }
@media (max-width: 991px) { .pos-wrap { grid-template-columns: 1fr; } }
.pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; max-height: 62vh; overflow-y: auto; }
.pos-products button { text-align: left; min-height: 78px; }
.pos-cart { max-height: 40vh; overflow-y: auto; }
.pos-total { font-size: 2rem; font-weight: 800; }
.offline-badge { display: none; }
body.offline .offline-badge { display: inline-block; }
@media print { body { background: #fff; } .main { padding: 0 !important; } }
/* receipt */
.receipt { width: 76mm; margin: 0 auto; font-family: 'Courier New', monospace; font-size: 12px; color: #000; }
.receipt table { width: 100%; }
.receipt .c { text-align: center; }
.receipt hr { border-top: 1px dashed #000; margin: 4px 0; opacity: 1; }
/* small screens */
@media (max-width: 575px) {
  .main { padding: .75rem !important; }
  .page-head h1 { font-size: 1.15rem; }
  .card-body { padding: .75rem; }
  .table-responsive > .table { margin-bottom: 0; }
  .navbar.sticky-top { flex-wrap: nowrap; gap: .35rem; }
  .navbar .navbar-brand { flex: 1 1 auto; min-width: 0; max-width: none; margin-right: 0 !important; font-size: 1.05rem; }
  .navbar form select { max-width: 7.5rem; }
  .navbar form { margin-right: 0 !important; }
  .report-table td:first-child, .report-table th:first-child { min-width: 11rem; }
  form.d-flex, .page-head > .d-flex, .page-head > div { flex-wrap: wrap; }
  form.d-flex > input[type=date] { flex: 1 1 8rem; min-width: 0; }
}

/* business logo */
.brand-logo { height: 28px; max-width: 90px; object-fit: contain; background: #fff; border-radius: 4px; padding: 2px; vertical-align: middle; }
.receipt-logo { max-height: 60px; max-width: 60mm; object-fit: contain; filter: grayscale(1); margin-bottom: 4px; }
.doc-logo { max-height: 64px; max-width: 160px; object-fit: contain; }
.logo-box { width: 120px; height: 80px; border: 1px dashed #ced4da; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* reprints */
.dup-banner { border: 2px solid #000; text-align: center; font-weight: 700; padding: 3px; margin: 6px 0; letter-spacing: .5px; }
.dup-banner small { font-weight: 400; letter-spacing: 0; }
/* A4 invoice */
.invoice { max-width: 190mm; margin: 0 auto; padding: 10mm 6mm; color: #000; font-size: 13px; background: #fff; }
.invoice h1 { font-size: 22px; letter-spacing: 1px; margin: 0; }
.invoice table.lines { width: 100%; border-collapse: collapse; margin-top: 12px; }
.invoice table.lines th { border-bottom: 2px solid #000; text-align: left; padding: 4px; font-size: 12px; }
.invoice table.lines td { border-bottom: 1px solid #ccc; padding: 4px; }
.invoice .num { text-align: right; white-space: nowrap; }
.invoice table.tot { margin-left: auto; min-width: 280px; margin-top: 8px; }
.invoice table.tot td { padding: 2px 4px; }
.invoice .grand td { border-top: 2px solid #000; font-weight: 700; font-size: 15px; }
.invoice .void-mark { color: #b00; border: 3px solid #b00; display: inline-block; padding: 2px 12px; font-weight: 700; transform: rotate(-4deg); }
@media print { .invoice { padding: 0; } .no-print { display: none !important; } }

/* POS: SMS receipt number box opens when the box is ticked (no script needed) */
.sms-rcpt #smsPhoneBox{display:none}
.sms-rcpt:has(#smsReceipt:checked) #smsPhoneBox{display:block}
