:root{--bg: #f5f7fa;--surface: #ffffff;--primary: #2563eb;--primary-hover: #1d4ed8;--text: #1f2937;--muted: #6b7280;--border: #e5e7eb;--error: #dc2626;--error-bg: #fee2e2}*{box-sizing:border-box}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--text)}.auth-page{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:1rem}.auth-form{background:var(--surface);padding:2rem;border-radius:8px;box-shadow:0 4px 12px #00000014;width:100%;max-width:400px}.auth-form h1{margin-top:0;margin-bottom:1.5rem}.field{margin-bottom:1rem}.field label{display:block;margin-bottom:.4rem;font-weight:500}.field input{width:100%;padding:.6rem .75rem;border:1px solid var(--border);border-radius:6px;font-size:1rem}.field input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px #2563eb26}button{background:var(--primary);color:#fff;border:none;padding:.7rem 1rem;border-radius:6px;font-size:1rem;cursor:pointer;width:100%}button:hover:not(:disabled){background:var(--primary-hover)}button:disabled{opacity:.6;cursor:not-allowed}.auth-link{text-align:center;margin-top:1rem;color:var(--muted)}.auth-link a{color:var(--primary)}.error{background:var(--error-bg);color:var(--error);padding:.6rem .75rem;border-radius:6px;margin-bottom:1rem}.loading{display:flex;align-items:center;justify-content:center;min-height:100vh;color:var(--muted)}.dashboard{max-width:800px;margin:0 auto;padding:2rem 1rem}.dashboard-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:2rem}.dashboard-header button{width:auto}.user-info{background:var(--surface);padding:1.5rem;border-radius:8px;box-shadow:0 2px 8px #0000000d}.user-info dl{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1rem;margin:0}.user-info dt{font-weight:600;color:var(--muted)}.user-info dd{margin:0}.tabs{display:flex;gap:.5rem;border-bottom:1px solid var(--border);margin-bottom:1.5rem}.tab-link{padding:.6rem 1rem;text-decoration:none;color:var(--muted);border-bottom:2px solid transparent;font-weight:500}.tab-link:hover{color:var(--text)}.tab-link.active{color:var(--primary);border-bottom-color:var(--primary)}.product-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:1rem}.product-card{background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:1rem;display:flex;flex-direction:column;gap:.5rem}.product-card img.thumb{width:100%;height:140px;object-fit:cover;border-radius:6px;background:var(--bg)}.product-card .placeholder{width:100%;height:140px;border-radius:6px;background:var(--bg);display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:.85rem}.qty-badge{display:inline-block;background:var(--border);color:var(--text);padding:.15rem .5rem;border-radius:999px;font-size:.8rem;font-weight:600}.product-card .actions{display:flex;gap:.5rem;margin-top:auto}.product-card .actions button{width:auto;flex:1;padding:.4rem .6rem;font-size:.9rem}.product-card .actions button.danger{background:var(--error)}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:center;justify-content:center;padding:1rem;z-index:1000}.modal{background:var(--surface);border-radius:8px;padding:1.5rem;width:100%;max-width:500px;max-height:90vh;overflow-y:auto;box-shadow:0 8px 24px #0003}.modal h2{margin-top:0;margin-bottom:1rem}.modal .field textarea{width:100%;padding:.6rem .75rem;border:1px solid var(--border);border-radius:6px;font-size:1rem;font-family:inherit;resize:vertical}.modal .modal-actions{display:flex;gap:.5rem;margin-top:1rem}.modal .modal-actions button{width:auto;flex:1}.modal .image-list{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:.5rem}.modal .image-item{position:relative;width:72px;height:72px}.modal .image-item img{width:100%;height:100%;object-fit:cover;border-radius:6px}.modal .image-item button{position:absolute;top:-6px;right:-6px;width:20px;height:20px;padding:0;border-radius:50%;background:var(--error);font-size:.7rem;line-height:1}.inventory-table{width:100%;border-collapse:collapse;background:var(--surface);border-radius:8px;overflow:hidden;box-shadow:0 2px 8px #0000000d}.inventory-table th,.inventory-table td{padding:.75rem 1rem;text-align:left;border-bottom:1px solid var(--border)}.inventory-table th{background:var(--bg);font-weight:600}.qty-input{width:80px;padding:.4rem .5rem;border:1px solid var(--border);border-radius:6px;font-size:.95rem}.qty-input:focus{outline:none;border-color:var(--primary)}.low-stock{color:var(--error);font-weight:600}.summary{margin:1rem 0;font-weight:600;color:var(--muted)}button.secondary{background:var(--muted)}button.secondary:hover:not(:disabled){background:#4b5563}.barcode-row{display:flex;gap:.5rem;align-items:stretch}.barcode-row input{flex:1}.barcode{font-size:.8rem;color:var(--muted);word-break:break-all}video.scanner-video{width:100%;height:auto;aspect-ratio:4 / 3;max-height:60vh;object-fit:cover;border-radius:6px;background:#000;display:block}.scanner-error{color:var(--error);background:var(--error-bg);padding:.6rem .75rem;border-radius:6px;margin-bottom:1rem}.profile-page{display:flex;flex-direction:column;gap:1.5rem}.profile-grid{display:grid;grid-template-columns:1fr;gap:1.5rem}@media (min-width: 760px){.profile-grid{grid-template-columns:minmax(280px,1fr) minmax(0,2fr);align-items:start}}.profile-card{background:var(--surface);padding:1.5rem;border-radius:8px;box-shadow:0 2px 8px #0000000d}.profile-card h2{margin-top:0;margin-bottom:1rem;font-size:1.15rem}.profile-card dl{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1rem;margin:0}.profile-card dt{font-weight:600;color:var(--muted)}.profile-card dd{margin:0;word-break:break-word}.profile-meta{margin:0;color:var(--muted);font-size:.9rem}.profile-notice{background:var(--bg);border:1px solid var(--border);color:var(--text);padding:.6rem .75rem;border-radius:6px}.muted-text{color:var(--muted);font-size:.85rem}.badge{display:inline-block;background:var(--border);color:var(--text);padding:.15rem .5rem;border-radius:999px;font-size:.75rem;font-weight:600;white-space:nowrap}.sessions-panel{display:flex;flex-direction:column;gap:1rem}.sessions-toolbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}.sessions-toolbar button{flex-shrink:0}.sessions-table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:8px}.sessions-table{width:100%;border-collapse:collapse;font-size:.92rem}.sessions-table th,.sessions-table td{padding:.7rem .85rem;text-align:left;border-bottom:1px solid var(--border);vertical-align:middle;white-space:nowrap}.sessions-table thead th{background:var(--bg);font-weight:600;color:var(--muted);font-size:.8rem;text-transform:none}.sessions-table tbody tr:last-child td{border-bottom:none}.session-device{display:flex;align-items:center;gap:.6rem}.session-meta{display:flex;flex-direction:column;min-width:0}.session-status{display:inline-block;padding:.15rem .55rem;border-radius:999px;font-size:.75rem;font-weight:600;background:var(--border);color:var(--text)}.session-status.current{background:#dcfce7;color:#166534}.session-status.active{background:#dbeafe;color:#1e40af}.session-status.expired{background:var(--bg);color:var(--muted)}.cart-qty{display:flex;align-items:center;gap:.4rem}.cart-panel{position:sticky;bottom:0;margin-top:1.5rem;background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:1rem 1.25rem;box-shadow:0 4px 16px #00000014}.cart-panel h3{margin:0 0 .75rem}.cart-list{list-style:none;margin:0 0 .75rem;padding:0;display:flex;flex-direction:column;gap:.4rem}.cart-list li{display:flex;justify-content:space-between;align-items:center;gap:.75rem;padding:.3rem 0;border-bottom:1px solid var(--border)}.cart-list .cart-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cart-list .cart-qty-info{color:var(--muted);font-size:.9rem}.cart-list .cart-line-total{font-weight:600}.cart-total{display:flex;justify-content:space-between;align-items:center;padding-top:.5rem}.success-banner{background:#dcfce7;color:#166534;padding:.6rem .75rem;border-radius:6px;margin-bottom:1rem;font-weight:600}.shop-toolbar{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap;margin-bottom:1rem}.search-input{flex:1;min-width:200px;padding:.6rem .75rem;border:1px solid var(--border);border-radius:6px;font-size:1rem;font-family:inherit}.search-input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 2px #2563eb40}.category-chips{display:flex;gap:.4rem;flex-wrap:wrap}.category-chip{background:var(--bg);border:1px solid var(--border);color:var(--muted);padding:.3rem .75rem;border-radius:999px;font-size:.85rem;cursor:pointer;transition:border-color .15s ease,color .15s ease,background .15s ease}.category-chip:hover{border-color:var(--primary);color:var(--text)}.category-chip.active{background:var(--primary);border-color:var(--primary);color:#fff}@keyframes cart-toast-in{0%{opacity:0;transform:translate(-50%,12px)}to{opacity:1;transform:translate(-50%)}}.cart-toast{position:fixed;bottom:1.25rem;left:50%;transform:translate(-50%);background:var(--surface);border:1px solid var(--border);border-left:4px solid #16a34a;box-shadow:0 8px 24px #00000026;padding:.7rem 1.1rem;border-radius:8px;font-weight:600;z-index:1200;animation:cart-toast-in .2s ease-out}.view-cart-btn{padding:.7rem 1.25rem}.cart-badge{display:inline-flex;min-width:1.25rem;height:1.25rem;padding:0 .4rem;align-items:center;justify-content:center;margin-left:.4rem;background:var(--error);color:#fff;border-radius:999px;font-size:.72rem;font-weight:700;line-height:1;vertical-align:middle}.cart-page{display:flex;flex-direction:column;gap:1rem}.cart-layout{display:grid;grid-template-columns:1fr 320px;gap:1.5rem;align-items:start}@media (max-width: 760px){.cart-layout{grid-template-columns:1fr}}.cart-items{display:flex;flex-direction:column;gap:.75rem}.cart-summary{background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:1.25rem;position:sticky;top:1rem}.cart-row{display:grid;grid-template-columns:64px 1fr auto auto;gap:.85rem;align-items:center;padding:.75rem;background:var(--surface);border:1px solid var(--border);border-radius:8px}@media (max-width: 560px){.cart-row{grid-template-columns:56px 1fr}.cart-row-controls,.cart-remove{grid-column:1 / -1;display:flex;align-items:center}}.cart-thumb{width:64px;height:64px;object-fit:cover;border-radius:6px;background:var(--bg)}.cart-row-info{display:flex;flex-direction:column;gap:.15rem;min-width:0}.cart-row-info strong{font-weight:700}.cart-row-info .category,.cart-row-info .unit-price{font-size:.8rem;color:var(--muted)}.cart-row-controls,.cart-stepper{display:flex;align-items:center;gap:.4rem}.cart-row-controls button,.cart-stepper button{width:auto;padding:.3rem .6rem;font-size:.9rem}.cart-stepper .qty-input{width:56px;text-align:center}.cart-remove{background:transparent;color:var(--muted);border:1px solid var(--border);padding:.3rem .6rem;border-radius:6px;font-size:.85rem;cursor:pointer}.cart-remove:hover{color:var(--error);border-color:var(--error)}.cart-summary-row{display:flex;justify-content:space-between;padding:.3rem 0;color:var(--muted);font-size:.95rem}.cart-summary-total{display:flex;justify-content:space-between;margin-top:.5rem;padding-top:.75rem;border-top:1px solid var(--border);font-size:1.25rem;font-weight:700}.cart-empty{text-align:center;padding:3rem 1rem;color:var(--muted)}.cart-empty button{width:auto;margin:1rem auto 0}.page-header{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;margin-bottom:.5rem}.page-header h2,.page-header .muted{margin:0}.page-header-actions{margin-left:auto;display:flex;gap:.5rem}.page-header-actions button{width:auto}.muted{color:var(--muted)}.small{font-size:.8rem}.cart-row-name{font-weight:600}.cart-row-price{color:var(--muted);font-size:.85rem}.cart-row-total{font-weight:600;white-space:nowrap}.cart-summary button{width:100%;margin-top:.6rem}.cart-summary h3{margin:0 0 .75rem}.sales-toolbar{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;margin-bottom:1rem}.data-table{width:100%;border-collapse:collapse;background:var(--surface);border:1px solid var(--border);border-radius:8px;overflow:hidden}.data-table th,.data-table td{padding:.7rem .85rem;text-align:left;border-bottom:1px solid var(--border);font-size:.92rem;vertical-align:middle}.data-table thead th{background:var(--bg);font-weight:600;color:var(--muted);text-transform:uppercase;font-size:.75rem;letter-spacing:.03em}.data-table tbody tr{cursor:pointer;transition:background .12s ease}.data-table tbody tr:hover{background:var(--bg)}.data-table tbody tr:last-child td{border-bottom:none}.sale-total{font-weight:700;white-space:nowrap}.sale-customer{color:var(--text)}.pagination{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;margin-top:1rem;padding-top:.75rem;border-top:1px solid var(--border)}.pagination button{width:auto;padding:.45rem .9rem}.pagination-info{color:var(--muted);font-size:.88rem}.page-size-select{margin-left:auto;padding:.4rem .5rem;border:1px solid var(--border);border-radius:6px;background:var(--surface);font-size:.88rem;font-family:inherit}.storage-card .sessions-toolbar{margin-bottom:1rem}.storage-used{margin:.25rem 0 .5rem}.storage-used-value{font-size:1.6rem;font-weight:700}.storage-card code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.85rem;word-break:break-all}.upload-row{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;margin:1rem 0}.upload-row input[type=file]{font-size:.85rem;flex:1 1 220px;min-width:0}.image-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:1rem;margin-top:.5rem}.image-thumb{margin:0;border:1px solid var(--border);border-radius:8px;overflow:hidden;background:var(--bg);display:flex;flex-direction:column}.image-thumb img{width:100%;height:120px;object-fit:cover;display:block;background:var(--surface)}.image-thumb figcaption{display:flex;flex-direction:column;gap:.35rem;padding:.5rem;font-size:.8rem}.image-thumb-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}.image-thumb figcaption button{align-self:flex-start}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.modal .modal-title{margin-top:0;margin-bottom:.5rem;font-size:1.15rem}.modal .modal-message{margin:0 0 .25rem;color:var(--text);line-height:1.45;word-break:break-word}.modal .modal-btn.destructive{background:var(--error);color:#fff;border-color:var(--error)}.modal .modal-btn.destructive:hover{filter:brightness(.92)}
