/* ==========================================================================
   Firecracker Store - design system
   Warm "diwali" accent (saffron/ember) on a clean slate UI, dark sidebar.
   ========================================================================== */
:root {
  --brand: #e8590c;
  --brand-dark: #c2410c;
  --brand-soft: #fff1e6;
  --gold: #f59f00;
  --ink: #1f2430;
  --ink-2: #4b5365;
  --muted: #7b8396;
  --line: #e6e9f0;
  --bg: #f4f5f9;
  --card: #ffffff;
  --side: #1a1d29;
  --side-2: #232738;
  --ok: #12a150;
  --warn: #f59f00;
  --bad: #e03131;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .05), 0 4px 14px rgba(20, 24, 40, .05);
  --sb-w: 252px;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
  --bs-link-color: var(--brand-dark);
  --bs-link-hover-color: var(--brand);
}
body { background: var(--bg); font-size: .92rem; color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.01em; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.text-muted { color: var(--muted) !important; }

/* ---------- layout ---------- */
.app-shell { display: flex; min-height: 100vh; }
.content { flex: 1; min-width: 0; padding: 1.5rem 1.75rem 3rem; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1.1rem; }
.page-head h1 { font-size: 1.4rem; margin: 0; }
.page-sub { color: var(--muted); font-size: .85rem; }

/* ---------- sidebar ---------- */
.sidebar { width: var(--sb-w); background: var(--side) !important; --bs-offcanvas-bg: var(--side); --bs-offcanvas-color: #c9cedd; color: #c9cedd; display: flex; flex-direction: column; flex-shrink: 0; border: 0; }
@media (min-width: 992px) { .sidebar { position: sticky; top: 0; height: 100vh; } }
.sidebar .offcanvas-header { border-bottom: 1px solid rgba(255, 255, 255, .08); color: #fff; }
.sidebar .btn-close { filter: invert(1); }
.sidebar-brand { align-items: center; gap: .7rem; padding: 1.15rem 1.2rem; font-weight: 700; color: #fff; font-size: 1.02rem; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--gold), var(--brand)); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem; flex-shrink: 0; box-shadow: 0 4px 10px rgba(232, 89, 12, .4); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .6rem .7rem; }
.nav-heading { font-size: .66rem; text-transform: uppercase; letter-spacing: .09em; color: #7d849b; padding: 1rem .8rem .35rem; }
.nav-link-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .8rem; border-radius: 10px; color: #c9cedd; font-weight: 500; text-decoration: none !important; transition: background .12s, color .12s; }
.nav-link-item i { font-size: 1.05rem; opacity: .85; width: 1.2rem; text-align: center; }
.nav-link-item:hover { background: var(--side-2); color: #fff; }
.nav-link-item.active { background: linear-gradient(90deg, rgba(232, 89, 12, .95), rgba(245, 159, 0, .85)); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(232, 89, 12, .3); }
.nav-link-item.active i { opacity: 1; }
.sidebar-foot { padding: .9rem; border-top: 1px solid rgba(255, 255, 255, .07); }
.sidebar-foot .small { color: #9aa1b7 !important; }
.sidebar-foot .btn { color: #dfe3ef; border-color: rgba(255, 255, 255, .2); }
.sidebar-foot .btn:hover { background: var(--side-2); color: #fff; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { background: transparent !important; border-bottom: 1px solid var(--line); font-weight: 600; padding: .85rem 1.1rem; }
.card-body { padding: 1.1rem; }
.stat-card { overflow: hidden; }
.stat-card .card-body { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; background: var(--brand-soft); color: var(--brand-dark); }
.stat-icon.green { background: #e6f7ee; color: var(--ok); }
.stat-icon.blue { background: #e7f0ff; color: #2f6fe4; }
.stat-icon.gold { background: #fff6dc; color: #b27800; }
.stat-icon.red { background: #ffe9e9; color: var(--bad); }
.stat-icon.violet { background: #f0eaff; color: #6f42c1; }
.stat-card .label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat-card .value { font-size: 1.45rem; font-weight: 800; line-height: 1.15; }

/* ---------- buttons / forms ---------- */
.btn { border-radius: 10px; font-weight: 600; padding: .5rem .95rem; }
.btn-sm { padding: .3rem .65rem; border-radius: 8px; }
.btn-lg { border-radius: 12px; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); box-shadow: 0 2px 8px rgba(232, 89, 12, .25); }
.btn-outline-primary { --bs-btn-color: var(--brand-dark); --bs-btn-border-color: #f0b999; --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark); }
.btn-outline-secondary { --bs-btn-color: var(--ink-2); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: #eef0f6; --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #d6dae6; }
.btn-success { --bs-btn-bg: var(--ok); --bs-btn-border-color: var(--ok); --bs-btn-hover-bg: #0e8742; --bs-btn-hover-border-color: #0e8742; }
.form-control, .form-select { border-radius: 10px; border-color: #d9dde8; padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .22rem rgba(232, 89, 12, .15); }
.form-label { font-weight: 600; font-size: .82rem; color: var(--ink-2); margin-bottom: .3rem; }
.form-text { color: var(--muted); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.input-group > .btn { border-radius: 0 10px 10px 0; }
.input-group > .form-control:first-child { border-radius: 10px 0 0 10px; }
.alert { border-radius: 12px; border: 0; }
.badge { font-weight: 600; border-radius: 999px; padding: .38em .7em; }
.nav-pills .nav-link { color: var(--ink-2); border-radius: 999px; font-weight: 600; }
.nav-pills .nav-link.active { background: var(--brand) !important; color: #fff; }
.pagination .page-link { color: var(--brand-dark); border-radius: 8px; margin: 0 2px; }
.pagination .active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.modal-content { border: 0; border-radius: 18px; box-shadow: 0 20px 60px rgba(20, 24, 40, .25); }
.modal-header { border-bottom: 1px solid var(--line); }

/* ---------- tables ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead > tr > th { background: #f8f9fc; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table > :not(caption) > * > * { padding: .7rem .85rem; border-color: var(--line); }
.table-hover > tbody > tr:hover > * { background: #fffaf5; }
.table-sm-text td, .table-sm-text th { font-size: .86rem; }
.card > .table-responsive:first-child > .table > thead > tr:first-child > th:first-child { border-top-left-radius: var(--radius); }
.card > .table-responsive:first-child > .table > thead > tr:first-child > th:last-child { border-top-right-radius: var(--radius); }
.money { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.empty-state { text-align: center; color: var(--muted); padding: 2.2rem 1rem; }
.empty-state i { font-size: 2rem; display: block; margin-bottom: .4rem; opacity: .5; }

/* ---------- POS ---------- */
.pos-results { max-height: 340px; overflow-y: auto; border-radius: 12px; border: 1px solid var(--line); }
.pos-result { cursor: pointer; border-color: var(--line); }
.pos-result:hover, .pos-result.active { background: var(--brand-soft); color: var(--ink); }
.qty-box { width: 124px; }
.qty-box input { text-align: center; font-weight: 700; }
.totals-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem; }
.totals-box .row-line { display: flex; justify-content: space-between; padding: .25rem 0; color: var(--ink-2); }
.totals-box .grand { font-size: 1.65rem; font-weight: 800; color: var(--ink); border-top: 2px dashed var(--line); margin-top: .5rem; padding-top: .65rem; }
.pay-btn { padding: .95rem; font-size: 1.05rem; font-weight: 700; border-radius: 12px; }
.pay-amount { font-size: 2.4rem; font-weight: 800; background: linear-gradient(90deg, var(--brand-dark), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
#qrBox canvas, #qrBox img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); padding: 8px; background: #fff; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: radial-gradient(1000px 500px at 80% -10%, rgba(245, 159, 0, .25), transparent), radial-gradient(800px 500px at -10% 110%, rgba(232, 89, 12, .22), transparent), var(--bg); }
.login-card { width: 100%; max-width: 410px; border-radius: 20px; }

/* ---------- phones & small tablets ---------- */
img { max-width: 100%; }
@media (max-width: 767px) {
  .content { padding: 1rem .85rem 2.5rem; }
  .page-head h1 { font-size: 1.2rem; }
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody { display: block; }
  .cart-table tr { display: block; padding: .7rem .85rem; border-bottom: 1px solid var(--line); }
  .cart-table td { display: flex; justify-content: space-between; align-items: center; border: 0 !important; padding: .2rem 0 !important; text-align: right; }
  .cart-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .78rem; text-align: left; }
  .cart-table td.cart-name { display: block; text-align: left; font-weight: 700; }
  .cart-table td[colspan] { display: block; text-align: center; }
  .cart-table td:last-child { justify-content: flex-end; }
  .qty-box { width: 140px; }
  .pay-amount { font-size: 1.9rem; }
  .totals-box .grand { font-size: 1.35rem; }
  .pos-results { max-height: 50vh !important; }
  .table-responsive { -webkit-overflow-scrolling: touch; }
  .stat-card .value { font-size: 1.15rem; }
  .stat-icon { width: 38px; height: 38px; font-size: 1.05rem; }
  .form-control-lg, .form-select-lg { font-size: 1rem; }
  .btn, .form-control, .form-select { min-height: 42px; }
  .nav-pills .nav-link { padding: .3rem .7rem !important; font-size: .85rem; }
}
