:root{
  --app-bg:#f3f5f9;
  --surface:#ffffff;
  --surface-soft:#f8fafc;
  --line:#e6ebf2;
  --text:#172033;
  --muted:#6c7892;
  --primary:#2f6fed;
  --primary-2:#5b21b6;
  --dark:#101828;
  --success:#16a34a;
  --warning:#d97706;
  --danger:#dc2626;
  --shadow:0 12px 40px rgba(15,23,42,.08);
  --radius:22px;
}
html,body{height:100%}
body{background:var(--app-bg);color:var(--text);font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif}
a{text-decoration:none}
img{max-width:100%;height:auto}
.app-shell{display:flex;min-height:100vh}
.sidebar{width:280px;background:linear-gradient(180deg,#111827 0%,#18243b 100%);padding:24px 18px;flex-direction:column;gap:22px;position:sticky;top:0;height:100vh}
.sidebar-brand{display:flex;align-items:center;gap:14px;padding:6px 8px 12px}
.brand-mark{width:48px;height:48px;border-radius:16px;background:linear-gradient(135deg,#60a5fa,#7c3aed);display:grid;place-items:center;font-weight:800;color:#fff;letter-spacing:.08em}
.brand-name{font-size:1.15rem;font-weight:700;color:#fff}
.brand-caption{font-size:.82rem;color:rgba(255,255,255,.55)}
.sidebar-nav{display:flex;flex-direction:column;gap:8px}
.sidebar-link{display:flex;align-items:center;gap:12px;padding:13px 14px;border-radius:16px;color:rgba(255,255,255,.82);font-weight:500;transition:.2s ease}
.sidebar-link i{font-size:1.1rem;width:20px;text-align:center}
.sidebar-link:hover,.sidebar-link.active{background:rgba(255,255,255,.12);color:#fff;transform:translateY(-1px)}
.sidebar-footer{margin-top:auto;padding:10px 12px;border-radius:16px;background:rgba(255,255,255,.06)}
.main-content{flex:1;padding:24px;min-width:0}
.desktop-topbar{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:24px}
.page-title{font-size:1.8rem;font-weight:800;letter-spacing:-.02em}
.page-subtitle{color:var(--muted)}
.topbar-actions{display:flex;align-items:center;gap:12px}
.user-pill{display:flex;flex-direction:column;align-items:flex-end;padding:10px 14px;background:rgba(255,255,255,.85);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:18px}
.user-pill-name{font-weight:700}
.user-pill-role{font-size:.82rem;color:var(--muted)}
.mobile-appbar{position:sticky;top:0;z-index:1025;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;background:rgba(255,255,255,.92);backdrop-filter:blur(12px);border-bottom:1px solid var(--line)}
.brand-title{font-weight:800;font-size:1rem}
.brand-subtitle{font-size:.78rem;color:var(--muted)}
.btn-icon{width:42px;height:42px;display:grid;place-items:center;padding:0;border-radius:14px;background:#fff;border:1px solid var(--line);box-shadow:0 6px 20px rgba(15,23,42,.06)}
.btn-ghost-danger{color:var(--danger)}
.card-stat,.table-card,.panel-card,.app-card{border:1px solid rgba(230,235,242,.92);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow)}
.card-stat .card-body,.table-card .card-header,.table-card .card-body,.panel-card .card-body,.app-card .card-body{padding:20px}
.table-card{overflow:hidden}
.table-card .card-header{background:var(--surface);border-bottom:1px solid var(--line);font-weight:700}
.app-alert{border:none;border-radius:18px;box-shadow:var(--shadow)}
.form-control,.form-select{min-height:46px;border-radius:14px;border-color:#d8dfeb}
.form-control:focus,.form-select:focus{box-shadow:0 0 0 .18rem rgba(47,111,237,.14);border-color:#9bb8fb}
textarea.form-control{min-height:110px}
.btn{border-radius:14px;min-height:44px;font-weight:600}
.btn-sm{min-height:38px;border-radius:12px}
.metric-label{font-size:.92rem;color:var(--muted);margin-bottom:10px}
.metric-value{font-size:1.7rem;font-weight:800;letter-spacing:-.03em;margin:0}
.metric-icon{width:46px;height:46px;border-radius:16px;display:grid;place-items:center;background:var(--surface-soft);font-size:1.2rem}
.metrics-grid .card-body{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}
.section-heading{font-size:1.05rem;font-weight:800;margin:0}
.section-subtitle{font-size:.88rem;color:var(--muted)}
.table{margin-bottom:0}
.table thead th{font-size:.82rem;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.04em;background:#fbfcfe;border-bottom:1px solid var(--line)}
.table td,.table th{vertical-align:middle;padding:14px 16px}
.table-responsive{-webkit-overflow-scrolling:touch}
.badge{border-radius:999px;padding:.5em .72em;font-weight:700}
.filter-bar{display:flex;flex-wrap:wrap;gap:10px;align-items:end}
.filter-bar .field{min-width:160px;flex:1}
.compact-form .field{min-width:140px;flex:1}
.product-thumb{width:58px;height:58px;object-fit:cover;border-radius:16px;border:1px solid var(--line);background:#fff}
.kpi-chip{display:inline-flex;align-items:center;gap:8px;padding:10px 12px;background:var(--surface-soft);border:1px solid var(--line);border-radius:999px;font-size:.86rem;font-weight:600}
.empty-state{padding:32px 20px;text-align:center;color:var(--muted)}
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px;background:radial-gradient(circle at top left,#4f46e5,#0f172a 70%)}
.login-card{width:min(100%,460px);border:none;border-radius:28px;overflow:hidden;box-shadow:0 22px 60px rgba(0,0,0,.28)}
.login-banner{padding:28px 28px 18px;background:linear-gradient(135deg,#0f172a,#1d4ed8);color:#fff}
.login-body{padding:28px}
.sidebar-mobile .offcanvas-header{padding:18px 18px 14px}
.sidebar-mobile .offcanvas-header{background:#0f172a;color:#fff;border-color:rgba(255,255,255,.08)!important}
.sidebar-mobile .offcanvas-title,.sidebar-mobile .offcanvas-header .small{color:#fff!important}
.sidebar-mobile .btn-close{filter:invert(1) grayscale(100%)}
.sidebar-mobile .offcanvas-body{background:linear-gradient(180deg,#0f172a 0%,#111827 100%)}
.sidebar-mobile .sidebar-link{color:rgba(255,255,255,.9);background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.06)}
.sidebar-mobile .sidebar-link:hover,.sidebar-mobile .sidebar-link.active{background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;border-color:transparent;box-shadow:0 10px 24px rgba(37,99,235,.28)}
.invoice-shell{max-width:980px;margin:28px auto;padding:0 14px}
.invoice-card{border:none;border-radius:28px;box-shadow:var(--shadow)}
.invoice-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;flex-wrap:wrap}
.invoice-brand{display:flex;align-items:center;gap:12px}
.invoice-brand-mark{width:54px;height:54px;border-radius:18px;background:linear-gradient(135deg,#60a5fa,#7c3aed);color:#fff;display:grid;place-items:center;font-weight:800}
.invoice-meta{padding:14px 16px;border-radius:18px;background:var(--surface-soft);border:1px solid var(--line)}
.pos-layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(340px,.8fr);gap:20px}
.pos-panel{background:var(--surface);border:1px solid var(--line);border-radius:26px;box-shadow:var(--shadow);overflow:hidden}
.pos-panel-header{padding:18px 18px 14px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap}
.pos-panel-body{padding:18px}
.product-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}
.product-card{border:1px solid var(--line);border-radius:20px;background:linear-gradient(180deg,#fff 0%,#fbfdff 100%);padding:12px;display:flex;flex-direction:column;gap:10px;transition:.2s ease;cursor:pointer}
.product-card:hover{transform:translateY(-2px);box-shadow:0 10px 20px rgba(15,23,42,.07)}
.product-card.disabled{opacity:.55;cursor:not-allowed;background:#f8fafc}
.product-card-top{display:flex;gap:10px;align-items:center}
.product-card img{width:58px;height:58px;border-radius:16px;object-fit:cover;border:1px solid var(--line)}
.product-card h6{margin:0;font-size:.96rem;font-weight:700}
.product-card .small{color:var(--muted)}
.product-meta{display:flex;justify-content:space-between;gap:8px;align-items:center;font-size:.85rem}
.cart-list{display:flex;flex-direction:column;gap:12px;max-height:390px;overflow:auto;padding-right:2px}
.cart-item{border:1px solid var(--line);border-radius:20px;padding:12px;background:#fff}
.cart-item-head{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}
.cart-item-title{font-weight:700;margin:0 0 2px;font-size:.95rem}
.cart-item-sub{font-size:.82rem;color:var(--muted)}
.qty-controls{display:flex;align-items:center;gap:8px}
.qty-controls .btn{width:34px;min-height:34px;height:34px;padding:0;border-radius:12px}
.summary-box{border:1px solid var(--line);border-radius:22px;background:var(--surface-soft);padding:16px}
.summary-row{display:flex;justify-content:space-between;gap:16px;padding:8px 0;font-size:.95rem}
.summary-row.total{padding-top:12px;margin-top:8px;border-top:1px dashed #cfd8e6;font-size:1.08rem;font-weight:800}
.sticky-card{position:sticky;top:24px}
.mobile-stack{display:none}
.desktop-only{display:block}
@media (max-width:1199.98px){
  .pos-layout{grid-template-columns:1fr}
  .sticky-card{position:static}
}
@media (max-width:991.98px){
  .app-shell{display:block}
  .main-content{padding:16px}
  .desktop-topbar{display:none!important}
  .metric-value{font-size:1.45rem}
}
@media (max-width:767.98px){
  body{font-size:.95rem}
  .main-content{padding:12px}
  .card-stat .card-body,.table-card .card-header,.table-card .card-body,.panel-card .card-body,.app-card .card-body{padding:16px}
  .filter-bar,.compact-form{flex-direction:column;align-items:stretch}
  .filter-bar .field,.compact-form .field{width:100%;min-width:100%}
  .product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .mobile-stack{display:block}
  .desktop-only{display:none}
  .responsive-table table thead{display:none}
  .responsive-table table,.responsive-table tbody,.responsive-table tr,.responsive-table td{display:block;width:100%}
  .responsive-table table tr{padding:10px 12px;border-bottom:1px solid var(--line)}
  .responsive-table table td{padding:8px 0;border:none!important;white-space:normal}
  .responsive-table table td::before{content:attr(data-label);display:block;font-size:.74rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin-bottom:4px}
}
@media (max-width:575.98px){
  .mobile-appbar{padding:10px 12px}
  .product-grid{grid-template-columns:1fr 1fr;gap:10px}
  .product-card{padding:10px;border-radius:18px}
  .cart-list{max-height:none}
  .invoice-shell{margin:14px auto;padding:0 8px}
  .invoice-head{gap:10px}
  .invoice-meta{width:100%}
  .btn{width:100%}
  .btn-group>.btn{width:auto}
  .stack-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
}
@media print{
  .no-print,.mobile-appbar,.sidebar,.desktop-topbar{display:none!important}
  .main-content{padding:0}
  body{background:#fff}
}
.sidebar-logo{width:48px;height:48px;border-radius:16px;object-fit:cover;border:1px solid rgba(255,255,255,.2);background:#fff}
.settings-logo-preview{width:96px;height:96px;border-radius:20px;object-fit:cover;border:1px solid var(--line);background:#fff}
.barcode-preview-box{border:1px dashed var(--line);border-radius:18px;padding:12px;background:var(--surface-soft);display:flex;justify-content:center;align-items:center;min-height:92px}
.scanner-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;margin-bottom:14px}
.scanner-wrap{border:1px solid var(--line);border-radius:18px;padding:12px;background:#fff;margin-bottom:16px}
#reader{width:100%}
.refund-box{padding:10px;border:1px solid var(--line);border-radius:14px;background:var(--surface-soft)}
@media (max-width:575.98px){.scanner-toolbar{grid-template-columns:1fr}.sidebar-logo{width:42px;height:42px}}
/* v2.6 polish */
.dashboard-actions{display:flex;gap:10px;flex-wrap:wrap}
.social-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;background:rgba(255,255,255,.08)!important}
.social-footer a{width:34px;height:34px;border-radius:12px;display:grid;place-items:center;color:#fff;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.08)}
.social-footer a:hover{background:#2563eb;color:#fff;transform:translateY(-1px)}
.mobile-social{background:transparent!important;justify-content:flex-start}.mobile-social a{background:rgba(255,255,255,.08)}
.sidebar-logo{background:#fff;padding:3px}
@media (max-width:767.98px){.metrics-grid .col-6{width:100%}.card-stat .card-body{min-height:110px}.section-heading{font-size:1.12rem}.table-card{border-radius:18px}.product-card h6{font-size:.9rem}.pos-panel{border-radius:20px}}
.receipt-body,.label-body{background:#f3f5f9;color:#111;font-family:Arial,Helvetica,sans-serif}.receipt-toolbar{max-width:420px;margin:18px auto;display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}.thermal-receipt{width:80mm;max-width:100%;margin:0 auto 24px;background:#fff;padding:10px 9px;color:#000;font-size:12px;line-height:1.25;box-shadow:0 10px 30px rgba(15,23,42,.12)}.receipt-center{text-align:center}.receipt-logo{width:46px;height:46px;object-fit:contain;margin-bottom:4px}.receipt-shop{font-size:18px;font-weight:800;line-height:1.1}.receipt-title{font-size:12px;font-weight:700;text-transform:uppercase;margin-top:5px}.receipt-line{border-top:1px dashed #000;margin:8px 0}.receipt-meta div,.receipt-totals div{display:flex;justify-content:space-between;gap:8px}.receipt-table{width:100%;border-collapse:collapse;font-size:11px}.receipt-table th{border-bottom:1px solid #000;font-weight:700}.receipt-table td,.receipt-table th{padding:3px 0;vertical-align:top}.receipt-table td:first-child{width:44%;word-break:break-word}.receipt-totals .grand{font-size:14px;font-weight:800;border-top:1px dashed #000;margin-top:5px;padding-top:5px}.receipt-footer-text{font-size:11px}.label-sheet{width:210mm;max-width:100%;margin:0 auto;padding:8mm;background:#fff;display:grid;grid-template-columns:repeat(3,1fr);gap:4mm;box-shadow:0 10px 30px rgba(15,23,42,.12)}.barcode-label{height:34mm;border:1px dashed #ddd;padding:2.5mm;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;overflow:hidden}.label-product-name{font-size:10px;font-weight:700;line-height:1.1;max-height:22px;overflow:hidden}.barcode-svg{width:100%;height:13mm}.label-barcode-number{font-size:9px;letter-spacing:.04em;margin-top:1px}.label-price{font-size:12px;font-weight:900;margin-top:1px}.coupon-badge{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;background:#eef2ff;color:#3730a3;font-weight:700;font-size:.82rem}
@media print{body.receipt-body{background:#fff}.receipt-toolbar{display:none!important}.thermal-receipt{width:80mm;margin:0;box-shadow:none;padding:2mm}.label-body{background:#fff}.label-sheet{width:210mm;box-shadow:none;margin:0;padding:5mm;gap:3mm;page-break-inside:avoid}.barcode-label{border:0}.no-print{display:none!important}@page{margin:0}}
@media print and (max-width:90mm){@page{size:80mm auto;margin:0}.thermal-receipt{width:80mm}}

/* v2.6.1 reports + mobile layout repair */
.page-heading{min-width:0}
.report-period-buttons{gap:6px}
.report-period-buttons .btn{border-radius:12px!important}
.report-filter-card .filter-bar{align-items:end}
.report-filter-actions{display:flex;gap:10px}
.report-filter-actions .btn{min-height:44px}
.metrics-grid{clear:both}
.metrics-grid > [class*="col-"]{display:flex}
.metrics-grid .card-stat{width:100%}
.reports-content-grid .table-card{min-width:0;overflow:hidden}
@media (max-width:767.98px){
  .report-period-buttons{display:grid!important;grid-template-columns:1fr 1fr;width:100%}
  .report-period-buttons .btn{width:100%}
  .report-filter-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .metrics-grid .col-12{width:100%}
}
@media (max-width:575.98px){
  .report-filter-actions{grid-template-columns:1fr}
}

/* v2.6.2 print + POS completion polish */
.sale-success-modal{border:0;border-radius:28px;box-shadow:0 28px 80px rgba(15,23,42,.22);overflow:hidden}
.sale-success-modal .modal-body{background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)}
.sale-success-icon{width:78px;height:78px;margin:0 auto;border-radius:50%;display:grid;place-items:center;background:#dcfce7;color:#16a34a;font-size:42px;border:6px solid #f0fdf4}
.receipt-body{background:linear-gradient(180deg,#edf2f7 0%,#f8fafc 100%);min-height:100vh;padding:12px}
.receipt-toolbar{max-width:720px;margin:18px auto;align-items:center;background:#fff;border:1px solid #e6ebf2;border-radius:22px;padding:12px;box-shadow:0 14px 34px rgba(15,23,42,.08)}
.receipt-toolbar .btn{min-height:42px}
.thermal-receipt{border-radius:8px;border:1px solid #e5e7eb;position:relative;font-family:'Courier New',Consolas,monospace}
.thermal-receipt:before{content:'80mm thermal receipt preview';position:absolute;left:50%;top:-30px;transform:translateX(-50%);font-family:Inter,Arial,sans-serif;font-size:12px;color:#64748b;background:#fff;border:1px solid #e6ebf2;border-radius:999px;padding:4px 10px;box-shadow:0 8px 18px rgba(15,23,42,.06)}
.receipt-shop{font-family:Arial,Helvetica,sans-serif;letter-spacing:.02em}
.receipt-logo{border-radius:10px;background:#fff;padding:2px}
.receipt-title{display:inline-block;border:1px solid #111;border-radius:999px;padding:2px 8px;margin-top:7px;letter-spacing:.04em}
.receipt-meta div{padding:1px 0}.receipt-meta span{color:#111}.receipt-table thead th{font-size:10px;text-transform:uppercase;letter-spacing:.02em}.receipt-table tbody tr+tr td{border-top:1px dotted #cfcfcf}.receipt-totals div{padding:2px 0}.receipt-totals .grand{font-size:15px;background:#f4f4f4;padding:6px 4px}.receipt-footer-text{padding-bottom:4px}
.label-body{background:linear-gradient(180deg,#eef2f7 0%,#f8fafc 100%);min-height:100vh;padding:12px}.label-body .receipt-toolbar{max-width:980px}.label-sheet{border-radius:18px;border:1px solid #e6ebf2;position:relative}.label-sheet:before{content:'Barcode label sheet preview';position:absolute;left:16px;top:-31px;font-family:Inter,Arial,sans-serif;font-size:12px;color:#64748b;background:#fff;border:1px solid #e6ebf2;border-radius:999px;padding:4px 10px;box-shadow:0 8px 18px rgba(15,23,42,.06)}
.barcode-label{border:1px solid #d9dee8;border-radius:6px;background:#fff;box-shadow:0 2px 4px rgba(15,23,42,.03)}.label-product-name{font-family:Arial,Helvetica,sans-serif;font-size:10.5px;text-transform:uppercase}.label-barcode-number{font-family:'Courier New',monospace;font-size:9.5px;color:#111}.label-price{font-family:Arial,Helvetica,sans-serif;font-size:13px;font-weight:900;color:#000}.barcode-svg{max-height:14mm}
@media (max-width:575.98px){.receipt-toolbar{display:grid;grid-template-columns:1fr;max-width:100%;border-radius:18px}.thermal-receipt:before,.label-sheet:before{display:none}.thermal-receipt{width:100%;max-width:360px}.label-sheet{grid-template-columns:repeat(2,1fr);padding:4mm;gap:3mm}.barcode-label{height:32mm}}
@media print{.receipt-body,.label-body{background:#fff!important;padding:0!important}.receipt-toolbar,.thermal-receipt:before,.label-sheet:before{display:none!important}.thermal-receipt{border:0!important;border-radius:0!important;margin:0!important;width:80mm!important;box-shadow:none!important;padding:2mm!important;font-size:11px!important}.receipt-title{border:0!important;padding:0!important}.receipt-totals .grand{background:#fff!important}.label-sheet{border:0!important;border-radius:0!important;box-shadow:none!important}.barcode-label{border:0!important;box-shadow:none!important;break-inside:avoid;page-break-inside:avoid}}
