:root {
  --bg: #08090f;
  --panel: #12141f;
  --panel-2: #171a28;
  --line: rgba(255, 122, 60, 0.14);
  --line-strong: rgba(255, 77, 28, 0.4);
  --cyan: #ff4d1c;
  --cyan-deep: #ff7a3c;
  --ink: #ffffff;
  --text: #f5f6fa;
  --muted: rgba(245, 246, 250, 0.55);
  --danger: #f87171;
  --ok: #34d399;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background:
  radial-gradient(900px 500px at 50% -10%, rgba(34,211,238,0.07), transparent 60%),
  var(--bg); color: var(--text); }
button { font: inherit; border: 0; cursor: pointer; }
input, textarea { font: inherit; }
a { color: inherit; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 800; }
.brand-mark { width: 26px; height: 26px; color: var(--cyan);
  filter: drop-shadow(0 0 8px rgba(255,77,28,0.5)); }
.brand-mark svg { width: 100%; height: 100%; }
.dot { color: var(--cyan); }

/* ---------- buttons ---------- */
.btn { padding: 11px 20px; border-radius: 12px; font-weight: 600; font-size: 0.95rem;
  transition: transform .15s, background .2s, border-color .2s; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; border-radius: 10px; }
.btn-block { width: 100%; margin-top: 8px; }
.btn-primary { background: linear-gradient(135deg, #ff4d1c, #ff7a3c); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: rgba(34,211,238,0.06); border: 1px solid var(--line); color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; }
.btn-ghost:hover { border-color: var(--line-strong); }
.btn-danger { background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.3); color: var(--danger); }
.btn-danger:hover { background: rgba(248,113,113,0.2); }

/* ---------- login ---------- */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: min(400px, 100%); padding: 40px 32px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6); }
.login-card .brand { margin-bottom: 24px; }
.login-card h1 { margin: 0 0 6px; font-size: 1.6rem; font-weight: 800; }
.login-sub { margin: 0 0 24px; color: var(--muted); font-size: 0.95rem; }
.login-error { margin-top: 14px; padding: 10px 14px; border-radius: 10px;
  background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.3);
  color: var(--danger); font-size: 0.9rem; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.field input[type=text], .field input[type=password], .field input[type=number],
.field input[type=search], .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: rgba(4,6,13,0.7); border: 1px solid var(--line); color: var(--text);
  outline: none; transition: border-color .2s; }
.field input:focus, .field textarea:focus { border-color: var(--cyan); }
.field textarea { resize: vertical; }
.field-check { justify-content: flex-end; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text); }
.check input { width: 18px; height: 18px; accent-color: var(--cyan); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- dashboard ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--line);
  background: rgba(6,11,22,0.8); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 10; }
.topbar-tag { padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  background: rgba(34,211,238,0.12); color: var(--cyan); letter-spacing: 0.06em; }
.topbar-actions { display: flex; gap: 10px; }

.content { max-width: 1200px; margin: 0 auto; padding: 32px 28px 60px; }
.content-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.content-head h2 { margin: 0 0 4px; font-size: 1.7rem; font-weight: 800; }
.muted { margin: 0; color: var(--muted); font-size: 0.9rem; }

.admin-search { width: 100%; max-width: 360px; margin-bottom: 20px; padding: 11px 16px;
  border-radius: 12px; background: rgba(4,6,13,0.7); border: 1px solid var(--line);
  color: var(--text); outline: none; }
.admin-search:focus { border-color: var(--cyan); }

/* ---------- table ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  background: linear-gradient(160deg, var(--panel-2), var(--panel)); }
.products-table { width: 100%; border-collapse: collapse; }
.products-table th { text-align: left; padding: 14px 18px; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  border-bottom: 1px solid var(--line); font-weight: 600; }
.products-table td { padding: 14px 18px; border-bottom: 1px solid rgba(34,211,238,0.07);
  font-size: 0.92rem; vertical-align: middle; }
.products-table tr:last-child td { border-bottom: 0; }
.products-table tr:hover td { background: rgba(34,211,238,0.03); }
.cell-img { width: 56px; height: 42px; border-radius: 8px; object-fit: cover;
  background: rgba(34,211,238,0.08); border: 1px solid var(--line); }
.cell-img.ph { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.7rem; }
.cell-name { font-weight: 600; color: #fff; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-on { background: rgba(52,211,153,0.14); color: var(--ok); }
.badge-off { background: rgba(148,163,184,0.14); color: var(--muted); }
.row-actions { display: flex; gap: 8px; }
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }

/* ---------- editor modal ---------- */
.editor { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; }
.editor[hidden] { display: none; }
.editor-backdrop { position: absolute; inset: 0; background: rgba(2,5,12,0.8); backdrop-filter: blur(8px); }
.editor-card { position: relative; z-index: 1; width: min(720px, 100%); max-height: 90vh;
  display: flex; flex-direction: column; border-radius: 22px; border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  box-shadow: 0 40px 100px rgba(0,0,0,0.7); overflow: hidden; }
.editor-head { display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--line); }
.editor-head h3 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; background: rgba(34,211,238,0.06);
  border: 1px solid var(--line); color: var(--text); }
.icon-btn:hover { background: rgba(34,211,238,0.16); }
.editor-body { padding: 24px; overflow-y: auto; }
.editor-foot { display: flex; justify-content: flex-end; gap: 12px;
  padding: 18px 24px; border-top: 1px solid var(--line); }
.editor-error { position: absolute; bottom: 76px; left: 24px; right: 24px;
  padding: 10px 14px; border-radius: 10px; background: rgba(248,113,113,0.14);
  border: 1px solid rgba(248,113,113,0.3); color: var(--danger); font-size: 0.9rem; }

/* image */
.image-row { display: flex; gap: 16px; align-items: flex-start; }
.image-preview { width: 130px; height: 100px; border-radius: 12px; overflow: hidden;
  background: rgba(34,211,238,0.06); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-preview .ph { color: var(--muted); font-size: 0.8rem; }
.image-controls { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.image-controls input[type=text] { width: 100%; padding: 10px 14px; border-radius: 10px;
  background: rgba(4,6,13,0.7); border: 1px solid var(--line); color: var(--text); outline: none; }

/* specs */
.specs-editor { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.spec-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; }
.spec-row input { padding: 10px 12px; border-radius: 10px; background: rgba(4,6,13,0.7);
  border: 1px solid var(--line); color: var(--text); outline: none; }
.spec-row input:focus { border-color: var(--cyan); }
.spec-del { width: 40px; border-radius: 10px; background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25); color: var(--danger); }

/* toast */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 100; padding: 14px 24px; border-radius: 14px;
  background: linear-gradient(180deg, #0d1424, #070c17); border: 1px solid var(--line-strong);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6); font-weight: 500; }
.toast.ok { border-color: rgba(52,211,153,0.4); }
.toast.err { border-color: rgba(248,113,113,0.4); color: var(--danger); }

@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 24px 16px 40px; }
  .topbar { padding: 14px 16px; }
  .content-head { flex-direction: column; align-items: stretch; }
  .products-table th:nth-child(3), .products-table td:nth-child(3) { display: none; }
  .image-row { flex-direction: column; }
  .spec-row { grid-template-columns: 1fr 1fr auto; }
}
