:root {
  --bg: #0f1115;
  --surface: #181b22;
  --surface-2: #20242e;
  --border: #2b303b;
  --text: #e7e9ee;
  --muted: #9aa3b2;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(15,17,21,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.logo span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 16px; }
.nav a { color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--text); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-weight: 600;
  cursor: pointer; font-size: 14px; transition: 0.15s; font-family: inherit;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
input, select, textarea {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 10px 12px; border-radius: 10px; font-size: 14px; font-family: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 100px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: 0.15s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card-img { aspect-ratio: 16/10; background: var(--surface-2); object-fit: cover; width: 100%; }
.card-img.placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-weight: 700; font-size: 16px; }
.card-price { color: var(--accent); font-weight: 800; font-size: 18px; }
.card-meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.tag { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; font-size: 12px; }

.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 10px; margin: 24px 0; align-items: end; }
.filter-actions { grid-column: 1 / -1; display: flex; gap: 10px; }

.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; margin-top: 24px; }
.gallery-main { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }
.gallery-wrap { position: relative; }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: rgba(15,17,21,0.6); color: var(--text); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: 0.15s;
}
.gallery-nav:hover { background: var(--accent); border-color: var(--accent); }
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb { width: 80px; height: 56px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.thumb.active { border-color: var(--accent); }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table td { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.spec-table td:first-child { color: var(--muted); width: 45%; }
.spec-table td:last-child { font-weight: 600; }

.page-title { font-size: 28px; font-weight: 800; margin: 28px 0 4px; }
.muted { color: var(--muted); }
.center-box { max-width: 380px; margin: 60px auto; background: var(--surface); border: 1px solid var(--border); padding: 28px; border-radius: var(--radius); }
.alert { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.alert-error { background: rgba(239,68,68,0.12); border: 1px solid var(--danger); color: #fca5a5; }
.row { display: flex; gap: 12px; align-items: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin: 24px 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { color: var(--muted); font-weight: 600; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

.img-check { display: inline-flex; flex-direction: column; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); }
.img-check img { width: 90px; height: 64px; object-fit: cover; border-radius: 8px; }

.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 32px 0; flex-wrap: wrap; }
.pagination .btn { min-width: 38px; justify-content: center; }

@media (max-width: 800px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
