*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0b0e1a; --bg2: #111528; --card: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.08); --accent: #7c3aed; --accent2: #a855f7;
  --green: #22c55e; --red: #ef4444; --text: #f1f5f9; --muted: #94a3b8;
}
body { font-family:'Inter',sans-serif; background:var(--bg); color:var(--text); min-height:100vh; }

/* LOGIN */
.login-screen { min-height:100vh; display:flex; align-items:center; justify-content:center;
  background-image: radial-gradient(ellipse at 30% 20%, rgba(124,58,237,0.2) 0%, transparent 60%); padding:20px; }
.login-card { background:var(--card); border:1px solid var(--border); border-radius:24px; padding:48px 40px; width:100%; max-width:420px; }
.login-logo { font-size:22px; font-weight:800; letter-spacing:1px; color:var(--accent2); margin-bottom:24px; }
.login-card h2 { font-size:24px; font-weight:800; margin-bottom:6px; }
.login-sub { color:var(--muted); font-size:14px; margin-bottom:32px; }
.field { display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
.field label { font-size:13px; font-weight:600; color:var(--muted); }
.field input, .field select, .field textarea {
  background:rgba(255,255,255,0.06); border:1px solid var(--border);
  border-radius:10px; padding:12px 14px; color:var(--text); font-size:15px; font-family:inherit;
  outline:none; transition:border-color .2s; resize:vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color:var(--accent2); }
.field input[type="file"] { padding:10px; cursor:pointer; }
.field-hint { background:rgba(255,193,7,0.08); border:1px solid rgba(255,193,7,0.2); border-radius:8px; padding:10px 12px; font-size:12px; color:#fbbf24; line-height:1.6; margin-bottom:8px; }
.field-hint code { background:rgba(255,255,255,0.1); padding:2px 5px; border-radius:4px; font-family:monospace; }
.error-msg { color:var(--red); font-size:13px; margin-bottom:12px; }
.form-msg { font-size:13px; margin-top:12px; padding:10px 14px; border-radius:8px; }
.form-msg.success { background:rgba(34,197,94,0.1); color:#4ade80; border:1px solid rgba(34,197,94,0.2); }
.form-msg.error { background:rgba(239,68,68,0.1); color:#f87171; border:1px solid rgba(239,68,68,0.2); }

/* BUTTONS */
.btn-primary { background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#fff; border:none; padding:12px 24px; border-radius:10px; font-size:15px; font-weight:700; cursor:pointer; width:100%; transition:.2s; font-family:inherit; }
.btn-primary:hover { opacity:.9; transform:translateY(-1px); }
.btn-secondary { background:rgba(255,255,255,0.08); color:var(--text); border:1px solid var(--border); padding:12px 24px; border-radius:10px; font-size:14px; font-weight:600; cursor:pointer; font-family:inherit; transition:.2s; }
.btn-secondary:hover { background:rgba(255,255,255,0.12); }
.btn-ghost { background:none; color:var(--muted); border:none; padding:12px 20px; border-radius:10px; font-size:14px; cursor:pointer; font-family:inherit; }
.btn-danger { background:rgba(239,68,68,0.2); color:var(--red); border:1px solid rgba(239,68,68,0.3); padding:10px 20px; border-radius:10px; font-size:14px; font-weight:600; cursor:pointer; font-family:inherit; }

/* ADMIN LAYOUT */
.admin-screen { display:flex; min-height:100vh; }
.sidebar { width:240px; background:var(--bg2); border-right:1px solid var(--border); display:flex; flex-direction:column; padding:24px 0; position:sticky; top:0; height:100vh; }
.sidebar-logo { font-size:16px; font-weight:800; color:var(--accent2); padding:0 20px 24px; border-bottom:1px solid var(--border); }
.sidebar-nav { flex:1; padding:16px 12px; display:flex; flex-direction:column; gap:4px; }
.nav-item { display:block; padding:10px 12px; border-radius:10px; color:var(--muted); text-decoration:none; font-size:14px; font-weight:500; transition:.2s; cursor:pointer; }
.nav-item:hover, .nav-item.active { background:rgba(124,58,237,0.15); color:var(--text); }
.logout-btn { background:none; border:none; border-top:1px solid var(--border); padding:16px 20px; color:var(--muted); font-size:14px; cursor:pointer; text-align:left; font-family:inherit; transition:.2s; }
.logout-btn:hover { color:var(--red); }

.admin-main { flex:1; padding:32px; overflow-y:auto; }
.tab-content { display:none; }
.tab-content.active { display:block; }
.tab-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:32px; }
.tab-header h1 { font-size:24px; font-weight:800; }
.tab-header .btn-primary { width:auto; }

/* PRODUCTS LIST */
.products-list { display:flex; flex-direction:column; gap:12px; }
.product-item { background:var(--card); border:1px solid var(--border); border-radius:14px; padding:16px 20px; display:flex; align-items:center; gap:16px; }
.product-item-img { width:60px; height:60px; border-radius:10px; object-fit:cover; background:#1a1d2e; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:28px; overflow:hidden; }
.product-item-img img { width:100%; height:100%; object-fit:cover; }
.product-item-info { flex:1; min-width:0; }
.product-item-info h3 { font-size:15px; font-weight:700; margin-bottom:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.product-item-meta { display:flex; gap:10px; font-size:12px; color:var(--muted); flex-wrap:wrap; }
.product-item-price { font-size:18px; font-weight:800; margin:0 8px; white-space:nowrap; }
.product-item-actions { display:flex; gap:8px; flex-shrink:0; }
.action-btn { background:rgba(255,255,255,0.06); border:1px solid var(--border); border-radius:8px; padding:7px 12px; font-size:12px; font-weight:600; cursor:pointer; color:var(--text); font-family:inherit; transition:.2s; white-space:nowrap; }
.action-btn:hover { background:rgba(255,255,255,0.1); }
.action-btn.active-btn { background:rgba(34,197,94,0.15); color:var(--green); border-color:rgba(34,197,94,0.3); }
.action-btn.inactive-btn { background:rgba(239,68,68,0.1); color:var(--red); border-color:rgba(239,68,68,0.2); }
.action-btn.edit-btn { background:rgba(124,58,237,0.15); color:var(--accent2); border-color:rgba(124,58,237,0.3); }
.action-btn.del-btn { background:rgba(239,68,68,0.1); color:var(--red); border-color:rgba(239,68,68,0.2); }
.inactive-item { opacity:.5; }

/* FORM */
.product-form { max-width:700px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:24px; }
.field.full { grid-column:1/-1; }
.form-actions { display:flex; gap:12px; align-items:center; }
.form-actions .btn-primary { width:auto; }

/* SETTINGS */
.backup-info { display:grid; grid-template-columns:1fr 1fr; gap:20px; max-width:700px; }
.info-card { background:var(--card); border:1px solid var(--border); border-radius:16px; padding:24px; }
.info-card h3 { font-size:16px; font-weight:700; margin-bottom:10px; }
.info-card p { font-size:14px; color:var(--muted); margin-bottom:20px; line-height:1.6; }
.info-card .btn-primary { width:auto; }

/* MODAL */
.modal { position:fixed; inset:0; background:rgba(0,0,0,0.7); display:flex; align-items:center; justify-content:center; z-index:999; padding:20px; }
.modal-box { background:var(--bg2); border:1px solid var(--border); border-radius:16px; padding:32px; max-width:400px; width:100%; }
.modal-box h3 { font-size:18px; font-weight:800; margin-bottom:10px; }
.modal-box p { color:var(--muted); font-size:14px; margin-bottom:24px; }
.modal-actions { display:flex; gap:10px; }

/* LOADING */
.loading { color:var(--muted); text-align:center; padding:40px; }
.empty { color:var(--muted); text-align:center; padding:40px; }

/* RESPONSIVE */
@media(max-width:768px) {
  .admin-screen { flex-direction:column; }
  .sidebar { width:100%; height:auto; position:static; flex-direction:row; flex-wrap:wrap; padding:12px; align-items:center; }
  .sidebar-logo { padding:0 12px 0 0; border-bottom:none; border-right:1px solid var(--border); margin-right:8px; }
  .sidebar-nav { flex-direction:row; flex-wrap:wrap; padding:4px; flex:unset; }
  .nav-item { font-size:12px; padding:6px 10px; }
  .logout-btn { border-top:none; padding:8px 12px; font-size:12px; }
  .admin-main { padding:16px; }
  .form-grid { grid-template-columns:1fr; }
  .field.full { grid-column:1; }
  .product-item { flex-wrap:wrap; }
  .product-item-actions { width:100%; justify-content:flex-end; }
  .backup-info { grid-template-columns:1fr; }
}
