:root {
  --brand-primary: #0f62fe;
  --brand-nav-bg: #111827;
  --brand-body-bg: #f4f6f8;
}
* { box-sizing: border-box; }
body { background: var(--brand-body-bg); color: #1f2937; margin: 0; }
a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container-fluid { width: 100%; padding-left: 16px; padding-right: 16px; }
.py-3 { padding-top: 16px; padding-bottom: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.me-3 { margin-right: 16px; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-2 { gap: 8px; }
.row { display: flex; flex-wrap: wrap; margin-left: -8px; margin-right: -8px; }
.g-3 > * { padding-left: 8px; padding-right: 8px; margin-bottom: 16px; }
.col-4 { width: 33.333%; }
.col-6 { width: 50%; }
.col-md-3, .col-md-6, .col-lg-4, .col-lg-5, .col-lg-7, .col-lg-8 { width: 100%; }
@media (min-width: 768px) {
  .col-md-3 { width: 25%; }
  .col-md-6 { width: 50%; }
}
@media (min-width: 992px) {
  .col-lg-4 { width: 33.333%; }
  .col-lg-5 { width: 41.666%; }
  .col-lg-7 { width: 58.333%; }
  .col-lg-8 { width: 66.666%; }
}
.navbar { padding: 10px 16px; }
.navbar .container-fluid { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 0; }
.bg-dark { background: var(--brand-nav-bg); }
.navbar-dark, .navbar-dark a, .navbar-text { color: #fff; }
.navbar-brand { font-weight: 700; font-size: 1.05rem; }
.navbar-nav { display: flex; gap: 10px; list-style: none; padding-left: 0; margin: 0; align-items: center; }
.nav-item { position: relative; }
.nav-link { color: #dbeafe; }
.nav-primary .nav-link { background: var(--brand-primary); color: #fff; border-radius: 6px; padding: 7px 12px; }
.nav-menu { position: relative; }
.nav-menu summary { list-style: none; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu-btn { border: 0; background: #1f2937; font: inherit; cursor: pointer; padding: 7px 11px; border-radius: 6px; display: block; }
.nav-menu-btn::after { content: "▾"; font-size: .72rem; margin-left: 6px; color: #93c5fd; }
.nav-menu[open] .nav-menu-btn { background: #334155; color: #fff; }
.nav-menu[open] .nav-menu-btn::after { content: "▴"; }
.nav-submenu { display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; background: #fff; border: 1px solid #d7dee7; border-radius: 8px; box-shadow: 0 12px 28px rgba(15, 23, 42, .18); padding: 6px; z-index: 30; }
.nav-menu[open] .nav-submenu { display: block; }
.nav-submenu a { display: block; color: #111827; padding: 9px 10px; border-radius: 6px; white-space: nowrap; }
.nav-submenu a:hover { background: #eff6ff; color: var(--brand-primary); text-decoration: none; }
.navbar-collapse { display: flex; align-items: center; flex: 1; gap: 12px; flex-wrap: wrap; }
.me-auto { margin-right: auto; }
.sticky-top { position: sticky; top: 0; z-index: 10; }
.form-label { display: block; font-weight: 600; margin-bottom: 4px; }
.form-control, .form-select, textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 9px 10px; background: #fff; color: #111827; }
.form-control:focus, .form-select:focus, textarea:focus { background: #fff; color: #111827; border-color: var(--brand-primary); outline: 2px solid rgba(15, 98, 254, .14); }
.form-control::placeholder, textarea::placeholder { color: #64748b; opacity: 1; }
.conteo-input { min-width: 120px; background: #fff !important; color: #111827 !important; font-weight: 700; }
.form-control-lg { font-size: 1.15rem; padding: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 6px; padding: 8px 12px; font-weight: 600; cursor: pointer; background: #e5e7eb; color: #111827; }
.btn:hover { text-decoration: none; filter: brightness(.98); }
.btn-lg { padding: 12px 16px; font-size: 1.05rem; }
.btn-sm { padding: 5px 8px; font-size: .85rem; }
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-success { background: #138a36; color: #fff; }
.btn-outline-primary { border-color: var(--brand-primary); color: var(--brand-primary); background: #fff; }
.btn-outline-secondary, .btn-outline-dark, .btn-outline-light { border-color: #64748b; background: transparent; color: inherit; }
.btn-outline-danger { border-color: #dc2626; color: #dc2626; background: #fff; }
.alert { border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid #e2e8f0; padding: 8px; text-align: left; }
.table-sm th, .table-sm td { padding: 6px; }
.table-responsive { overflow-x: auto; }
.badge { border-radius: 999px; padding: 4px 8px; font-size: .78rem; }
.text-bg-secondary { background: #64748b; color: #fff; }
.text-bg-warning { background: #f59e0b; color: #111827; }
.text-muted { color: #64748b; }
.small { font-size: .875rem; }
.list-group { border: 1px solid #dce3ea; border-radius: 8px; overflow: hidden; }
.list-group:empty { border: 0; }
.list-group-item { display: block; width: 100%; text-align: left; padding: 10px; border: 0; border-bottom: 1px solid #e2e8f0; background: #fff; }
.search-result-main { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.search-result-meta { display: grid; justify-items: end; gap: 2px; color: #111827; white-space: nowrap; }
.search-result-meta span { color: #64748b; font-size: .86rem; }
.float-end { float: right; }
.collapse:not(.show) { display: none; }
.navbar-collapse.show { display: flex; }
.navbar-toggler { display: none; border: 1px solid #475569; border-radius: 6px; background: #1f2937; color: #fff; padding: 7px 10px; }
.navbar-toggler-icon::before { content: "Menu"; font-weight: 700; font-size: .9rem; }
.login-bg { min-height: 100vh; display: grid; place-items: center; background: #e7edf3; }
.login-card { width: min(420px, calc(100% - 32px)); background: #fff; padding: 28px; border: 1px solid #d7dee7; border-radius: 8px; box-shadow: 0 10px 30px rgba(31, 41, 55, .08); }
.login-card h1 { font-size: 1.8rem; margin-bottom: .3rem; }
.panel, .pos-box { background: #fff; border: 1px solid #dce3ea; border-radius: 8px; padding: 16px; }
.panel h2, .pos-box h2 { font-size: 1.2rem; margin-bottom: 14px; }
.panel h3 { font-size: 1rem; margin-top: 10px; }
.metric { background: #fff; border: 1px solid #dce3ea; border-radius: 8px; padding: 16px; min-height: 96px; display: flex; flex-direction: column; justify-content: center; }
.metric span { color: #64748b; font-size: .9rem; }
.metric strong { font-size: 1.55rem; line-height: 1.2; }
.small-metric { min-height: 78px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sync-pill { color: #dbeafe; font-size: .9rem; display: flex; align-items: center; gap: 7px; }
.dot { width: 10px; height: 10px; display: inline-block; border-radius: 50%; background: #f59e0b; }
.dot.ok { background: #22c55e; }
.dot.warn { background: #f59e0b; }
.pos-total { background: #111827; color: #fff; border-radius: 8px; padding: 20px; display: flex; justify-content: space-between; align-items: center; }
.shortcut-help { text-align: right; }
.pos-total span { font-size: 1rem; color: #cbd5e1; }
.pos-total strong { font-size: 2rem; }
.qty-col { width: 110px; }
.pos-modal { display: none; position: fixed; inset: 0; z-index: 100; }
.pos-modal.show { display: block; }
.pos-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .58); }
.pos-modal-card { position: relative; background: #fff; width: min(720px, calc(100% - 28px)); margin: 42px auto; border-radius: 8px; padding: 18px; box-shadow: 0 24px 70px rgba(15, 23, 42, .32); }
.pos-modal-small { width: min(420px, calc(100% - 28px)); max-height: calc(100vh - 40px); overflow: auto; padding-bottom: 78px; }
.pos-modal-card h2 { margin: 0; font-size: 1.25rem; }
.pos-charge-total { background: #111827; color: #fff; border-radius: 8px; padding: 16px; display: flex; align-items: center; justify-content: space-between; }
.pos-charge-total span { color: #cbd5e1; }
.pos-charge-total strong { font-size: 2rem; }
.pay-rows { display: grid; gap: 8px; }
.pay-row { display: grid; grid-template-columns: 160px 1fr 1.3fr; gap: 8px; align-items: center; }
.payment-summary { border-top: 1px solid #e2e8f0; padding-top: 12px; display: grid; gap: 6px; }
.change-line { font-size: 1.2rem; color: #065f46; }
.subtle-option { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 8px 10px; }
.modal-actions { position: sticky; bottom: -78px; background: linear-gradient(rgba(255,255,255,.9), #fff 35%); padding-top: 12px; margin-bottom: -60px; }
.held-sales-list { display: grid; gap: 8px; }
.held-sale { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; background: #f8fafc; }
.held-sale-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.quote-pick-list { display: grid; gap: 8px; }
.quote-pick-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; background: #fff; }
.quote-pick-item.ok { background: #ecfdf5; border-color: #a7f3d0; }
.quote-pick-actions { display: flex; justify-content: flex-end; gap: 6px; }
.quote-manual-qty { width: 86px; }
.profit-row { margin-bottom: 12px; }
.bar { height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin: 5px 0; }
.bar span { display: block; height: 100%; background: #138a36; border-radius: inherit; }
.form-narrow { max-width: 520px; }
.ticket-print { background: #fff; width: 330px; padding: 16px; border: 1px dashed #94a3b8; }
.ticket-print h3 { font-size: 1.1rem; margin: 0 0 6px; }
.ticket-line { display: flex; justify-content: space-between; gap: 12px; }
.ticket-logo { text-align: center; margin-bottom: 8px; }
.ticket-logo img { max-height: 60px; max-width: 100%; }
.ticket-head { text-align: center; margin-bottom: 8px; }
.ticket-head .ticket-business { font-size: 1rem; font-weight: 700; }
.ticket-head .ticket-meta { font-size: .84rem; color: #475569; white-space: pre-line; }
.ticket-footer { text-align: center; font-size: .84rem; color: #334155; white-space: pre-line; }
.branding-swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.branding-swatch-card { display: flex; align-items: center; gap: 10px; border: 1px solid #dce3ea; border-radius: 8px; padding: 10px; background: #fff; }
.branding-swatch { width: 36px; height: 36px; border-radius: 999px; display: inline-block; }
.branding-swatch-border { border: 1px solid #cbd5e1; }
.branding-palette-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.branding-palette-btn { border: 1px solid #dce3ea; border-radius: 8px; padding: 10px; background: #fff; text-align: left; cursor: pointer; }
.branding-palette-btn:hover { border-color: var(--brand-primary); }
.branding-palette-btn b, .branding-palette-btn small { display: block; }
.branding-palette-btn small { color: #64748b; }
.branding-palette-colors { display: flex; gap: 6px; margin-bottom: 8px; }
.branding-palette-colors span { width: 24px; height: 24px; border-radius: 999px; display: inline-block; border: 1px solid rgba(15, 23, 42, .08); }
@media print {
    body { background: #fff; }
    nav, .no-print, main > .row, main > .alert { display: none !important; }
    .ticket-print { border: 0; width: 100%; }
    body.print-ticket-only nav,
    body.print-ticket-only .no-print,
    body.print-ticket-only main > .alert {
        display: none !important;
    }
    body.print-ticket-only main > .row {
        display: flex !important;
    }
    body.print-ticket-only * {
        visibility: hidden;
    }
    body.print-ticket-only #ticket,
    body.print-ticket-only #ticket * {
        visibility: visible;
    }
    body.print-ticket-only #ticket {
        position: absolute;
        left: 0;
        top: 0;
        width: 330px;
        border: 0;
        padding: 0;
    }
}
@media (max-width: 640px) {
  .pos-modal-card { margin: 12px auto; max-height: calc(100vh - 24px); overflow: auto; }
  .pay-row { grid-template-columns: 1fr; }
}

@media (min-width: 761px) {
  .navbar-collapse { display: flex !important; }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .container-fluid { padding-left: 10px; padding-right: 10px; }
  .py-3 { padding-top: 10px; padding-bottom: 10px; }
  .navbar { padding: 8px 10px; }
  .navbar .container-fluid { gap: 8px; align-items: center; }
  .navbar-brand { flex: 1; font-size: 1rem; }
  .navbar-toggler { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; }
  .navbar-collapse { display: none; width: 100%; flex: 0 0 100%; flex-direction: column; align-items: stretch; gap: 10px; padding-top: 8px; }
  .navbar-collapse.show { display: flex; }
  .navbar-nav { width: 100%; flex-direction: column; align-items: stretch; gap: 8px; }
  .nav-item, .nav-menu { position: static; width: 100%; }
  .nav-link, .nav-menu-btn, .nav-primary .nav-link { display: block; width: 100%; padding: 10px 12px; text-align: left; }
  .nav-submenu { position: static; box-shadow: none; margin-top: 4px; min-width: 100%; border-radius: 6px; padding: 4px; }
  .nav-submenu a { white-space: normal; padding: 10px; }
  .sync-pill, .navbar-text, .navbar-collapse > .btn { width: 100%; margin-right: 0; }
  .row { margin-left: 0; margin-right: 0; gap: 10px; }
  .g-3 > * { padding-left: 0; padding-right: 0; margin-bottom: 0; }
  .col-4, .col-6, .col-md-3, .col-md-6, .col-lg-4, .col-lg-5, .col-lg-7, .col-lg-8 { width: 100%; }
  .panel, .pos-box, .metric { padding: 12px; border-radius: 7px; }
  .panel h2, .pos-box h2 { font-size: 1.05rem; margin-bottom: 10px; }
  .d-flex { flex-wrap: wrap; }
  form.d-flex > .form-control, form.d-flex > .form-select, form.d-flex > .btn, form.d-flex > a.btn { flex: 1 1 100%; width: 100%; }
  .btn { min-height: 40px; padding: 9px 11px; }
  .btn-sm { min-height: 34px; }
  .table-responsive { margin-left: -12px; margin-right: -12px; padding: 0 12px 4px; -webkit-overflow-scrolling: touch; }
  .table { min-width: 680px; font-size: .9rem; }
  .table th, .table td { padding: 7px 6px; }
  .quick-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .quick-actions .btn { width: 100%; }
  .metric { min-height: 74px; }
  .metric strong { font-size: 1.3rem; }
  .pos-total { padding: 14px; align-items: flex-start; gap: 8px; flex-direction: column; }
  .pos-total strong, .pos-charge-total strong { font-size: 1.65rem; }
  .shortcut-help { text-align: left; }
  .held-sale, .quote-pick-item { align-items: stretch; flex-direction: column; }
  .search-result-main { align-items: flex-start; flex-direction: column; gap: 6px; }
  .search-result-meta { justify-items: start; }
  .held-sale-actions, .quote-pick-actions { justify-content: stretch; }
  .held-sale-actions .btn, .quote-pick-actions .btn { flex: 1 1 auto; }
  .quote-manual-qty { width: 100%; }
  .pos-modal-card { width: calc(100% - 16px); margin: 8px auto; padding: 14px; }
  .pos-modal-small { padding-bottom: 64px; }
  .modal-actions { bottom: -64px; }
  .pos-charge-total { padding: 13px; flex-direction: column; align-items: flex-start; gap: 4px; }
  .ticket-print { width: 100%; max-width: 360px; }
  .branding-swatches, .branding-palette-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .container-fluid { padding-left: 8px; padding-right: 8px; }
  .panel, .pos-box, .metric { padding: 10px; }
  .form-control, .form-select, textarea { padding: 8px 9px; }
  .table { font-size: .85rem; }
  .pos-total strong, .pos-charge-total strong { font-size: 1.45rem; }
}
