:root {
  --bg: #0b1020;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-soft: #eef2ff;
  --border: #e2e8f0;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: #eef2ff; }
body { min-height: 100vh; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 1160px; margin: 0 auto; padding: 24px; }
.topbar { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 14px; font-weight: 800; letter-spacing: .04em; }
.brand img { width: 180px; height: auto; }
.brand-copy { display: flex; align-items: center; min-height: 48px; }
.brand-copy strong { font-size: clamp(28px, 4vw, 40px); line-height: 1; }
.panel { background: var(--panel); border: 1px solid rgba(226,232,240,.85); box-shadow: var(--shadow); border-radius: 28px; }
.hero { display: grid; grid-template-columns: 1.3fr .8fr; gap: 20px; padding: 26px; margin-bottom: 24px; }
.hero-card { padding: 28px; background: linear-gradient(135deg, #111827 0%, #312e81 100%); color: white; border-radius: 24px; position: relative; overflow: hidden; }
.hero-card small { display: inline-block; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; opacity: .7; margin-bottom: 10px; }
.hero-card h1 { margin: 0 0 8px; font-size: clamp(30px, 4vw, 44px); line-height: 1.05; }
.hero-card p { margin: 0; color: rgba(255,255,255,.82); max-width: 520px; }
.hero-side { display: grid; gap: 14px; }
.stat { padding: 20px; border-radius: 22px; background: var(--panel-soft); }
.stat label { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; font-weight: 800; }
.stat strong { font-size: 24px; }
.filters { padding: 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.filters input, .filters select { border: 1px solid var(--border); background: white; border-radius: 16px; padding: 14px 16px; min-height: 50px; }
.filters input { flex: 1 1 260px; }
.chips { display: flex; gap: 10px; overflow: auto; padding: 0 6px 6px; }
.chip { border: 1px solid var(--border); background: white; color: var(--muted); padding: 10px 16px; border-radius: 999px; white-space: nowrap; font-size: 13px; font-weight: 700; }
.chip.active { background: var(--text); color: white; border-color: var(--text); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 20px; align-items: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-media { aspect-ratio: 1 / 1; background: #f8fafc; border-radius: 24px; display: grid; place-items: center; overflow: hidden; }
.card-media img { width: 74px; height: 74px; object-fit: contain; }
.card h3 { margin: 0; font-size: 17px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.price { font-size: 24px; font-weight: 800; color: var(--primary); }
.muted { color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 800; }
.badge.out { background: #fef2f2; color: var(--danger); }
.side-stack { display: grid; gap: 18px; position: sticky; top: 20px; }
.section { padding: 20px; }
.section h2, .section h3 { margin: 0 0 14px; }
.banner { border-radius: 22px; padding: 18px; color: white; background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); }
.banner + .banner { margin-top: 12px; }
.cart-item, .order-row, .admin-row, .variant-row { display: grid; gap: 10px; }
.cart-item { grid-template-columns: 1fr auto; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.cart-item:last-child { border-bottom: none; }
.btn { border: none; border-radius: 16px; padding: 13px 16px; background: var(--text); color: white; font-weight: 700; }
.btn.primary { background: var(--primary); }
.btn.soft { background: #eef2ff; color: var(--primary); }
.btn.ghost { background: white; color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: #fee2e2; color: var(--danger); }
.btn.full { width: 100%; }
.btn.small { padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.stack { display: grid; gap: 12px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; background: white; min-height: 52px; line-height: 1.35; }
.field textarea { min-height: 110px; resize: vertical; }
.notice { padding: 14px 16px; border-radius: 16px; background: #f8fafc; color: var(--muted); font-size: 14px; }
.toast { position: fixed; right: 24px; bottom: 24px; padding: 14px 16px; border-radius: 16px; background: rgba(15, 23, 42, .96); color: white; box-shadow: var(--shadow); z-index: 9999; display: none; max-width: 360px; }
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 1000; }
.modal.open { display: flex; }
.modal-card { max-width: 760px; width: 100%; max-height: 92vh; overflow: auto; background: white; border-radius: 28px; box-shadow: var(--shadow); padding: 24px; }
.modal-grid { display: grid; grid-template-columns: 260px 1fr; gap: 22px; }
.variant-list { display: grid; gap: 10px; }
.variant-pill { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; border: 1px solid var(--border); background: white; color: var(--text); border-radius: 16px; padding: 12px 14px; text-align: left; }
.variant-pill.active { border-color: var(--primary); background: var(--primary-soft); }
.auth-grid, .admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.auth-grid { align-items: start; }
.auth-card { align-content: start; gap: 14px; }
.auth-card h3 { margin: 0; }
.auth-card .btn { margin-top: 4px; }
.profile-head { align-items: center; }
.profile-head img { object-fit: contain; }
.admin-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 14px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; vertical-align: top; }
.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 420px; padding: 30px; }
.tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.tab-btn { padding: 12px 16px; border-radius: 14px; background: white; border: 1px solid var(--border); font-weight: 700; }
.tab-btn.active { background: var(--text); color: white; border-color: var(--text); }
.hidden { display: none !important; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-18 { margin-top: 18px; }
.mt-24 { margin-top: 24px; }
@media (max-width: 960px) {
  .hero, .layout, .modal-grid, .auth-grid, .admin-grid, .admin-grid.three { grid-template-columns: 1fr; }
  .side-stack { position: static; }
}
@media (max-width: 640px) {
  .app-shell { padding: 16px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .filters { padding: 14px; }
  .card-media img { width: 64px; height: 64px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-card { padding: 18px; }
}
