:root {
  --bg: #f6f7fb; --surface: #fff; --text: #1d2233; --muted: #6b7289;
  --border: #e3e6ef; --accent: #0f766e; --accent-2: #e6f4f2; --danger: #dc2626; --ok: #16a34a;
  --shadow: 0 6px 24px rgba(20, 24, 50, .08); --radius: 14px;
}
[data-theme="dark"] {
  --bg: #0f1220; --surface: #181c2e; --text: #e8eaf4; --muted: #9aa0b8;
  --border: #2a2f47; --accent: #2dd4bf; --accent-2: #173532; --shadow: 0 6px 24px rgba(0,0,0,.4);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); transition: background .2s, color .2s; }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 20px; color: var(--text); }
nav { display: flex; gap: 4px; flex: 1; }
nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
nav a.active, nav a:hover { background: var(--accent-2); color: var(--accent); }
.actions { display: flex; align-items: center; gap: 10px; }

.btn { background: var(--accent); color: #fff; border: 0; padding: 9px 16px; border-radius: 10px;
  font: inherit; font-weight: 600; cursor: pointer; transition: transform .1s, opacity .2s; }
.btn:hover { opacity: .9; } .btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 10px;
  padding: 7px 10px; cursor: pointer; font: inherit; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 12px; text-align: center; }
.badge.bump { animation: bump .3s; }
@keyframes bump { 50% { transform: scale(1.4); } }

main { max-width: 1200px; margin: 0 auto; padding: 24px; }
h1 { margin: 0 0 16px; }

.hero { background: linear-gradient(135deg, var(--accent), #1d4ed8); color: #fff; border-radius: var(--radius);
  padding: 32px; margin-bottom: 24px; }
.hero h1 { margin: 0 0 6px; } .hero p { margin: 0; opacity: .9; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.filters input, .filters select { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; }
.filters input { flex: 1; min-width: 200px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; font: inherit; }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); transition: transform .15s;
  animation: fadeUp .3s both; }
.card:hover { transform: translateY(-3px); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
.card .emoji { font-size: 52px; text-align: center; background: var(--accent-2); border-radius: 12px; padding: 18px 0; }
.card h3 { margin: 4px 0 0; font-size: 16px; }
.card p { margin: 0; font-size: 14px; flex: 1; }
.card .foot { display: flex; justify-content: space-between; align-items: center; }
.price { font-weight: 800; font-size: 18px; }
.stock { font-size: 12px; }
.stock.low { color: var(--danger); }
.empty { text-align: center; padding: 60px 0; color: var(--muted); }

.skeleton { height: 280px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface), var(--border), var(--surface));
  background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); margin-bottom: 20px; }
.profile-head { display: flex; align-items: center; gap: 18px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 26px; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 20px; }
.stat { background: var(--accent-2); border-radius: 12px; padding: 14px; }
.stat b { display: block; font-size: 22px; }
.role { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--accent-2); color: var(--accent); }
.role.admin { background: #fde68a; color: #92400e; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); }
th { cursor: pointer; user-select: none; color: var(--muted); font-weight: 600; font-size: 13px; }
th:hover { color: var(--accent); }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--accent-2); }
.table-wrap { overflow-x: auto; }

.order { border-top: 1px solid var(--border); padding: 12px 0; }
.order-items { font-size: 14px; color: var(--muted); }

.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(400px, 100%); background: var(--surface);
  z-index: 30; transform: translateX(100%); transition: transform .25s; display: flex; flex-direction: column;
}
.drawer.open { transform: none; box-shadow: -8px 0 30px rgba(0,0,0,.15); }
.drawer-head, .drawer-foot { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex;
  justify-content: space-between; align-items: center; }
.drawer-foot { border-top: 1px solid var(--border); border-bottom: 0; flex-direction: column; gap: 12px; align-items: stretch; }
.drawer h2 { margin: 0; }
#cartItems { flex: 1; overflow-y: auto; padding: 8px 20px; }
.cart-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-line .emoji { font-size: 30px; }
.cart-line .info { flex: 1; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; }
.total { font-size: 18px; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }

dialog { border: 0; border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--text);
  width: min(400px, 92vw); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.4); }
#authForm { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
#authForm label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
#authForm input { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; }
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 12px; }
.tab { flex: 1; padding: 8px; border: 0; border-radius: 9px; background: none; color: var(--muted);
  font: inherit; font-weight: 600; cursor: pointer; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.row { display: flex; gap: 10px; justify-content: flex-end; }
.error { color: var(--danger); min-height: 1em; margin: 0; font-size: 14px; }
.demo { font-size: 13px; }

#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px;
  box-shadow: var(--shadow); animation: fadeUp .25s; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; gap: 10px; }
  nav { order: 3; width: 100%; }
  main { padding: 16px; }
  #userName { display: none; }
}

/* ---------- Bestrio əlavələri ---------- */
.logo b { color: var(--accent); }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.hero-badges span { background: rgba(255,255,255,.18); padding: 6px 12px; border-radius: 999px; font-size: 13px; }
.card:nth-child(4n+2) { animation-delay: .05s; } .card:nth-child(4n+3) { animation-delay: .1s; } .card:nth-child(4n+4) { animation-delay: .15s; }
.mfa-box { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.mfa-box img { width: 200px; height: 200px; border-radius: 12px; background: #fff; padding: 6px; }
.mfa-box code { font-size: 13px; background: var(--bg); padding: 6px 10px; border-radius: 8px; word-break: break-all; }
.otp-input { font-size: 26px !important; letter-spacing: 10px; text-align: center; font-family: ui-monospace, monospace; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.form-grid label, .stack label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.form-grid input, .stack input, .stack textarea, select.status {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.mt { margin-top: 16px; }
.tabs-inline { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--accent-2); color: var(--accent); }
.pill.new { background: #dbeafe; color: #1e40af; } .pill.processing { background: #fef3c7; color: #92400e; }
.pill.shipped { background: #e0e7ff; color: #3730a3; } .pill.delivered { background: #dcfce7; color: #166534; }
.pill.cancelled { background: #fee2e2; color: #991b1b; }
.role.employee { background: #e0f2fe; color: #075985; }
.ok-text { color: var(--ok); } .danger-text { color: var(--danger); }
.cart-addr { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
footer.site { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 16px; }
.inline-input { width: 90px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.warn-banner { background: #fef3c7; color: #92400e; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.m0 { margin: 0; }
