﻿* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Tahoma, sans-serif; background: #f6f7fb; color: #1d1f22; }
a { color: #1c5d99; text-decoration: none; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: #fff; border-bottom: 1px solid #e4e6eb; position: sticky; top: 0; z-index: 10; }
.topbar h1 { margin: 0; font-size: 20px; }
.topbar nav a { margin-left: 12px; }

.container { padding: 24px; max-width: 1100px; margin: 0 auto; }
.card { background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 6px 16px rgba(0,0,0,0.06); margin-bottom: 24px; }
.card-click { cursor: zoom-in; }
.card-click:hover { box-shadow: 0 8px 20px rgba(0,0,0,0.09); }

.page-login { display: grid; place-items: center; min-height: 100vh; }
.page-login .card { width: min(360px, 90vw); }

label { display: block; margin-bottom: 12px; font-weight: 600; }
input, textarea { width: 100%; padding: 10px 12px; border: 1px solid #ccd1d9; border-radius: 8px; margin-top: 6px; font-size: 14px; }
.req { color: #b30000; font-weight: 700; margin-left: 4px; }
button { padding: 10px 16px; border: 0; border-radius: 8px; background: #1c5d99; color: #fff; cursor: pointer; font-size: 14px; }
button:hover { background: #184d7e; }
.btn-secondary { background: #eef2f7; color: #243040; border: 1px solid #d7dde6; }
.btn-secondary:hover { background: #e3e9f2; }
.file-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.file-hint { font-size: 12px; color: #647184; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert.error { background: #ffe0e0; color: #7a1b1b; }
.alert.success { background: #e2f5e9; color: #1f6a3f; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.list { display: grid; gap: 16px; }
.item { display: grid; gap: 16px; grid-template-columns: 160px 1fr; align-items: start; border: 1px solid #eee; border-radius: 10px; padding: 12px; }
.item img { width: 160px; height: 160px; object-fit: cover; border-radius: 8px; }

.thumb-list { display: flex; gap: 8px; flex-wrap: wrap; align-content: flex-start; }
.thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid #eee; }

.grid-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-list img { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; }
.grid-list img.clickable { cursor: zoom-in; }

.price { font-weight: 700; }
.stock { margin: 6px 0 0; color: #4d5a6a; font-size: 13px; }
.error { color: #b30000; }
.inline-form { margin-top: 10px; }
.btn-danger { background: #b30000; }
.btn-danger:hover { background: #8a0000; }
.badge { display: inline-block; margin-top: 8px; padding: 4px 8px; border-radius: 999px; background: #f0f0f0; color: #666; font-size: 12px; }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 999; }
.lightbox.hidden { display: none; }
.lb-inner { position: relative; max-width: min(92vw, 980px); width: 100%; background: #fff; border-radius: 14px; padding: 18px 18px 12px; box-shadow: 0 22px 60px rgba(0,0,0,0.35); }
#lb-image { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 10px; background: #111; }
#lb-caption { color: #2b2b2b; margin-top: 10px; text-align: center; }

.sell-form { margin-top: 14px; display: grid; gap: 10px; }
.sell-form label { font-weight: 600; }
.sell-form input { max-width: 180px; }
.btn-sell { background: #157347; }
.btn-sell:hover { background: #115e39; }
.stock-note { font-size: 12px; color: #4d5a6a; }

.lb-close, .lb-prev, .lb-next { position: absolute; border: 0; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,0.75); color: #fff; cursor: pointer; font-size: 26px; line-height: 40px; text-align: center; }
.lb-close { top: -12px; right: -12px; }
.lb-prev { top: 50%; left: -12px; transform: translateY(-50%); }
.lb-next { top: 50%; right: -12px; transform: translateY(-50%); }

@media (max-width: 640px) {
  .item { grid-template-columns: 1fr; }
  .item img { width: 100%; height: 200px; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
  .lb-close { top: 6px; right: 6px; }
}
