:root {
  --bg: #0a0e14;
  --sidebar: #0f1520;
  --surface: #151c28;
  --surface2: #1e2838;
  --surface3: #263246;
  --border: #2a3548;
  --text: #f0f4f8;
  --muted: #8b9cb3;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.12);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  min-height: 100dvh;
  overflow-x: clip;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
}

body.modal-open,
body:has(.modal-overlay:not(.hidden)),
body:has(.global-loader:not(.hidden)) {
  overflow: hidden;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.nowrap { white-space: nowrap; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Login split layout ── */
.login-screen {
  min-height: 100vh;
  padding: 0;
  background: var(--bg);
}

.login-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.login-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.visual-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.4), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.35), transparent 45%),
    linear-gradient(145deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
}

.visual-content {
  position: relative;
  z-index: 1;
  max-width: 380px;
}

.visual-logo svg { width: 64px; height: 64px; margin-bottom: 28px; }

.visual-content h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  line-height: 1.2;
}

.visual-content > p { color: rgba(255, 255, 255, 0.55); margin-bottom: 36px; }

.visual-features { list-style: none; display: flex; flex-direction: column; gap: 16px; }

.visual-features li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
}

.vf-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vf-icon svg { width: 20px; height: 20px; color: #93c5fd; }

.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 12px;
}

.login-mobile-logo { display: none; margin-bottom: 20px; }
.login-mobile-logo svg { width: 48px; height: 48px; }

.login-card h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; }
.login-sub { color: var(--muted); font-size: 0.95rem; margin-bottom: 28px; line-height: 1.5; }

.input-icon-wrap {
  position: relative;
  margin-bottom: 14px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--muted);
  pointer-events: none;
}

.input-icon svg { width: 100%; height: 100%; }

.input-icon-wrap input {
  width: 100%;
  padding: 14px 14px 14px 46px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: 0.2s;
}

.input-icon-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-glow {
  margin-top: 8px;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}

.btn-arrow { width: 18px; height: 18px; }

.back-shop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: 0.2s;
}

.back-shop svg { width: 18px; height: 18px; }
.back-shop:hover { color: var(--accent); text-decoration: none; }

@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-mobile-logo { display: block; }
  .login-form-wrap { min-height: 100vh; min-height: 100dvh; }
}

.login-brand { text-align: center; margin-bottom: 28px; }

.brand-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.brand-icon.sm { width: 40px; height: 40px; font-size: 1.1rem; border-radius: 10px; margin: 0; flex-shrink: 0; }

.login-brand h1 { font-size: 1.45rem; font-weight: 700; margin-bottom: 6px; }
.login-brand p { color: var(--muted); font-size: 0.9rem; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group textarea { min-height: 88px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.92rem;
  font-family: inherit;
  transition: 0.2s;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 0.82rem; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-success { background: var(--success); color: #052e16; }
.btn-success:hover:not(:disabled) { filter: brightness(1.05); }

.btn-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.25); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface2); }

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 12px;
  min-height: 1.2em;
}

.setup-note {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.7;
}

.setup-note summary { cursor: pointer; font-weight: 600; color: var(--text); }
.setup-note ol { margin: 10px 0 0 18px; }

.login-footer { margin-top: 18px; text-align: center; font-size: 0.9rem; }

/* ── Dashboard ── */
.dashboard {
  display: flex;
  min-height: 100%;
  min-height: 100dvh;
}

.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 120;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 90;
}

.sidebar-overlay.open { display: block; }

.sidebar {
  width: 264px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-brand strong { display: block; font-size: 0.95rem; }
.sidebar-brand small { color: var(--muted); font-size: 0.78rem; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted);
  border: none;
  background: transparent;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  width: 100%;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-icon { font-size: 1rem; width: 22px; text-align: center; }

.nav-item:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.nav-item.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.28);
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
}

.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.logout-btn { color: var(--muted); }

.main {
  flex: 1;
  padding: 28px 32px 40px;
  overflow: visible;
  min-width: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.page-sub { color: var(--muted); font-size: 0.9rem; margin-top: 6px; line-height: 1.45; }

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.stat-card.warn { border-color: rgba(245, 158, 11, 0.3); background: var(--warn-soft); }

.stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.stat-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; }

/* Table */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}

.data-table th {
  background: var(--surface2);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }

.table-empty { text-align: center; color: var(--muted); padding: 32px !important; }
.table-empty.err { color: var(--danger); }

.thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface2);
  display: block;
}

.thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  opacity: 0.5;
}

.stock-low { color: var(--warn); font-weight: 600; }
.items-cell { max-width: 220px; font-size: 0.84rem; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.product-row-actions {
  align-items: center;
  min-width: 280px;
}

.product-inline-cat-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  width: 100%;
  margin-bottom: 4px;
}

.product-inline-cat {
  min-width: 118px;
  max-width: 150px;
  flex: 1 1 118px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
}

.product-inline-cat:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.product-inline-subcat {
  min-width: 118px;
  max-width: 160px;
  flex: 1 1 118px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
}

.product-inline-subcat:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.product-inline-subcat:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.product-inline-brand {
  min-width: 110px;
  max-width: 150px;
  flex: 1 1 110px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
}

.product-inline-brand:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.product-inline-brand:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.badge {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-ok { background: var(--success-soft); color: var(--success); }
.badge-off { background: var(--danger-soft); color: var(--danger); }

.status-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 0;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 0;
  margin-bottom: 18px;
}

.modal-header h2 { font-size: 1.25rem; font-weight: 700; }

.modal form { padding: 0 24px 24px; }

.btn-icon-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
}

.btn-icon-close:hover { background: var(--surface2); color: var(--text); }

.checkbox-row { margin-top: 4px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.92rem;
}
.checkbox-label input { width: auto; accent-color: var(--accent); }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  justify-content: flex-end;
}

/* Image upload */
.image-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg);
  cursor: pointer;
  transition: 0.2s;
  position: relative;
}

.image-drop-zone:hover,
.image-drop-zone.dragover { border-color: var(--accent); background: var(--accent-soft); }

.image-drop-zone.processing { pointer-events: none; opacity: 0.85; }

.drop-inner {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.file-input-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}

.drop-inner > *:not(.file-input-overlay) {
  pointer-events: none;
}

.drop-placeholder { text-align: center; padding: 12px; }
.drop-icon { font-size: 2rem; display: block; margin-bottom: 8px; opacity: 0.6; }
.drop-placeholder p { font-size: 0.9rem; margin-bottom: 6px; }
.drop-placeholder small { color: var(--muted); font-size: 0.78rem; }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
  text-decoration: underline;
}

.image-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--surface2);
}

.image-drop-zone.has-image .drop-inner { min-height: auto; }

.image-meta {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.image-progress { margin-top: 12px; }
.image-progress.hidden { display: none; }

/* Çoxlu şəkil qalereyası */
.price-old { text-decoration: line-through; }
.sale-tag {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  vertical-align: middle;
}

.thumb-wrap { position: relative; display: inline-block; }

/* Aksiya tab */
.promo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.promo-filter-select {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
}

.promo-discount-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.promo-discount-wrap label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}

.promo-discount-wrap input {
  width: 56px;
  padding: 4px 6px;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
}

.promo-discount-wrap input:focus { outline: none; }
.promo-pct { font-weight: 700; color: var(--muted); font-size: 0.88rem; }

.promo-ends-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 190px;
}
.promo-ends-wrap label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.promo-ends-wrap input[type="datetime-local"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: 0.88rem;
}
.promo-ends-help {
  font-size: 0.72rem;
  color: var(--muted);
}
.promo-ends-date {
  font-size: 0.82rem;
  color: #b45309;
  font-weight: 600;
}

.promo-table .col-check { width: 42px; }
.promo-table .col-check input { width: auto; accent-color: var(--accent); cursor: pointer; }

.bestsellers-table .col-rank { width: 48px; }
.bs-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--surface2);
}
.bs-rank-1 { color: #92400e; background: #fef3c7; }
.bs-rank-2 { color: #475569; background: #e2e8f0; }
.bs-rank-3 { color: #9a3412; background: #ffedd5; }
.bs-sold { color: #b45309; font-size: 1.05rem; }
.bs-has-sales td:nth-child(6) { background: rgba(254, 243, 199, 0.25); }

.promo-preview strong { color: var(--accent); }

.thumb-count {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.image-gallery.hidden { display: none; }

.img-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.img-tile img { width: 100%; height: 100%; object-fit: cover; }

.img-tile-main {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: var(--accent);
  color: #04130a;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.img-tile-remove,
.img-tile-star {
  position: absolute;
  top: 5px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-tile-remove {
  right: 5px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
}
.img-tile-remove:hover { background: var(--danger); }
.img-tile-star {
  left: 5px;
  background: rgba(0, 0, 0, 0.62);
  color: #ffd24a;
}
.img-tile-star:hover { background: rgba(0, 0, 0, 0.85); }

.progress-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #6366f1);
  border-radius: 99px;
  transition: width 0.3s;
}

#imageProgressText { font-size: 0.78rem; color: var(--muted); }

/* Loader & toast */
.global-loader {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 36px;
  text-align: center;
  box-shadow: var(--shadow);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 14px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: min(420px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  z-index: 600;
  opacity: 0;
  transform: translateY(12px);
  transition: 0.3s;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  white-space: pre-line;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { border-color: rgba(34, 197, 94, 0.45); }
.toast.err { border-color: rgba(239, 68, 68, 0.45); }

/* Sifarişlər */
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.order-stats-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.order-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: center;
}

.order-stat-n {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.order-stat-l {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}

.order-stat.warn .order-stat-n { color: #f59e0b; }
.order-stat.muted-stat .order-stat-n { color: var(--muted); }

.order-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.order-folders {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.order-folder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  transition: 0.15s;
}

.order-folder:hover { border-color: var(--accent); }
.order-folder.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.of-icon { font-size: 0.9rem; }
.of-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface2);
  font-size: 0.72rem;
  font-weight: 600;
}

.order-folder.active .of-count { background: rgba(99, 102, 241, 0.25); }

.order-search {
  min-width: 220px;
  max-width: 320px;
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.orders-table .order-num { font-family: ui-monospace, monospace; font-size: 0.85rem; }
.orders-table .items-cell { max-width: 220px; font-size: 0.82rem; color: var(--muted); }
.orders-table .order-actions { white-space: nowrap; }
.orders-table .order-actions .btn { margin: 2px 0; }

.phone-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.phone-link:hover { text-decoration: underline; }

.map-link {
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
}
.map-link:hover { opacity: 0.75; }

.od-map-btn { margin-top: 8px; align-self: flex-start; }

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.st-new { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
.st-accepted { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.st-shipped { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }
.st-completed { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.st-cancelled { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.st-deleted { background: rgba(107, 114, 128, 0.2); color: #d1d5db; }

.order-row.st-new td:first-child { box-shadow: inset 3px 0 0 #3b82f6; }

.order-detail-modal { max-width: 560px; }
.order-export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 22px 14px;
  border-bottom: 1px solid var(--border);
}

.order-modal-body { padding: 16px 22px 8px; }
.order-modal-actions {
  padding: 12px 22px 20px;
  border-top: 1px solid var(--border);
}

.od-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.od-block { display: flex; flex-direction: column; gap: 4px; }
.od-block.full { grid-column: 1 / -1; }
.od-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.od-total { font-size: 1.2rem; color: var(--accent); }
.od-items { margin: 0; padding-left: 18px; font-size: 0.9rem; }
.od-items li { margin-bottom: 4px; }
.od-note {
  width: 100%;
  min-height: 72px;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}

.od-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.btn-whatsapp {
  background: #25d366;
  color: #fff;
  border: none;
}

.btn-whatsapp:hover:not(:disabled) { filter: brightness(1.06); }

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Link & QR */
.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.share-card-logo {
  grid-column: 1 / -1;
}

.logo-a4-layout {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 24px;
  align-items: start;
}

.logo-size-spec {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 0.84rem;
}

.logo-size-spec strong { display: block; margin-bottom: 8px; font-size: 0.88rem; }
.logo-size-spec ul { margin: 0; padding-left: 18px; color: var(--muted); }
.logo-size-spec li { margin-bottom: 4px; }
.logo-size-spec code {
  font-size: 0.8rem;
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--accent);
}

.logo-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 8px 0 12px;
  min-height: 1.2em;
}

.logo-preview-box.dragover { border-color: var(--accent); background: var(--accent-soft); }

.a4-mockup-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
  text-align: center;
}

.a4-sheet-mini {
  aspect-ratio: 210 / 297;
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.a4-logo-zone {
  min-height: 28px;
  max-height: 36px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 6px;
  margin-bottom: 2px;
}

.a4-logo-preview {
  max-height: 28px;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.a4-logo-ph {
  font-size: 0.55rem;
  color: #9ca3af;
}

.a4-logo-ph.hidden { display: none; }

.a4-mock-line {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  width: 85%;
}

.a4-mock-line.wide { width: 100%; height: 6px; background: #d1fae5; }
.a4-mock-line.short { width: 55%; }

.a4-mock-block {
  flex: 1;
  min-height: 40px;
  background: #f0fdf4;
  border: 1px dashed #86efac;
  border-radius: 3px;
}

.logo-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 20px;
  margin-bottom: 14px;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s;
}

.logo-preview-box:hover { border-color: var(--accent); }
.logo-preview-box.has-logo { cursor: default; border-style: solid; }

.logo-preview-img {
  max-height: 88px;
  max-width: min(100%, 280px);
  object-fit: contain;
}

.logo-preview-empty {
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.logo-preview-empty.hidden { display: none; }
.logo-ph-icon { font-size: 2rem; opacity: 0.5; }
.logo-preview-empty small { font-size: 0.75rem; opacity: 0.8; }

.share-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.share-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.share-card-desc {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.share-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.share-url-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
}

.share-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-hint {
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--muted);
}

.share-hint code {
  font-size: 0.76rem;
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
}

.admin-qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.admin-qr-canvas {
  display: block;
  border-radius: 8px;
  max-width: 100%;
  height: auto;
}

.share-tips {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
}

.share-tips h4 {
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.share-tips ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.88rem;
}

.share-tips li { margin-bottom: 6px; }

.analytics-stats { grid-template-columns: repeat(4, 1fr); }

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.analytics-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.analytics-card-wide { margin-bottom: 16px; }

.analytics-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

.analytics-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 140px;
  padding-top: 8px;
}

.analytics-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.analytics-bar-track {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.analytics-bar-fill {
  width: 70%;
  max-width: 48px;
  background: linear-gradient(180deg, var(--accent) 0%, #2563eb 100%);
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
}

.analytics-bar-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}

.analytics-bar-lbl {
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.analytics-source-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.analytics-source-row:last-child { margin-bottom: 0; }

.analytics-source-name {
  flex: 0 0 120px;
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-source-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}

.analytics-source-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  min-width: 4px;
}

.analytics-source-count {
  flex: 0 0 36px;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.analytics-empty {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 12px 0;
}

.settings-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.settings-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.maintenance-card {
  border-color: #f59e0b;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), var(--surface));
}
.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.4;
}
.switch-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}
.field-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

.settings-help {
  font-size: 0.82rem;
  color: var(--muted);
  margin: -6px 0 12px;
}

.header-logo-slot {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
}

.header-logo-slot .logo-preview-img {
  max-height: 72px;
  max-width: min(100%, 280px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.favicon-preview-box {
  width: 120px;
  height: 120px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.favicon-preview-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.favicon-size-demo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.favicon-demo-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.favicon-demo {
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  box-sizing: content-box;
}

.favicon-demo-16 {
  width: 16px;
  height: 16px;
  padding: 2px;
}

.favicon-demo-32 {
  width: 32px;
  height: 32px;
  padding: 3px;
}

.favicon-size-demo.hidden {
  display: none;
}

.logo-manage-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.logo-manage-block:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.logo-manage-title {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.favicon-preview-empty .logo-ph-icon {
  font-size: 1.6rem;
}

.settings-logo-box {
  min-height: 100px;
}

.settings-preview {
  background: #0f1419;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  color: #e2e8f0;
}

.sp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sp-brand-mark {
  display: flex;
  align-items: center;
  height: 40px;
  max-width: 140px;
  flex-shrink: 0;
}

.sp-logo {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.sp-logo-ph {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #22c55e, #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.sp-header strong { display: block; font-size: 0.95rem; }
.sp-header small { color: #94a3b8; font-size: 0.72rem; }

.sp-badge {
  display: inline-block;
  font-size: 0.68rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  margin-bottom: 8px;
}

.sp-hero-title {
  display: block;
  font-size: 1rem;
  margin-bottom: 6px;
}

.sp-hero-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 10px;
  line-height: 1.4;
}

.sp-btn {
  display: inline-block;
  background: #22c55e;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
}

.settings-aside .settings-card:last-child {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  html, body {
    height: 100%;
    height: 100dvh;
    overflow: auto;
  }
  .dashboard {
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.25s;
  }
  .sidebar.open { transform: translateX(0); }
  .main {
    flex: 1;
    min-height: 0;
    min-width: 0;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 10px 14px calc(120px + env(safe-area-inset-bottom, 0px));
  }
  .stats-row { grid-template-columns: 1fr; }
  .order-stats-row { grid-template-columns: repeat(3, 1fr); }
  .order-toolbar { flex-direction: column; align-items: stretch; }
  .order-search { max-width: none; }
  .od-grid { grid-template-columns: 1fr; }
  .share-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
  .analytics-stats { grid-template-columns: repeat(2, 1fr); }
  .settings-layout { grid-template-columns: 1fr; }
  .logo-a4-layout { grid-template-columns: 1fr; }
  .a4-sheet-mini { max-width: 160px; }
  .form-row { grid-template-columns: 1fr; }
  .toast { left: 16px; right: 16px; bottom: 16px; }
}

.cat-icons-table .cat-admin-thumb {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

.cat-icons-table .cat-admin-placeholder {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: rgba(249, 115, 22, 0.12);
  color: #f97316;
  font-size: 0.75rem;
  font-weight: 800;
}

.cat-icons-table .cat-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cat-main-row-open td {
  background: rgba(249, 115, 22, 0.04);
}

.cat-subcats-row td {
  padding: 0 12px 16px;
  background: rgba(249, 115, 22, 0.03);
  border-bottom: 1px solid var(--border);
}

.cat-inline-subcats {
  margin: 8px 0 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
}

.cat-inline-subcats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cat-inline-subcats-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.cat-inline-subcats-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-add-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.cat-add-bar .order-search {
  flex: 1;
  min-width: 200px;
}

.cat-upload-btn {
  position: relative;
  cursor: pointer;
}

.cat-upload-btn .cat-icon-file {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.banners-admin-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.banner-add-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 12px;
}

.banner-add-cat-wrap {
  min-width: min(100%, 280px);
  flex: 1;
}

.banner-add-cat-wrap select {
  width: 100%;
}

.banner-add-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.banner-admin-warn {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.35);
  color: #b45309;
  font-size: 0.85rem;
  font-weight: 600;
}

.banner-admin-card {
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr;
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.banner-admin-preview {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface2);
  min-height: 100px;
}

.banner-admin-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.banner-admin-preview--home img,
.banner-admin-preview--category-large img {
  aspect-ratio: 21 / 7;
}

.banner-admin-preview--home-small img {
  aspect-ratio: 21 / 8;
}

.banner-size-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  pointer-events: none;
}

.banner-admin-preview .muted {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  aspect-ratio: 21 / 7;
  font-size: 0.85rem;
}

.banner-admin-preview--home-small .muted {
  aspect-ratio: 21 / 8;
}

.banner-admin-fields .form-row {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 12px;
}

.banner-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ads-section-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 28px 0 10px;
}

.ads-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ads-section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0 8px;
}

.partner-firm-admin-preview {
  min-height: 100px;
}

.partner-firm-admin-preview img {
  object-fit: contain;
  background: #fff;
  padding: 8px;
}

@media (max-width: 768px) {
  .banner-admin-card {
    grid-template-columns: 1fr;
  }
}

.warranty-admin-block {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--border);
}

.warranty-admin-block .warranty-text-input {
  width: 100%;
  margin-top: 10px;
}

.cat-lang-labels {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.cat-lang-labels b {
  color: var(--text);
  font-weight: 700;
  margin-right: 4px;
}

.cat-edit-modal { max-width: 480px; }

.cat-edit-system {
  margin: 0 24px 12px;
  font-size: 0.88rem;
}

.cat-edit-hint {
  margin: 0 24px 8px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.subcat-modal { max-width: 620px; }

.subcat-modal-body {
  padding: 0 24px 8px;
  max-height: min(70vh, 520px);
  overflow: auto;
}

.subcat-admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 16px;
}

.subcat-admin-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface2);
}

.subcat-admin-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.subcat-admin-item-head strong {
  font-size: 0.88rem;
}

.subcat-admin-icon-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.subcat-admin-icon-preview {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.subcat-admin-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.subcat-admin-icon-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  background: rgba(22, 163, 74, 0.08);
}

.subcat-add-box {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.subcat-add-title {
  font-size: 0.95rem;
  margin: 0 0 10px;
}

.subcat-modal-actions {
  padding: 0 24px 20px;
}

.badge-info {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.product-stats-cell {
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: nowrap;
}

.product-stats-cell small {
  color: var(--muted);
}

.warranty-cell {
  text-align: center;
  white-space: nowrap;
}

.warranty-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  color: var(--muted);
}

.warranty-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #16a34a;
  cursor: pointer;
}

.warranty-toggle:has(input:checked) {
  color: #16a34a;
  font-weight: 600;
}

.warranty-toggle-label {
  min-width: 2.5rem;
}

.telegram-setup-steps {
  margin: 8px 0 0 18px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.telegram-setup-steps code {
  font-size: 0.8rem;
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: 4px;
}

.file-pick {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface2);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}
.file-pick input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 18px;
}
.img-preview img { max-width: 100%; max-height: 220px; object-fit: contain; background: #0a0e14; border-radius: 10px; margin-top: 8px; }
input, textarea, select { font-size: 16px !important; }

@media (max-width: 900px) {
  .modal-overlay { padding: 0; align-items: stretch; }
  .modal {
    max-width: none;
    max-height: none;
    height: 100%;
    border-radius: 0;
  }
  .page-header { position: sticky; top: 0; z-index: 6; background: var(--bg); padding-bottom: 8px; }
  .page-header .btn, .btn { min-height: 44px; }
  .data-table { min-width: 0; }
  .nav-item { min-height: 46px; }
}

.admin-card-list {
  display: none;
  flex-direction: column;
  gap: 12px;
}
.admin-card-list.always-on { display: flex; }

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}
.admin-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.admin-card-head img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  background: #0a0e14;
  flex-shrink: 0;
}
.admin-card-head strong { display: block; font-size: 1.02rem; }
.admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  margin-top: 12px;
}
.admin-card-actions .btn {
  flex: 1 1 140px;
  min-width: 0;
  min-height: 44px;
}
.admin-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.perm-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 8px 0;
}
.perm-checks .checkbox-label { min-height: 44px; }
.status-pill {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
}
.status-pill.status-admin { background: var(--accent-soft, #e8f0ff); color: var(--accent); }
.admin-panel-check { font-weight: 700; }
.status-pill.status-active { background: var(--success-soft); color: var(--success); }
.status-pill.status-blocked { background: var(--danger-soft); color: var(--danger); }
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.filter-chips .chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
}
.filter-chips .chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.kicker-admin {
  display: block;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.sticky-save-bar {
  display: none;
  position: sticky;
  bottom: 0;
  z-index: 8;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, var(--bg) 30%);
}
.sidebar-nav { overflow-y: auto; min-height: 0; }

@media (max-width: 900px) {
  .desktop-table { display: none !important; }
  .admin-card-list { display: flex; }
  .main {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 10px 14px calc(120px + env(safe-area-inset-bottom, 0px));
  }
  .page-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
  }
  .page-header-actions { width: 100%; }
  .page-header-actions .btn { flex: 1 1 calc(50% - 8px); min-height: 44px; }
  .sticky-save-bar { display: block; }
  #tabSettings .page-header .btn { display: none; }
  .sidebar {
    width: min(86vw, 320px);
    padding-top: 64px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-menu-btn { width: 48px; height: 48px; }
  .checkbox-label { min-height: 44px; }
  .cat-add-bar { flex-direction: column; align-items: stretch; }
  .cat-add-bar .btn, .cat-add-bar input { width: 100%; min-height: 48px; }
}

.table-wrap { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); }
.sidebar.open {
  box-shadow: 18px 0 48px rgba(0, 0, 0, 0.35);
}

.page-header-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.member-card,
.pending-card {
  display: flex;
  flex-direction: column;
}

.member-card-info {
  min-width: 0;
  flex: 1;
}

.member-card-info strong {
  display: block;
  overflow-wrap: anywhere;
}

.member-card-phone {
  margin: 4px 0 0;
  font-size: 0.88rem;
}

.member-card-email {
  margin-top: 2px;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.member-actions .perm-checks {
  width: 100%;
  padding: 0;
  gap: 8px;
}

.member-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

.member-action-btns .btn {
  flex: 1 1 140px;
  max-width: 220px;
  min-width: 0;
  min-height: 44px;
}

@media (max-width: 900px) {
  .main {
    padding: 10px 14px calc(120px + env(safe-area-inset-bottom, 0px));
  }

  .page-header {
    position: sticky;
    top: 0;
    z-index: 6;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 10px;
    padding: 4px 0 8px 56px;
    min-height: 52px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .page-header-copy {
    flex: 1 1 auto;
    min-width: 0;
  }

  .page-header > .btn {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .page-header-actions {
    flex: 1 1 100%;
    width: calc(100% + 56px);
    margin-left: -56px;
  }

  .page-header-actions .btn {
    flex: 1 1 calc(50% - 8px);
    min-height: 44px;
  }

  .admin-card {
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    overflow: hidden;
    max-width: 100%;
  }

  .admin-card-head {
    margin-bottom: 8px;
    min-width: 0;
  }

  .admin-card-head strong {
    overflow-wrap: anywhere;
  }

  .admin-card-actions {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }

  .admin-card-actions .btn,
  .member-action-btns .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    max-width: none;
    min-height: 44px;
  }

  .admin-card-list {
    padding-top: 2px;
    padding-bottom: 8px;
  }

  .filter-chips {
    margin-bottom: 10px;
  }

  .data-table,
  .data-table .nowrap,
  .data-table td.nowrap,
  td.nowrap,
  .orders-table .order-actions {
    white-space: normal;
  }

  .data-table {
    min-width: 0;
  }

  .table-wrap {
    overflow-x: auto;
    max-width: 100%;
  }

  .perm-checks .checkbox-label {
    flex: 1 1 calc(33.33% - 8px);
    min-width: 72px;
    min-height: 44px;
    justify-content: center;
    padding: 0 6px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .page-header h1 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
  }

  .page-sub {
    display: none;
  }

  .page-header {
    margin-bottom: 8px;
    padding-top: 2px;
    padding-bottom: 6px;
    gap: 6px 8px;
  }

  .stats-row {
    margin-bottom: 12px;
    gap: 8px;
  }

  .stat-card {
    padding: 12px 14px;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .ads-section-title {
    font-size: 1rem;
    margin: 18px 0 8px;
  }

  .member-card-email {
    display: none;
  }

  .kicker-admin {
    margin-bottom: 2px;
  }

  .status-pill {
    margin-top: 4px;
  }
}

