:root {
  --bg: #121212; --card: #1e1e1e; --card2: #262626; --line: #333;
  --text: #f2f2f2; --muted: #a8a8a8; --accent: #4caf50; --accent-dark: #3b8f3f; --danger: #e5534b;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.45; }
a { color: inherit; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 20px 16px 60px; }

/* шапка */
.top { position: sticky; top: 0; z-index: 5; background: rgba(18,18,18,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.logo { font-weight: 800; letter-spacing: .08em; font-size: 20px; text-decoration: none; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-size: 15px; }
.nav a:hover, .nav a.on { background: var(--card); color: var(--text); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; text-align: center; }

h1 { font-size: clamp(26px, 5vw, 40px); margin: 10px 0 6px; }
h2 { font-size: 22px; margin: 28px 0 12px; }
.muted { color: var(--muted); }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font-size: 15px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #555; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* герой */
.hero { padding: 40px 0 20px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* картки товару (як у portfolio.html) */
.grid { display: grid; gap: 16px; }
.product { display: flex; gap: 20px; align-items: center; background: var(--card); padding: 15px; border-radius: var(--radius); }
.product img, .product .noimg { width: 200px; height: 200px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--card2); }
.product .noimg { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.product .info { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.product .name { margin: 0; font-size: 20px; font-weight: 700; }
.product .price { margin: 0; color: var(--accent); font-size: 18px; }
.product .desc { margin: 0; color: var(--muted); white-space: pre-line; }
.buy { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.total { color: var(--muted); font-size: 15px; }
.total b { color: var(--text); }

.qty { display: flex; align-items: center; gap: 5px; }
.qty button { width: 35px; height: 35px; border-radius: 6px; border: 1px solid #555; background: #333; color: #fff; font-size: 18px; cursor: pointer; }
.qty .field { position: relative; }
.qty input { width: 90px; height: 35px; padding: 0 30px 0 10px; font-size: 17px; background: #333; color: #fff; border: 1px solid #555; border-radius: 6px; }
.qty .u { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: #aaa; font-size: 14px; pointer-events: none; }
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty input { -moz-appearance: textfield; appearance: textfield; }

@media (max-width: 560px) {
  .product { flex-direction: column; align-items: stretch; }
  .product img, .product .noimg { width: 100%; height: 220px; }
}

/* форми */
.panel { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 17px; }
label.f { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
.in, select.in, textarea.in { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #444; background: #2a2a2a; color: var(--text); font: inherit; font-size: 15px; }
textarea.in { min-height: 90px; resize: vertical; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.choice input { width: 18px; height: 18px; accent-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.err { color: var(--danger); font-size: 14px; margin-top: 8px; }

/* кошик */
.line { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.line .t { flex: 1; min-width: 0; }
.line .s { font-weight: 600; white-space: nowrap; }
.sum { display: flex; justify-content: space-between; font-size: 20px; font-weight: 700; margin-top: 12px; }

/* адмінка */
.admin-list { display: grid; gap: 10px; }
.admin-item { display: flex; gap: 12px; align-items: center; background: var(--card); padding: 10px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; }
.admin-item.on { border-color: var(--accent); }
.admin-item img, .admin-item .noimg { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--card2); flex-shrink: 0; }
.admin-item .t { flex: 1; min-width: 0; }
.admin-item .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item .off { font-size: 12px; color: var(--danger); }
.admin { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .admin { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.preview-label { font-size: 13px; color: var(--muted); margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .06em; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
