svg { width: 16px; height: 16px; flex-shrink: 0; }
.input-group > svg { position: absolute; left: 12px; color: hsl(var(--muted-foreground)); pointer-events: none; }
button, a, input, select, textarea { touch-action: manipulation; }
#notif-btn { position: relative; }
body:has(.modal-backdrop, .drawer-backdrop, .palette-backdrop) { overflow: hidden; }
.main { background: hsl(var(--muted) / .25); }
.card { min-width: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stats-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stats-grid .stat { min-height: 128px; justify-content: space-between; }
.stat-value { overflow-wrap: anywhere; }
.kbd-inverse { background: hsl(var(--primary-foreground) / .14); border-color: hsl(var(--primary-foreground) / .2); color: inherit; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 16px; }
.dash-grid-3 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-grid-3 .timeline { margin-top: 14px; }
.dash-grid-3 .timeline-title { font-size: 12px; line-height: 1.6; }
.dash-grid-3 .card-body { padding: 16px; }
.dash-grid-3 .list-row { font-size: 12px; }
.dash-grid-3 .card-header { align-items: center; min-height: 50px; padding: 12px 16px 0; }
.chart { width: 100%; position: relative; padding-bottom: 24px; margin: 12px 0 4px; }
.chart-svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: hsl(var(--border)); stroke-width: .4; stroke-dasharray: 1 1; }
.chart-bar { fill: hsl(var(--foreground) / .18); transition: fill .2s; }
.chart-bar.hl { fill: hsl(var(--primary)); }
.chart-bar:hover { fill: hsl(var(--foreground) / .65); }
.chart-labels { display: flex; padding-top: 8px; }
.chart-labels span { flex: 1; text-align: center; color: hsl(var(--muted-foreground)); font-size: 9px; white-space: nowrap; }
.legend-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 2px; }
.list { display: flex; flex-direction: column; min-width: 0; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid hsl(var(--border)); text-align: left; width: 100%; font-size: 13px; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover, button.list-row:hover { background: hsl(var(--accent) / .65); }
.list-bordered { border: 1px solid hsl(var(--border)); border-radius: var(--radius); overflow: hidden; }
.list-bordered .list-row { padding: 12px; }
.list-ic { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; background: hsl(var(--muted)); }
.list-ic.warning { color: hsl(var(--warning)); background: hsl(var(--warning) / .1); }
.list-ic.info { color: hsl(var(--info)); background: hsl(var(--info) / .1); }
.list-ic.success { color: hsl(var(--success)); background: hsl(var(--success) / .1); }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .input-group { min-width: 190px; }
.th-sort { display: inline-flex; align-items: center; gap: 5px; }
.table th.num { text-align: right; }
.table td { white-space: nowrap; }
.table td:first-child { white-space: normal; }
.inv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.inv-card { padding: 16px; }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.more-item { display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; padding: 24px 10px; font-size: 12px; border: 1px solid hsl(var(--border)); border-radius: 10px; }
.more-item:hover, .more-item.active { background: hsl(var(--muted)); }

.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 20px; align-items: start; }
.pos-products { min-width: 0; }
.pos-toolbar { display: flex; gap: 8px; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.product-grid > .empty { grid-column: 1 / -1; }
.product-card { padding: 16px; text-align: left; position: relative; transition: border-color .2s, transform .2s, box-shadow .2s; min-height: 184px; }
.product-card:hover { border-color: hsl(var(--muted-foreground) / .5); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-card.in-cart { border-color: hsl(var(--success) / .5); background: hsl(var(--success) / .025); cursor: default; }
.product-top { display: flex; justify-content: space-between; align-items: start; margin-bottom: 16px; }
.product-name { font-weight: 600; font-size: 13px; line-height: 1.5; }
.product-meta { font-size: 10px; color: hsl(var(--muted-foreground)); margin-top: 3px; min-height: 30px; }
.product-price { font-size: 14px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.product-check { display: flex; gap: 4px; align-items: center; color: hsl(var(--success)); font-size: 10px; margin-top: 6px; }
.pos-cart { position: sticky; top: 76px; display: flex; flex-direction: column; max-height: calc(100dvh - 100px); overflow: hidden; }
.cart-customer { padding: 16px; border-bottom: 1px solid hsl(var(--border)); }
.cart-items { padding: 0 16px; flex: 1; overflow-y: auto; min-height: 180px; }
.cart-item { display: flex; align-items: center; gap: 10px; padding: 16px 0; border-bottom: 1px solid hsl(var(--border)); }
.cart-item:last-child { border-bottom: 0; }
.cart-item .thumb { width: 32px; height: 40px; border-radius: 6px; }
.cart-item .font-medium { font-size: 12px; }
.cart-item .text-xs { font-size: 10px; }
.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cart-item-right .text-sm { font-size: 11px; }
.cart-summary { padding: 16px; border-top: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
.cart-summary .chip { padding: 0 7px; font-size: 11px; }
.cart-summary .segmented button { padding: 0 8px; }
.cart-summary .input { min-width: 40px; }
.cart-total { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; padding: 18px 0; letter-spacing: -.02em; }
.cart-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cart-actions .btn { font-size: 11px; gap: 5px; padding: 0 8px; }
.cart-actions .btn-block { grid-column: 1 / -1; font-size: 13px; }
.cartbar { display: none; }
.pay-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; }
.pay-methods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pay-method { border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 16px 4px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 11px; }
.pay-method.active { border-color: hsl(var(--primary)); background: hsl(var(--secondary)); box-shadow: 0 0 0 1px hsl(var(--primary)); }
.pay-method:hover { background: hsl(var(--muted)); }
.pay-summary { background: hsl(var(--muted) / .45); padding: 18px; border-radius: 10px; align-self: start; }
.pay-summary .dl { font-size: 12px; gap: 10px; }
.pay-summary .cart-total { font-size: 17px; }
.pay-change { display: flex; justify-content: space-between; gap: 8px; padding: 12px; background: hsl(var(--success) / .1); border-radius: 6px; color: hsl(142 71% 32%); font-weight: 600; font-size: 12px; }
.dark .pay-change { color: hsl(142 71% 64%); }
.pay-change.neg { background: hsl(var(--destructive) / .1); color: hsl(var(--destructive)); }
.qris-box { text-align: center; padding: 8px 0; }
.qris-code { display: inline-flex; padding: 20px; color: #09090b; background: white; border: 1px solid #ddd; border-radius: 12px; }
.qris-code svg { width: 160px; height: 160px; }
.pay-success { text-align: center; padding: 8px 0 24px; }
.pay-success > svg { margin: 0 auto; color: hsl(var(--success)); }
.demo-label { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; line-height: 1.5; text-transform: uppercase; letter-spacing: .09em; color: hsl(var(--muted-foreground)); }
.demo-label::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: hsl(var(--warning)); }

.bills-body > .table-wrap { border: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.receipt { color: #18181b; background: #fff; padding: 24px 18px; width: min(100%, 320px); margin: 0 auto; border: 1px solid #e4e4e7; font-family: var(--font-mono); font-size: 10px; line-height: 1.7; }
.receipt-head { text-align: center; font-size: 9px; }
.receipt-brand { font-size: 22px; font-weight: 700; letter-spacing: -.04em; margin-bottom: 4px; }
.receipt-dash { border-top: 1px dashed #a1a1aa; margin: 12px 0; }
.receipt-row { display: flex; justify-content: space-between; gap: 8px; }
.receipt-row > span:last-child { text-align: right; }
.receipt-total { font-weight: 700; font-size: 14px; padding: 6px 0; }
.receipt-item + .receipt-item { margin-top: 10px; }
.receipt-sub { font-size: 8px; color: #71717a; }
.receipt-foot { font-size: 9px; text-align: center; }
.invoice { padding: 20px 4px; }
.invoice-head, .invoice-parties { display: flex; justify-content: space-between; gap: 30px; }
.invoice-head { padding-bottom: 30px; border-bottom: 1px solid hsl(var(--border)); }
.invoice-brand { font-size: 26px; font-weight: 700; letter-spacing: -.04em; }
.invoice-parties { padding: 26px 0; }
.invoice-totals { width: min(100%, 280px); margin: 24px 0 24px auto; }
.invoice-foot { font-size: 11px; color: hsl(var(--muted-foreground)); padding-top: 20px; border-top: 1px solid hsl(var(--border)); }
.invoice-table td { white-space: normal; }

.ti-layout { display: flex; flex-direction: column; gap: 24px; }
.ti-layout > .card .card-body { max-width: 900px; }
.cond-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cond-card { display: flex; gap: 12px; padding: 16px 12px; border: 1px solid hsl(var(--border)); border-radius: 8px; text-align: left; }
.cond-card.active { border-color: hsl(var(--primary)); box-shadow: 0 0 0 1px hsl(var(--primary)); background: hsl(var(--muted) / .5); }
.cond-card .grade { flex-shrink: 0; }
.cond-card .text-xs { margin-top: 4px; line-height: 1.5; font-size: 10px; }
.range { width: 100%; accent-color: hsl(var(--primary)); height: 32px; cursor: pointer; }
.est-result { padding: 24px; background: hsl(var(--muted) / .65); border: 1px solid hsl(var(--border)); border-radius: 10px; }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 16px; }
.kanban-col { background: hsl(var(--muted) / .6); padding: 10px; border-radius: 10px; min-height: 320px; }
.kanban-head { display: flex; align-items: center; gap: 8px; padding: 5px 4px 14px; font-size: 12px; font-weight: 600; }
.kanban-head .count { background: hsl(var(--border)); border-radius: 4px; padding: 0 5px; font-size: 10px; }
.kanban-list { display: flex; flex-direction: column; gap: 10px; }
.kanban-empty { text-align: center; color: hsl(var(--muted-foreground)); font-size: 11px; border: 1px dashed hsl(var(--border)); border-radius: 6px; padding: 24px 12px; }
.svc-card { padding: 12px; }
.svc-card .font-medium { font-size: 12px; }
.svc-card .text-sm { font-size: 10px; }
.svc-card .text-xs { font-size: 10px; }
.svc-card .flex-1, .svc-card .truncate { min-width: 0; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
.settings-section { margin-bottom: 20px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 0; border-bottom: 1px solid hsl(var(--border)); }
.setting-row:last-child { border-bottom: 0; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

@media (min-width: 1700px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1400px) {
  .hide-lg { display: none; }
  .dash-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid-3 > :last-child { grid-column: 1 / -1; }
  .dash-grid-3 > :last-child .timeline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
  .dash-grid-3 > :last-child .timeline-item::before { display: none; }
  .pos-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 21px; }
}
@media (max-width: 1100px) {
  :root { --sidebar-w: 218px; }
  .content { padding: 20px; }
  .topbar-clock { display: none; }
  .stats-grid { gap: 10px; }
  .stat { padding: 16px; }
  .stat-value { font-size: 20px; }
  .dash-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .hide-md { display: none; }
  .dash-grid > :last-child .card-body > .flex { flex-direction: column; align-items: stretch; }
  .dash-grid > :last-child .card-body > .flex > svg { margin: 0 auto; }
  .pos-layout { grid-template-columns: minmax(0, 1fr) 305px; }
  .product-card { padding: 12px; }
  .cart-summary { padding: 12px; }
  .cart-summary .chip:last-child { display: none; }
  .settings-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .dash-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .dash-grid-3 > :last-child .timeline { display: flex; }
  .dash-grid > :last-child .card-body > .flex { flex-direction: row; align-items: center; }
  .pos-layout { display: block; }
  .pos-cart { display: none; }
  .pos-products { padding-bottom: 86px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cartbar.show { display: flex; position: fixed; left: calc(var(--sidebar-w) + 20px); right: 20px; bottom: 18px; z-index: 80; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 12px; box-shadow: var(--shadow-lg); }
  .drawer:has(.cart-customer) .drawer-body { padding: 0; }
  .drawer:has(.cart-customer) .cart-items { overflow: visible; min-height: 120px; }
  .drawer:has(.cart-customer) .cart-summary { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .cond-grid { gap: 8px; }
  .cond-card { flex-direction: column; gap: 6px; padding: 12px; }
}
@media (max-width: 768px) {
  .content { padding: 20px 16px calc(var(--bottomnav-h) + 24px + env(safe-area-inset-bottom)); }
  .page-header { gap: 14px; }
  .page-header .page-desc { font-size: 12px; }
  .page-actions { gap: 6px; }
  .stats-grid .stat { min-height: 115px; }
  .stat-label { font-size: 11px; }
  .stat-value { font-size: 21px; }
  .cartbar.show { left: 12px; right: 12px; bottom: calc(var(--bottomnav-h) + 12px + env(safe-area-inset-bottom)); }
  .topbar-search { margin-left: auto; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: 1fr; }
  .invoice-head, .invoice-parties { gap: 16px; }
  .invoice-head .text-2xl { font-size: 20px; }
  .kanban { grid-template-columns: repeat(5, 260px); }
}
@media (max-width: 560px) {
  .card-header { padding-left: 16px; padding-right: 16px; }
  .card-body { padding: 16px; }
  .toolbar { gap: 8px; }
  .toolbar > .input-group { flex-basis: 100%; }
  .toolbar .select { flex: 1; min-width: 80px !important; font-size: 11px; }
  .toolbar .segmented button { padding: 0 8px; }
  .inv-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-card { min-height: 182px; padding: 14px; }
  .pos-products .chips { margin-right: -16px; padding-right: 16px; }
  .pay-grid { grid-template-columns: 1fr; gap: 18px; }
  .pay-summary .list, .pay-summary > .text-sm, .pay-summary .sep, .pay-summary .dl { display: none; }
  .pay-summary { padding: 10px 16px; }
  .pay-summary .cart-total { padding: 8px 0; }
  .pay-summary .pay-change { margin: 6px 0; }
  .chart-labels span { font-size: 7px; }
  .chart-labels span:nth-child(even) { visibility: hidden; }
  .stat { padding: 14px; }
  .stat-value { font-size: 19px; }
  .stats-grid { gap: 10px; }
  .stat-delta { font-size: 10px; }
  .cond-card .text-xs { font-size: 9px; }
  .cond-card .font-medium { font-size: 12px; }
  .est-result { padding: 18px; }
  .est-result .text-3xl { font-size: 26px; }
  .modal-header { padding: 18px 18px 0; }
  .modal-body { padding: 16px 18px; }
  .modal-footer { padding-left: 18px; padding-right: 18px; }
  .invoice { overflow-x: auto; }
  .invoice > * { min-width: 460px; }
  .table td { padding: 12px; }
  .table th { padding: 10px 12px; }
}
@media print {
  .receipt { border: 0; padding: 0; }
  .print-receipt { padding: 0; }
  .invoice { max-width: 760px; margin: 0 auto; }
  .invoice > * { min-width: 0; }
  .invoice-table td { white-space: normal; }
  .app, .toast-stack, #palette-root { display: none; }
}
