/* BillDesk page-level styles (on top of theme-2026.css) */

/* ---- Login (shared look) ---- */
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100dvh; }
.auth-hero { position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(900px 500px at 10% -10%, color-mix(in srgb, var(--hero-2) 90%, transparent), transparent 60%), radial-gradient(700px 500px at 110% 110%, color-mix(in srgb, var(--primary) 70%, transparent), transparent 55%), linear-gradient(135deg, var(--hero-1), var(--hero-2)); }
.auth-hero > * { position: relative; z-index: 1; }
.hero-brand { display: flex; align-items: center; gap: 12px; font-weight: 750; font-size: 1.15rem; }
.hero-brand .brand-mark { background: rgba(255,255,255,.18); box-shadow: none; border: 1px solid rgba(255,255,255,.25); }
.auth-hero h2 { color: #fff; font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.08; max-width: 14ch; }
.auth-hero p.lead { color: rgba(255,255,255,.8); max-width: 44ch; }
.hero-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.hero-points li { display: flex; gap: 12px; align-items: center; color: rgba(255,255,255,.92); font-weight: 500; }
.hero-points i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.16); font-size: .85rem; }
.hero-foot { font-size: .8rem; color: rgba(255,255,255,.65); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.035em; }
.auth-mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 28px; font-weight: 750; }
.field { position: relative; margin-bottom: 16px; }
.field > i.lead-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.field .form-control { padding-left: 42px; min-height: 50px; border-radius: 12px; }
.field .toggle-pw { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.btn-signin { width: 100%; min-height: 52px; border-radius: 12px; font-weight: 700; }
@media (max-width: 991.98px) { .auth { grid-template-columns: 1fr; } .auth-hero { display: none; } .auth-mobile-brand { display: flex; } .auth-panel { align-items: flex-start; padding-top: 40px; } }

/* ---- Toolbar / filters ---- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.toolbar .grow { flex: 1 1 220px; min-width: 0; }
.toolbar .form-label { margin-bottom: 4px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .82rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip:hover { color: var(--text); }
.chip.active, .chip[aria-current="true"] { background: var(--primary-soft); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
a.chip { text-decoration: none; }
.toolbar .chips.grow { flex: 1 1 100%; order: 10; }

/* ---- POS (v2: roomier cart, no overlapping numbers) ---- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 470px; gap: 22px; align-items: start; }
.pos-catalog { margin-bottom: 0; }
.pos-search { position: relative; }
.pos-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pos-search input { padding-left: 40px; min-height: 48px; border-radius: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; margin-top: 16px; }
.tile { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 100px; color: var(--text); transition: border-color .12s, transform .08s, box-shadow .12s; position: relative; }
.tile:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.tile:active { transform: scale(.98); }
.tile .t-name { font-weight: 600; font-size: .9rem; line-height: 1.25; padding-right: 22px; }
.tile .t-cat { font-size: .7rem; color: var(--muted); }
.tile .t-price { margin-top: auto; font-weight: 750; color: var(--primary); }
.tile .t-type { position: absolute; top: 10px; right: 10px; font-size: .75rem; color: var(--muted); }
.tile .t-stock { font-size: .7rem; font-weight: 600; color: var(--success); } .tile .t-stock.low { color: var(--warning); } .tile .t-stock.out { color: var(--danger); }
.tile.out { opacity: .5; }
.tile.custom { border-style: dashed; color: var(--muted); align-items: center; justify-content: center; text-align: center; }
.tile[hidden] { display: none; }

.pos-cart { position: sticky; top: calc(var(--topbar-h) + 16px); margin-bottom: 0; display: flex; flex-direction: column; max-height: calc(100dvh - var(--topbar-h) - 32px); }
.cart-head { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-weight: 650; font-size: 1.02rem; }
.cart-body { padding: 8px 24px 12px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.cart-section { padding: 18px 0; border-bottom: 1px dashed var(--border); } .cart-section:last-child { border-bottom: 0; }
.sec-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row.one { grid-template-columns: 1fr; }
.cart-section .form-label { font-size: .78rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.cart-hint { font-size: .78rem; color: var(--muted); margin-top: 10px; line-height: 1.4; }
.cart-lines { display: flex; flex-direction: column; gap: 12px; }
.cart-empty { text-align: center; color: var(--muted); padding: 26px 10px; border: 1px dashed var(--border); border-radius: 14px; }
.cart-line { padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 12px; }
.cl-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cl-name { font-weight: 650; font-size: .92rem; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
.cl-rm { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); }
.cl-rm:hover { background: var(--danger-soft); color: var(--danger); }
.cl-ctrls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; flex: none; }
.stepper button { width: 36px; height: 36px; border: 0; background: transparent; color: var(--text); font-weight: 700; font-size: 1.05rem; }
.stepper button:active { background: var(--surface-3); }
.stepper input { width: 46px; text-align: center; border: 0; background: transparent; font-weight: 650; color: var(--text); min-height: 36px; padding: 0; -moz-appearance: textfield; }
.cl-rate { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 110px; min-width: 110px; }
.cl-rate .x { color: var(--muted); white-space: nowrap; flex: none; }
.cl-price { width: 100%; min-width: 0; min-height: 38px !important; padding: 4px 10px !important; font-size: .9rem !important; border-radius: 10px !important; }
.cl-amt { margin-left: auto; font-weight: 750; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 92px; }
.disc-row { display: grid; grid-template-columns: 1fr; gap: 14px; }
.cart-foot { border-top: 1px solid var(--border); padding: 18px 24px 22px; background: var(--surface); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.tot-row { display: flex; justify-content: space-between; gap: 16px; font-size: .9rem; padding: 3px 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.tot-row span:last-child { white-space: nowrap; }
.tot-row.grand { color: var(--text); font-size: 1.3rem; font-weight: 800; padding: 10px 0 4px; }
.pos-bar { display: none; }
.save-wrap { margin-top: 16px; }
.method-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.method-grid input { position: absolute; opacity: 0; pointer-events: none; }
.method-grid label { display: block; text-align: center; padding: 10px 4px; border: 1px solid var(--border); border-radius: 10px; font-size: .82rem; font-weight: 600; cursor: pointer; background: var(--surface); }
.method-grid input:checked + label { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.pay-line { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch; }
.pay-line .input-group { grid-column: 1 / -1; flex-wrap: nowrap; }
.pay-line .input-group .form-control { min-width: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.pay-line .input-group-text { white-space: nowrap; }

@media (max-width: 1199.98px) { .pos { grid-template-columns: minmax(0, 1fr) 420px; } }
@media (max-width: 991.98px) {
  .pos { grid-template-columns: 1fr; }
  .pos-cart { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: 94dvh; max-height: 94dvh; display: block; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; z-index: 1060; border-radius: 22px 22px 0 0; margin: 0; transform: translateY(105%); transition: transform .3s cubic-bezier(.32,.72,0,1); box-shadow: var(--shadow-lg); }
  .pos-cart .cart-head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-radius: 22px 22px 0 0; }
  .pos-cart .cart-body { overflow: visible; }
  .pos-cart .cart-foot { border-radius: 0; border-top: 1px solid var(--border); padding-bottom: 0; }
  .pos-cart .save-wrap { position: sticky; bottom: 0; z-index: 3; background: var(--surface); margin: 14px -20px 0; padding: 12px 20px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); box-shadow: 0 -8px 20px rgba(15,23,42,.06); }
  .pos-cart.open { transform: none; }
  .cart-head, .cart-foot { padding-left: 20px; padding-right: 20px; } .cart-body { padding: 4px 20px 12px; }
  .pos-bar { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 1050; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border: 0; border-radius: 16px; font-weight: 700; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--on-primary); box-shadow: 0 12px 30px rgba(var(--primary-rgb), .45); }
  .pos-bar[disabled] { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.no-bottom-nav .main-content { padding-bottom: 104px; }
}
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; } .cl-rate { flex-basis: 100%; order: 3; } .cl-amt { min-width: 0; } .cart-body { padding-left: 16px; padding-right: 16px; } }

/* ---- Reports ---- */
.rep-tabs { margin-bottom: 16px; }
.chart-card canvas { width: 100% !important; max-height: 340px; }
.chart-wrap { position: relative; height: 300px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--border); }
.kpi.compact .kpi-value { font-size: 1.4rem; }
.kpi-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1199.98px) { .kpi-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .kpi-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chart-wrap { height: 240px; } }
.kpi .kpi-value.text { font-size: 1.15rem; }

/* Phones: date fields side by side, buttons share the row */
@media (max-width: 767.98px) {
  .toolbar > div { min-width: 0; }
  .toolbar input[type=date] { min-width: 0; width: 100%; }
  .toolbar > div:not(.grow) { flex: 1 1 130px; }
  .toolbar > .btn { flex: 1 1 120px; }
  .toolbar .d-flex.gap-2 { flex: 1 1 100%; } .toolbar .d-flex.gap-2 .btn { flex: 1; }
}

/* Wide report tables: scroll sideways, keep the first column pinned */
.table-scroll th, .table-scroll td { white-space: nowrap; }
.table-scroll tbody td:first-child, .table-scroll thead th:first-child, .table-scroll tfoot td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
.table-scroll thead th:first-child, .table-scroll tfoot td:first-child { background: var(--surface-2) !important; }
@media (max-width: 767.98px) { .kpi.compact .kpi-value { font-size: 1.12rem; } .kpi.compact { padding: 12px; } }

/* Summary strips */
.mini-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mini-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 767.98px) { .mini-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* WhatsApp preview bubble */
.wa-bubble { background: #dcf8c6; color: #111; border-radius: 4px 14px 14px 14px; padding: 12px 14px; font-size: .84rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; font-family: system-ui, 'Segoe UI Emoji', sans-serif; box-shadow: 0 1px 1px rgba(0,0,0,.1); }
[data-bs-theme="dark"] .wa-bubble { background: #005c4b; color: #e9edef; }
