: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; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.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: 8px;
}

.login-mobile-logo { display: none; margin-bottom: 20px; }
.login-mobile-logo svg { width: 48px; height: 48px; }

.login-card h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 6px; }
.login-sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 28px; }

.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; }
}

.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: 100vh; }

.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 120;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 90;
}

.sidebar-overlay.open { display: block; }

.sidebar {
  width: 260px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  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: 11px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--muted);
  border: none;
  background: transparent;
  text-align: left;
  font-size: 0.92rem;
  font-family: inherit;
  width: 100%;
  text-decoration: none;
  transition: 0.15s;
}

.nav-icon { font-size: 1rem; width: 22px; text-align: center; }

.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--accent); color: #fff; }

.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; overflow-x: auto; 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.65rem; font-weight: 700; letter-spacing: -0.02em; }
.page-sub { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

/* 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;
}

.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; }

.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; }
.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: 18px 20px;
  margin-bottom: 16px;
}

.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;
}

.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-logo {
  max-height: 36px;
  max-width: 120px;
  object-fit: contain;
}

.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) {
  .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.25s;
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 72px 16px 24px; }
  .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; }
}
