:root{
  --blue:#0a2d86;--blue2:#1346ba;--blue3:#eef3ff;--ink:#172033;--muted:#687386;--line:#e5e9f0;--bg:#f5f7fb;--card:#fff;--green:#0d8a5f;--greenbg:#e9f8f2;--red:#c43b3b;--redbg:#fff0f0;--orange:#b46b12;--orangebg:#fff6e7;--shadow:0 12px 34px rgba(24,43,82,.08);--radius:18px;--navh:72px
}
*{box-sizing:border-box}html{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--ink)}body{margin:0;background:var(--bg);min-height:100vh}button,input,select,textarea{font:inherit}button{cursor:pointer}img{max-width:100%}[hidden]{display:none!important}.muted{color:var(--muted)}.optional,.hint{color:var(--muted);font-size:.84rem}.hint{line-height:1.45}.eyebrow{text-transform:uppercase;letter-spacing:.08em;font-weight:800;color:var(--blue2);font-size:.72rem;margin:0 0 4px}.form-error{color:var(--red);font-size:.88rem;min-height:1.15em;margin:0}.app-shell{min-height:100vh;padding-bottom:calc(var(--navh) + 22px)}
.topbar{height:74px;background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:30;display:flex;align-items:center;justify-content:space-between;padding:10px clamp(14px,3vw,34px)}.brand-button{border:0;background:transparent;display:flex;align-items:center;gap:10px;text-align:left;padding:0}.brand-logo{width:84px;height:84px;object-fit:contain}.brand-logo.small{width:46px;height:46px}.brand-title-row{display:flex;align-items:center;gap:7px;font-size:1.04rem}.business-name{display:block;font-size:.78rem;color:var(--muted);max-width:190px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.pro-badge{display:inline-flex;align-items:center;justify-content:center;background:var(--blue);color:white;border-radius:999px;font-weight:900;font-size:.68rem;padding:4px 8px;letter-spacing:.08em}.pro-badge.small{font-size:.55rem;padding:3px 6px}.header-actions{display:flex;align-items:center;gap:8px}.icon-btn{width:40px;height:40px;border-radius:12px;border:1px solid var(--line);background:#fff;color:var(--ink);font-size:1.2rem}.sync-pill{display:flex;align-items:center;gap:7px;border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 12px;color:var(--muted);font-size:.79rem;font-weight:700}.sync-dot{width:8px;height:8px;border-radius:50%;background:#96a0b1}.sync-pill.synced{background:var(--greenbg);border-color:#c4ebdd;color:var(--green)}.sync-pill.synced .sync-dot{background:var(--green)}.sync-pill.syncing{background:var(--blue3);border-color:#d4def8;color:var(--blue)}.sync-pill.syncing .sync-dot{background:var(--blue);animation:pulse 1s infinite}.sync-pill.error,.sync-pill.offline{background:var(--orangebg);border-color:#f5d8a7;color:var(--orange)}.sync-pill.error .sync-dot,.sync-pill.offline .sync-dot{background:var(--orange)}@keyframes pulse{50%{opacity:.35}}.offline-banner{position:sticky;top:74px;z-index:20;background:#fff3d9;color:#7a500c;border-bottom:1px solid #f0d497;text-align:center;padding:8px 12px;font-size:.82rem;font-weight:700}
.main-content{width:min(1320px,100%);margin:0 auto;padding:24px clamp(14px,3vw,34px)}.view{display:none}.view.active{display:block}.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:18px}.page-head h1{font-size:clamp(1.65rem,4vw,2.35rem);margin:0}.page-head p{margin:.25rem 0 0}.page-actions,.button-row{display:flex;gap:9px;flex-wrap:wrap}.panel,.hero-card,.report-sheet{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.panel{padding:18px}.panel.flat{box-shadow:none}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:14px}.panel-head h2{margin:0;font-size:1.08rem}.hero-card{background:linear-gradient(135deg,#0a2d86,#174fc7);color:#fff;padding:24px;margin-bottom:18px}.hero-card .muted,.hero-card .eyebrow{color:#dbe5ff}.hero-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}.hero-head h1{font-size:clamp(2rem,6vw,3.3rem);margin:4px 0}.hero-date{font-weight:700;background:rgba(255,255,255,.12);padding:8px 12px;border-radius:999px;font-size:.8rem}.metric-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.metric-grid.three{grid-template-columns:repeat(3,1fr)}.metric-grid article{border:1px solid var(--line);border-radius:14px;padding:14px;background:#fff}.hero-card .metric-grid article{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.16)}.metric-grid span{display:block;color:var(--muted);font-size:.78rem;margin-bottom:6px}.hero-card .metric-grid span{color:#dce6ff}.metric-grid strong{font-size:1.08rem}.quick-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:18px}.quick-action{border:1px solid var(--line);background:#fff;border-radius:16px;padding:16px;text-align:left;display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;column-gap:10px;box-shadow:0 7px 18px rgba(28,45,79,.05)}.quick-action span{grid-row:1/3;width:38px;height:38px;border-radius:12px;background:var(--blue3);color:var(--blue);display:grid;place-items:center;font-size:1.2rem;font-weight:900}.quick-action strong{font-size:.9rem}.quick-action small{color:var(--muted);font-size:.75rem}.quick-action.primary-action{background:var(--blue);color:white;border-color:var(--blue)}.quick-action.primary-action span{background:rgba(255,255,255,.16);color:white}.quick-action.primary-action small{color:#dbe5ff}.dashboard-grid,.report-grid{display:grid;grid-template-columns:1.35fr .65fr;gap:18px;margin-bottom:18px}.compact-list,.activity-list,.data-list,.cart-items{display:flex;flex-direction:column;gap:8px}.list-row,.activity-row,.data-row,.cart-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid var(--line);border-radius:13px;background:#fff}.row-main{min-width:0;flex:1}.row-main strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.row-main small{display:block;color:var(--muted);margin-top:3px}.amount.income{color:var(--green)}.amount.expense{color:var(--red)}.status-chip{font-size:.72rem;font-weight:800;border-radius:999px;padding:4px 8px;background:var(--blue3);color:var(--blue)}.status-chip.low{background:var(--orangebg);color:var(--orange)}.status-chip.out{background:var(--redbg);color:var(--red)}.empty-box{text-align:center;color:var(--muted);padding:30px 10px;border:1px dashed var(--line);border-radius:14px}.text-btn{border:0;background:transparent;color:var(--blue2);font-weight:800;padding:5px}.text-btn.danger{color:var(--red)}
.btn{border-radius:12px;border:1px solid transparent;padding:10px 14px;font-weight:800}.btn.primary{background:var(--blue);color:#fff}.btn.secondary{background:#fff;border-color:var(--line);color:var(--blue)}.btn.danger-outline{background:#fff;border-color:#efbbbb;color:var(--red)}.btn.large{padding:14px 18px;font-size:1rem}.toolbar,.search-line{display:flex;gap:10px;margin-bottom:14px}.toolbar input,.toolbar select,.search-line input{flex:1}.toolbar select{max-width:210px}.stack-form{display:flex;flex-direction:column;gap:13px}.stack-form label,.settings-block label,.report-controls label,.cart-footer label{display:flex;flex-direction:column;gap:6px;font-size:.86rem;font-weight:700;color:#354057}.form-grid{display:grid;gap:12px}.form-grid.two{grid-template-columns:1fr 1fr}input,select,textarea{width:100%;border:1px solid #dce1ea;background:#fff;border-radius:11px;padding:11px 12px;color:var(--ink);outline:none}input:focus,select:focus,textarea:focus{border-color:#8ba9f2;box-shadow:0 0 0 3px rgba(19,70,186,.09)}.file-field{border:1px dashed #c9d2e2;border-radius:12px;padding:12px}.file-field input,.file-button input{display:none}.photo-preview{border:1px solid var(--line);border-radius:14px;padding:10px;display:flex;gap:10px;align-items:center}.photo-preview img{width:84px;height:84px;border-radius:10px;object-fit:cover}.pos-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(330px,.7fr);gap:18px;align-items:start}.cart-panel{position:sticky;top:92px}.product-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.product-card{border:1px solid var(--line);background:#fff;border-radius:14px;padding:12px;text-align:left}.product-card:hover{border-color:#9eb5ef}.product-card strong{display:block}.product-card small{display:block;color:var(--muted);margin-top:3px}.product-card .price{color:var(--blue);font-weight:900;margin-top:8px}.product-card.disabled{opacity:.55}.cart-row{align-items:flex-start}.cart-row .qty-controls{display:flex;align-items:center;gap:6px}.qty-btn{width:30px;height:30px;border-radius:9px;border:1px solid var(--line);background:white}.qty-input{width:58px;padding:7px;text-align:center}.cart-footer{border-top:1px solid var(--line);padding-top:14px;margin-top:14px;display:flex;flex-direction:column;gap:12px}.cart-total{display:flex;justify-content:space-between;align-items:center;font-size:1.1rem}.cart-total strong{font-size:1.55rem;color:var(--blue)}.row-actions{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}.mini-btn{border:1px solid var(--line);background:#fff;border-radius:9px;padding:6px 8px;font-size:.75rem;font-weight:800;color:var(--blue)}.mini-btn.danger{color:var(--red)}.data-row .avatar{width:42px;height:42px;border-radius:13px;background:var(--blue3);color:var(--blue);display:grid;place-items:center;font-weight:900;flex:0 0 auto}.data-row .stock-value{min-width:92px;text-align:right}.report-controls{margin-bottom:14px;max-width:280px}.report-sheet{padding:22px}.report-brand{display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--line);padding-bottom:14px;margin-bottom:14px}.report-brand img{width:54px;height:54px;object-fit:contain}.report-brand strong,.report-brand span{display:block}.report-brand span{color:var(--muted);font-size:.85rem}.report-metrics{margin-bottom:18px}.receipt-content{padding:10px 2px}.receipt-brand{text-align:center}.receipt-brand img{width:74px}.receipt-table{width:100%;border-collapse:collapse;margin:14px 0}.receipt-table th,.receipt-table td{padding:8px 4px;border-bottom:1px dashed #cfd5df;text-align:left;font-size:.86rem}.receipt-table th:last-child,.receipt-table td:last-child{text-align:right}.receipt-total{display:flex;justify-content:space-between;font-size:1.25rem;font-weight:900;border-top:2px solid var(--ink);padding-top:10px}.modal{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:16px}.modal-backdrop{position:absolute;inset:0;background:rgba(12,20,38,.56);backdrop-filter:blur(3px)}.modal-card{position:relative;background:#fff;border-radius:20px;width:min(620px,100%);max-height:92vh;overflow:auto;padding:20px;box-shadow:0 30px 80px rgba(0,0,0,.22)}.modal-card.compact{width:min(470px,100%)}.modal-card.wide{width:min(920px,100%)}.modal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:16px}.modal-head h2{margin:0}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.notice{padding:11px 12px;border-radius:12px;background:var(--blue3);color:var(--blue);font-size:.86rem}.notice.warning{background:var(--orangebg);color:#85530a}.auth-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;background:#f1f4f8;padding:5px;border-radius:12px;margin-bottom:16px}.auth-tab{border:0;background:transparent;border-radius:9px;padding:9px;font-weight:800;color:var(--muted)}.auth-tab.active{background:#fff;color:var(--blue);box-shadow:0 2px 8px rgba(0,0,0,.07)}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.settings-block{border:1px solid var(--line);border-radius:15px;padding:15px}.settings-block h3{font-size:1rem;margin:0 0 10px}.danger-zone{border-color:#f2cccc}.toggle-line{flex-direction:row!important;align-items:center;gap:9px!important}.toggle-line input{width:auto}.photo-viewer{position:relative;z-index:1;max-width:min(900px,95vw);max-height:90vh}.photo-viewer img{display:block;max-height:88vh;border-radius:14px}.photo-close{position:absolute;right:-8px;top:-8px;width:40px;height:40px;border-radius:50%;border:0;background:#fff;font-size:1.4rem}.toast{position:fixed;z-index:200;left:50%;bottom:calc(var(--navh) + 24px);transform:translateX(-50%);background:#172033;color:white;padding:11px 16px;border-radius:999px;box-shadow:var(--shadow);font-size:.88rem}.lock-screen{position:fixed;inset:0;z-index:300;background:linear-gradient(160deg,#f5f7fb,#eaf0ff);display:grid;place-items:center;padding:20px}.lock-card{background:#fff;border:1px solid var(--line);border-radius:24px;padding:28px;width:min(420px,100%);box-shadow:var(--shadow);text-align:center}.lock-card .brand-logo{width:100px;height:100px}.lock-card h1{margin:8px 0}.lock-card p{color:var(--muted)}.lock-card .stack-form{text-align:left;margin-top:20px}.bottom-nav{position:fixed;left:50%;bottom:0;transform:translateX(-50%);z-index:40;width:min(100%,850px);height:var(--navh);background:rgba(255,255,255,.96);backdrop-filter:blur(12px);border:1px solid var(--line);border-bottom:0;border-radius:18px 18px 0 0;display:grid;grid-template-columns:repeat(6,1fr);padding:7px 8px max(7px,env(safe-area-inset-bottom));box-shadow:0 -8px 24px rgba(20,35,66,.07)}.nav-btn{border:0;background:transparent;color:#778196;border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-weight:800}.nav-btn span{font-size:1.1rem}.nav-btn small{font-size:.68rem}.nav-btn.active{background:var(--blue3);color:var(--blue)}
@media(max-width:900px){.metric-grid{grid-template-columns:1fr 1fr}.quick-actions{grid-template-columns:1fr 1fr}.dashboard-grid,.report-grid,.pos-layout{grid-template-columns:1fr}.cart-panel{position:static}.product-grid{grid-template-columns:repeat(2,1fr)}.settings-grid{grid-template-columns:1fr}.sync-pill span:last-child{display:none}.sync-pill{padding:10px}.toolbar{flex-wrap:wrap}.toolbar select{max-width:none}}
@media(max-width:560px){.main-content{padding-top:16px}.topbar{padding-inline:12px}.brand-logo.small{width:40px;height:40px}.business-name{max-width:130px}.page-head{align-items:flex-start;flex-direction:column}.page-actions{width:100%}.page-actions .btn{flex:1}.hero-card{padding:18px}.hero-head{flex-direction:column}.hero-date{align-self:flex-start}.metric-grid,.metric-grid.three{grid-template-columns:1fr 1fr}.hero-card .metric-grid.three article:last-child{grid-column:1/-1}.quick-actions{gap:8px}.quick-action{padding:12px}.quick-action span{width:34px;height:34px}.form-grid.two{grid-template-columns:1fr}.product-grid{grid-template-columns:1fr 1fr}.bottom-nav{width:100%;border-radius:0}.nav-btn small{font-size:.6rem}.modal{padding:8px}.modal-card{padding:16px;border-radius:17px}.data-row{align-items:flex-start}.row-actions{max-width:120px}.report-sheet{padding:14px}.report-metrics article:last-child{grid-column:1/-1}}
@media(max-width:390px){.product-grid{grid-template-columns:1fr}.quick-actions{grid-template-columns:1fr 1fr}.quick-action small{display:none}.nav-btn small{font-size:.56rem}.metric-grid,.metric-grid.three{grid-template-columns:1fr}}
@media print{body{background:#fff}.topbar,.bottom-nav,.page-head,.report-controls,.no-print,.offline-banner{display:none!important}.main-content{padding:0}body:not(.printing-receipt) .view{display:none!important}body:not(.printing-receipt) #view-reports{display:block!important}body:not(.printing-receipt) .report-sheet{border:0;box-shadow:none;padding:0}body:not(.printing-receipt) .panel{break-inside:avoid}body:not(.printing-receipt) .app-shell{padding:0}body.printing-receipt .app-shell{display:none!important}body.printing-receipt .modal{display:none!important}body.printing-receipt #receiptModal{display:block!important;position:static;padding:0}body.printing-receipt #receiptModal .modal-backdrop{display:none!important}body.printing-receipt #receiptModal .modal-card{display:block!important;position:static;width:100%;max-height:none;overflow:visible;box-shadow:none;border-radius:0;padding:0}}
