:root{--bg:#f6f3ee;--surface:#fff;--surface-2:#faf8f4;--ink:#1c1917;--muted:#78716c;--border:#e8e1d6;--gold:#b7791f;--gold-strong:#8a5a14;--gold-soft:#fbf3e0;--night:#1c1917;--night-2:#292524;--ok:#15803d;--ok-soft:#ecfdf3;--error:#b42318;--error-soft:#fef3f2;--radius:14px;--shadow:0 1px 2px #1c19170f, 0 10px 30px -18px #1c19174d;color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,sans-serif}*{box-sizing:border-box}body{margin:0}h1,h2,h3{letter-spacing:-.01em;margin:0 0 .75rem}h1{font-size:1.6rem}h2{font-size:1.05rem}.layout{grid-template-columns:248px minmax(0,1fr);min-height:100vh;display:grid}.sidebar{background:var(--night);color:#e7e5e4;flex-direction:column;gap:1.5rem;height:100vh;padding:1.5rem 1rem;display:flex;position:sticky;top:0}.brand{align-items:center;gap:.75rem;padding:0 .5rem;display:flex}.brand-mark{width:40px;height:40px;color:var(--night);background:linear-gradient(135deg,#f5d78e,#b7791f 60%,#8a5a14);border-radius:12px;place-items:center;font-size:1.15rem;font-weight:800;display:grid}.brand strong{color:#fff;font-size:1rem;display:block}.brand small{color:#a8a29e;font-size:.75rem}.tabs{flex-direction:column;gap:.25rem;display:flex}.tab{color:#d6d3d1;width:100%;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:10px;align-items:center;gap:.7rem;padding:.65rem .75rem;font-size:.93rem;display:flex}.tab svg{opacity:.8;flex:none;width:18px;height:18px}.tab:hover{background:var(--night-2);color:#fff}.tab.active{color:#f5d78e;background:linear-gradient(90deg,#f5d78e29,#f5d78e0a);box-shadow:inset 3px 0 #e9c46a}.sidebar-user{background:var(--night-2);border-radius:12px;margin-top:auto;padding:.75rem;font-size:.85rem}.sidebar-user span{color:#a8a29e;font-size:.78rem;display:block}.sidebar-user .link{color:#f5d78e;margin-top:.4rem}.layout main{width:100%;max-width:1240px;margin:0 auto;padding:2rem 2rem 3rem}.page-header{margin-bottom:1.5rem}.page-header p{color:var(--muted);margin:-.4rem 0 0}@media (width<=900px){.layout{grid-template-columns:1fr}.sidebar{gap:.75rem;height:auto;padding:.75rem 1rem;position:static}.tabs{flex-direction:row;overflow-x:auto}.tab{white-space:nowrap;width:auto}.sidebar-user{display:none}.layout main{padding:1.25rem 1rem 2rem}}.grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));align-items:start;gap:1.25rem;display:grid}.wide{grid-column:1/-1}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:1.4rem;overflow-x:auto}.card h2{justify-content:space-between;align-items:center;gap:.75rem;display:flex}form.card,.stack{flex-direction:column;gap:.85rem;display:flex}label{color:var(--muted);letter-spacing:.01em;flex-direction:column;gap:.35rem;font-size:.8rem;font-weight:600;display:flex}input,select,textarea{border:1px solid var(--border);background:var(--surface);width:100%;color:var(--ink);font:inherit;border-radius:10px;padding:.6rem .75rem;font-size:.95rem;font-weight:400}input:focus,select:focus,textarea:focus{border-color:var(--gold);outline:none;box-shadow:0 0 0 3px #b7791f2e}button{background:var(--night);color:#fff;font:inherit;cursor:pointer;border:0;border-radius:10px;padding:.7rem 1rem;font-weight:600}button:hover:not(:disabled){background:var(--night-2)}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,.tab:focus-visible{outline-offset:2px;outline:3px solid #b7791f73}.btn-gold{background:linear-gradient(135deg,#c8913a,#8a5a14);box-shadow:0 8px 20px -10px #8a5a14b3}.btn-gold:hover:not(:disabled){background:linear-gradient(135deg,#b7791f,#744a10)}.btn-secondary{background:var(--surface);color:var(--ink);border:1px solid var(--border)}.btn-secondary:hover:not(:disabled){background:var(--surface-2)}.link{color:var(--gold-strong);cursor:pointer;background:0 0;border:0;padding:0;font-weight:600}.link:hover:not(:disabled){background:0 0;text-decoration:underline}.row{grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:.75rem;display:grid}.muted{color:var(--muted)}.hint{color:var(--muted);margin:0;font-size:.8rem}.positive{color:var(--ok)}.negative{color:var(--error)}.alert{border-radius:10px;margin:0;padding:.75rem .9rem;font-size:.9rem}.alert.ok{background:var(--ok-soft);color:var(--ok)}.alert.error{background:var(--error-soft);color:var(--error)}.alert.info{background:var(--gold-soft);color:var(--gold-strong)}.badge{background:var(--gold-soft);color:var(--gold-strong);border-radius:999px;padding:.2rem .55rem;font-size:.75rem;font-weight:700;display:inline-block}.badge.neutral{color:#57534e;background:#f5f5f4}table{border-collapse:collapse;font-variant-numeric:tabular-nums;width:100%;font-size:.9rem}th{color:var(--muted);letter-spacing:.06em;text-transform:uppercase;font-size:.72rem;font-weight:700}th,td{text-align:left;border-bottom:1px solid var(--border);white-space:nowrap;padding:.65rem .6rem}tbody tr:hover{background:var(--surface-2)}td.num,th.num{text-align:right}td small{color:var(--muted);display:block}.total{margin:0;font-size:1rem}.pieces{grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:.9rem;display:grid}.piece{border:1px solid var(--border);background:var(--surface);color:var(--ink);cursor:pointer;border-radius:12px;flex-direction:column;gap:.2rem;padding:0 0 .8rem;font-size:.9rem;font-weight:400;transition:border-color .15s,box-shadow .15s,transform .15s;display:flex;position:relative;overflow:hidden}.piece:hover{box-shadow:var(--shadow);transform:translateY(-2px)}.piece>:not(img,.placeholder,input){padding:0 .8rem}.piece input{opacity:0;pointer-events:none;position:absolute}.piece:has(input:focus-visible){outline:3px solid #b7791f73}.piece.selected{border-color:var(--gold);box-shadow:0 0 0 3px #b7791f38}.piece.selected:after{content:"✓";background:var(--gold);color:#fff;border-radius:50%;place-items:center;width:26px;height:26px;font-weight:800;display:grid;position:absolute;top:.6rem;right:.6rem}.piece.sold{opacity:.55}.piece img,.placeholder{aspect-ratio:4/3;object-fit:cover;width:100%;margin-bottom:.5rem}.placeholder{color:#fff;letter-spacing:.04em;text-shadow:0 2px 10px #78460a73;background:radial-gradient(circle at 30% 25%,#ffffff8c,#0000 45%),linear-gradient(135deg,#f7e3a8,#d6a645 55%,#a8721e);place-items:center;font-size:1.8rem;font-weight:800;display:grid}.piece strong{font-size:.95rem}.piece .price{font-variant-numeric:tabular-nums;font-weight:700}.sell{grid-template-columns:minmax(0,1fr) 390px;align-items:start;gap:1.25rem;margin-bottom:1.25rem;display:grid}@media (width<=1100px){.sell{grid-template-columns:1fr}}.invoice-panel{position:sticky;top:1.25rem}.panel-section{border-bottom:1px dashed var(--border);flex-direction:column;gap:.7rem;padding-bottom:.9rem;display:flex}.panel-section h3,.section-title{color:var(--gold-strong);letter-spacing:.08em;text-transform:uppercase;margin:0;font-size:.72rem}.segmented{background:var(--surface-2);border:1px solid var(--border);border-radius:12px;grid-template-columns:repeat(3,1fr);gap:.25rem;padding:.25rem;display:grid}.segmented label{color:var(--ink);text-align:center;cursor:pointer;border-radius:9px;margin:0;padding:.5rem .25rem;font-size:.85rem;display:block}.segmented input{opacity:0;pointer-events:none;position:absolute}.segmented label:has(input:checked){background:var(--night);color:#fff}.segmented label:has(input:focus-visible){outline:3px solid #b7791f73}.summary-line{font-variant-numeric:tabular-nums;justify-content:space-between;gap:1rem;font-size:.9rem;display:flex}.summary-line.item{color:var(--muted);font-size:.85rem}.summary-total{background:var(--night);color:#fff;font-variant-numeric:tabular-nums;border-radius:12px;justify-content:space-between;align-items:baseline;padding:.85rem 1rem;display:flex}.summary-total strong{color:#f5d78e;font-size:1.35rem}.issued{background:var(--gold-soft);border:1px solid #e9c46a;border-radius:12px;flex-direction:column;gap:.6rem;padding:1rem;display:flex}.issued strong{font-size:1.1rem}.search{max-width:320px;margin-bottom:1rem}.balance td:last-child{text-align:right;font-variant-numeric:tabular-nums}.answer{background:var(--surface-2);white-space:pre-wrap;border-radius:12px;padding:1rem}.login{background:radial-gradient(circle at 20% 10%, #f5d78e40, transparent 40%), var(--night);place-items:center;min-height:100vh;padding:1rem;display:grid}.login .card{width:min(100%,380px)}@media (prefers-reduced-motion:reduce){.piece{transition:none}.piece:hover{transform:none}}.stats{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:.75rem;margin-bottom:1rem;display:grid}.stats div{border:1px solid var(--border);background:var(--surface-2);border-radius:12px;gap:.2rem;padding:.8rem 1rem;display:grid}.stats span{color:var(--muted);font-size:.8rem}.stats strong{font-variant-numeric:tabular-nums;font-size:1.15rem}.toolbar{flex-wrap:wrap;gap:.6rem;margin-bottom:1rem;display:flex}.toolbar .search{flex:240px;max-width:none;margin:0}.toolbar select{flex:0 220px}.piece-foot{justify-content:space-between;align-items:center;gap:.5rem;margin-top:auto;padding-bottom:.8rem;display:flex}.piece .placeholder{font-size:1rem}.edit-dialog{border-radius:var(--radius);border:0;width:min(560px,100vw - 2rem);max-height:calc(100dvh - 2rem);padding:0;box-shadow:0 30px 80px -20px #1c191773}.edit-dialog::backdrop{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#1c19178c}.edit-dialog form{gap:.8rem;padding:1.25rem;display:grid}.edit-dialog header{justify-content:space-between;align-items:center;display:flex}.edit-dialog h2{margin:0}.dropzone{border:2px dashed var(--border);color:var(--muted);cursor:pointer;border-radius:12px;grid-template-columns:120px 1fr;align-items:center;gap:1rem;padding:.75rem;font-size:.85rem;display:grid}.dropzone:hover,.dropzone:focus-within{border-color:var(--gold);background:var(--gold-soft)}.dropzone img,.dropzone .placeholder{aspect-ratio:3/4;object-fit:cover;border-radius:8px;width:120px;margin:0}.dropzone input{opacity:0;width:1px;height:1px;position:absolute}.receipt-thumb img{border:1px solid var(--border);object-fit:cover;border-radius:6px;width:44px;height:56px;display:block}.receipts{grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:1rem;display:grid}.receipts figure{margin:0}.receipts img{aspect-ratio:4/5;border:1px solid var(--border);object-fit:cover;background:var(--surface-2);border-radius:10px;width:100%}.receipts figcaption{color:var(--muted);margin-top:.4rem;font-size:.8rem}.line-piece{align-items:center;gap:.6rem;display:flex}.line-piece img,.issued-items img,.thumb-empty{object-fit:cover;background:linear-gradient(135deg,#f7e3a8,#d6a645 55%,#a8721e);border-radius:8px;flex:none;width:40px;height:40px}.issued-items{gap:.5rem;margin:.4rem 0;padding:0;list-style:none;display:grid}.issued-items li{grid-template-columns:40px 1fr auto;align-items:center;gap:.6rem;display:grid}.issued-items small{color:var(--muted);display:block}.wake p{margin:0 0 .75rem}.wake-bar{background:#00000014;border-radius:999px;height:6px;margin:1rem 0 .5rem;overflow:hidden}.wake-bar span{background:#b8862f;height:100%;transition:width .5s;display:block}.demo-notice{color:#6b6257;text-align:center;max-width:60rem;margin:1.5rem auto .5rem;font-size:.8rem}
