* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: #f3f4f6; color: #1f2937; }
.hidden { display: none !important; }
header { display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: #1f2937; color: #fff; flex-wrap: wrap; }
header nav { display: flex; gap: 16px; flex: 1; }
header a { color: #d1d5db; text-decoration: none; padding: 4px 2px; }
header a.active { color: #fff; border-bottom: 2px solid #60a5fa; }
main { max-width: 1000px; margin: 20px auto; padding: 0 16px; }
h1, h2, h3 { margin: 0 0 12px; }
.card { background: #fff; border-radius: 8px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.login-card { max-width: 340px; margin: 15vh auto; display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: #4b5563; }
input, textarea, select { padding: 7px 9px; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; width: 100%; }
button { padding: 7px 14px; border: 1px solid #d1d5db; background: #fff; border-radius: 6px; cursor: pointer; font: inherit; }
button.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
button.danger { color: #b91c1c; border-color: #fca5a5; }
button.link { background: none; border: none; color: #d1d5db; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.part { border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.part .thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; background: #e5e7eb; }
.price { font-weight: 700; font-size: 1.1rem; }
.total { font-size: 1.5rem; font-weight: 700; text-align: right; }
.muted { color: #6b7280; font-size: .85rem; }
.error { color: #b91c1c; min-height: 1em; margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid #e5e7eb; }
td.num, th.num { text-align: right; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cards .card { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.cards img { width: 100%; height: 130px; object-fit: cover; border-radius: 6px; background: #e5e7eb; }
.picker { position: relative; margin-top: 8px; }
.picker > input { width: 100%; }
.results { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid #d1d5db; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); max-height: 320px; overflow-y: auto; }
.results button { display: flex; justify-content: space-between; gap: 12px; width: 100%; border: 0; border-radius: 0; background: none; text-align: left; padding: 8px 12px; }
.results button:hover { background: #f3f4f6; }
.results p { margin: 0; padding: 8px 12px; }
img[data-zoom] { max-width: 256px; max-height: 256px; cursor: zoom-in; }
#overlay { position: fixed; inset: 0; background: rgba(0,0,0,.8); display: flex; align-items: center; justify-content: center; z-index: 100; cursor: zoom-out; }
#overlay img { max-width: 95vw; max-height: 95vh; border-radius: 6px; background: #fff; }
#toast { position: fixed; bottom: 20px; right: 20px; background: #111827; color: #fff; padding: 10px 16px; border-radius: 6px; opacity: 0; transition: opacity .3s; pointer-events: none; }
#toast.show { opacity: 1; }
