/* ==========================================================================
   GROCEASY ADMIN CONSOLE (OMS / PIM / CRM)
   ========================================================================== */

/* ==========================================================================
   GROCEASY ADMIN CONSOLE (OMS / PIM / CRM)
   THEMES: Light (Default) / Dark (Toggleable)
   ========================================================================== */

:root {
  --admin-bg: #F8FAFC;
  --admin-surface: #FFFFFF;
  --admin-card: #FFFFFF;
  --admin-elevated: #F1F5F9;
  --admin-border: #CBD5E1;
  --admin-border-subtle: rgba(15, 23, 42, 0.08);
  --admin-text-main: #0F172A;
  --admin-text-muted: #475569;
  --admin-text-faint: #64748B;
  
  --color-emerald: #047857;
  --color-emerald-dark: #065F46;
  --color-emerald-bg: #ECFDF5;
  --color-amber: #B45309;
  --color-amber-bg: #FFFBEB;
  --color-blue: #1D4ED8;
  --color-blue-bg: #EFF6FF;
  --color-rose: #B91C1C;
  --color-rose-bg: #FEF2F2;
  --color-purple: #6D28D9;
  --color-purple-bg: #F5F3FF;

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 14px rgba(15, 23, 42, 0.04);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --admin-bg: #091310;
  --admin-surface: #10201A;
  --admin-card: #152A23;
  --admin-elevated: #1B342B;
  --admin-border: #234338;
  --admin-border-subtle: rgba(255, 255, 255, 0.08);
  --admin-text-main: #F3F4F6;
  --admin-text-muted: #9CA3AF;
  --admin-text-faint: #9CA3AF;
  
  --color-emerald: #34D399;
  --color-emerald-dark: #10B981;
  --color-emerald-bg: rgba(16, 185, 129, 0.2);
  --color-amber: #FBBF24;
  --color-amber-bg: rgba(245, 158, 11, 0.2);
  --color-blue: #60A5FA;
  --color-blue-bg: rgba(59, 130, 246, 0.2);
  --color-rose: #F87171;
  --color-rose-bg: rgba(239, 68, 68, 0.2);
  --color-purple: #A78BFA;
  --color-purple-bg: rgba(139, 92, 246, 0.2);

  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.25);
}

html, body.admin-body {
  max-width: 100vw;
  overflow-x: hidden;
}

body.admin-body {
  font-family: var(--font-body);
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ================= 1. HEADER ================= */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--admin-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  max-width: 100vw;
  box-sizing: border-box;
}

.admin-top-bar {
  height: 60px;
  background-color: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  box-sizing: border-box;
}

.admin-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 0 0 auto;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.admin-logo-badge {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #059669, #047857);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(4, 120, 87, 0.3);
}

.admin-brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--admin-text-main);
}

.brand-sub {
  color: var(--color-emerald);
  font-weight: 800;
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--admin-text-muted);
  font-weight: 500;
}

/* Nav Bar (Опущено ниже под основной шапкой) */
.admin-nav-bar {
  min-height: 52px;
  height: auto;
  background-color: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  padding: 6px 24px;
  box-sizing: border-box;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.admin-nav-bar::-webkit-scrollbar {
  display: none;
}

.admin-nav-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background-color: var(--admin-card);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--admin-border);
  white-space: nowrap;
}

.admin-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--admin-text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: var(--transition);
}

.admin-nav-btn:hover {
  color: var(--admin-text-main);
  background-color: var(--admin-elevated);
}

.admin-nav-btn.active {
  background-color: var(--color-emerald);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(4, 120, 87, 0.25);
}

.nav-badge {
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.3);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Header Right */
.admin-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.admin-quick-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--color-emerald-bg);
  color: var(--color-emerald);
  border: 1px solid rgba(4, 120, 87, 0.25);
  padding: 7px 14px;
  min-height: 38px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.admin-quick-btn:hover {
  background-color: rgba(4, 120, 87, 0.15);
  transform: translateY(-1px);
}

[data-theme="dark"] .admin-quick-btn {
  border-color: rgba(52, 211, 153, 0.3);
}

.admin-store-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--admin-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 12px;
  min-height: 38px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.admin-store-link:hover {
  color: var(--admin-text-main);
  background-color: var(--admin-elevated);
}

.admin-user-pill {
  position: relative;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--admin-card);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-main);
  box-sizing: border-box;
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--transition);
}

.admin-user-pill:hover {
  border-color: var(--color-emerald);
}

.admin-user-pill .user-label {
  display: none !important;
}

.admin-user-pill .admin-user-default-icon {
  color: var(--admin-text-muted);
}

.admin-user-pill .user-status-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--color-emerald);
  border: 2px solid var(--admin-bg, #0b130e);
  box-shadow: 0 0 6px var(--color-emerald);
}

/* ================= 2. KPI METRICS STRIP ================= */
.admin-metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 24px;
  background-color: var(--admin-elevated);
  border-bottom: 1px solid var(--admin-border);
}

[data-theme="dark"] .admin-metrics-strip {
  background-color: rgba(16, 32, 26, 0.5);
}

.metric-card {
  background-color: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  transition: var(--transition);
}

.metric-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.metric-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-revenue { background: rgba(16, 185, 129, 0.15); color: var(--color-emerald); }
.icon-orders { background: rgba(59, 130, 246, 0.15); color: var(--color-blue); }
.icon-avg { background: rgba(245, 158, 11, 0.15); color: var(--color-amber); }
.icon-stock { background: rgba(139, 92, 246, 0.15); color: var(--color-purple); }

.metric-content {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  font-weight: 500;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--admin-text-main);
  margin-top: 2px;
  letter-spacing: -0.02em;
}

.metric-trend {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.trend-up {
  background: var(--color-emerald-bg);
  color: var(--color-emerald);
  border: 1px solid rgba(4, 120, 87, 0.25);
}

[data-theme="dark"] .trend-up {
  border-color: rgba(52, 211, 153, 0.25);
}

.metric-sub-pill, .metric-note, .metric-status-ok {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--admin-text-muted);
}

.metric-status-ok {
  color: var(--color-emerald);
}

/* ================= 3. MAIN PANE ================= */
.admin-main-container {
  flex: 1;
  padding: 24px;
  min-width: 0;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
}

.admin-tab-pane {
  min-width: 0;
  max-width: 100%;
}

.pane-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.pane-header-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--admin-text-main);
}

.pane-header-sub {
  font-size: 0.82rem;
  color: var(--admin-text-muted);
  display: block;
  margin-top: 2px;
}

.search-filter-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--admin-surface);
  border: 1px solid var(--admin-border);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  width: 360px;
  color: var(--admin-text-muted);
}

.search-filter-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--admin-text-main);
  font-size: 0.88rem;
  font-family: var(--font-body);
  width: 100%;
}

.view-toggle-group {
  display: flex;
  gap: 4px;
  background-color: var(--admin-surface);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--admin-border);
}

.view-btn {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--admin-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.view-btn.active {
  background-color: var(--admin-card);
  color: var(--admin-text-main);
  border: 1px solid var(--admin-border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.btn-export-excel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  border-radius: var(--radius-md, 8px);
  background-color: var(--admin-card, #ffffff);
  color: var(--color-emerald, #059669);
  border: 1px solid rgba(5, 150, 105, 0.35);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: var(--transition, all 0.2s ease);
}

.btn-export-excel:hover {
  background-color: #ecfdf5;
  border-color: #059669;
  color: #047857;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(5, 150, 105, 0.18);
}

.btn-export-excel:active {
  transform: translateY(0);
}

[data-theme="dark"] .btn-export-excel {
  background-color: var(--admin-card, #1e293b);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
}

[data-theme="dark"] .btn-export-excel:hover {
  background-color: rgba(16, 185, 129, 0.16);
  border-color: #34d399;
}

/* ================= COURIER DISPATCH CARD ================= */
.courier-dispatch-card {
  background-color: var(--admin-card, #ffffff);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg, 12px);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.courier-dispatch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.courier-dispatch-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.courier-dispatch-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.courier-dispatch-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--admin-text-main);
  margin: 0;
}

.courier-dispatch-desc {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  margin: 2px 0 0 0;
}

.courier-save-status-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-emerald, #059669);
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
}

.courier-dispatch-form {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 12px;
  align-items: flex-end;
}

.courier-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.courier-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--admin-text-muted);
}

.courier-input {
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  background-color: var(--admin-surface, #f8fafc);
  color: var(--admin-text-main);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
  width: 100%;
}

.courier-input:focus {
  border-color: var(--color-emerald, #059669);
  background-color: var(--admin-card, #ffffff);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.courier-actions-group {
  display: flex;
  align-items: flex-end;
}

.btn-save-courier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  border: none;
  background-color: var(--color-emerald, #059669);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.2);
}

.btn-save-courier:hover {
  background-color: #047857;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(5, 150, 105, 0.25);
}

.btn-save-courier:active {
  transform: translateY(0);
}

[data-theme="dark"] .courier-dispatch-card {
  background-color: var(--admin-card, #1e293b);
  border-color: var(--admin-border, #334155);
}

[data-theme="dark"] .courier-input {
  background-color: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

[data-theme="dark"] .courier-input:focus {
  border-color: #34d399;
  background-color: rgba(15, 23, 42, 0.9);
}

@media (max-width: 992px) {
  .courier-dispatch-form {
    grid-template-columns: 1fr 1fr;
  }
  .courier-actions-group {
    grid-column: span 2;
  }
  .btn-save-courier {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .courier-dispatch-form {
    grid-template-columns: 1fr;
  }
  .courier-actions-group {
    grid-column: span 1;
  }
}

/* ================= 4. KANBAN BOARD ================= */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 24px;
}

.kanban-col {
  background-color: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--admin-border);
}

.col-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-new { background-color: var(--color-blue); box-shadow: 0 0 6px var(--color-blue); }
.dot-processing { background-color: var(--color-amber); box-shadow: 0 0 6px var(--color-amber); }
.dot-transit { background-color: #6366F1; box-shadow: 0 0 6px #6366F1; }
.dot-delivered { background-color: var(--color-emerald); box-shadow: 0 0 6px var(--color-emerald); }

.col-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--admin-text-main);
}

.col-count {
  font-size: 0.75rem;
  font-weight: 700;
  background-color: var(--admin-card);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: var(--admin-text-muted);
}

.col-cards-dropzone {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 120px;
  padding: 6px;
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.col-cards-dropzone.drag-over,
.kanban-col.drag-over {
  background-color: rgba(16, 185, 129, 0.08) !important;
  border: 2px dashed var(--color-emerald, #10b981) !important;
  border-radius: var(--radius-md);
}

/* KANBAN ORDER CARD */
.admin-order-card {
  background-color: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: grab;
  user-select: none;
  transition: var(--transition);
  position: relative;
}

.admin-order-card:active {
  cursor: grabbing;
}

.admin-order-card.dragging {
  opacity: 0.45;
  transform: scale(0.98);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.admin-order-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.order-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.order-num-tag {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 2px 9px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.08);
}

[data-theme="dark"] .order-num-tag {
  color: #34d399;
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.order-time-stamp {
  font-size: 0.75rem;
  color: var(--admin-text-muted);
}

.order-customer-info {
  font-size: 0.82rem;
  color: var(--admin-text-main);
  margin-bottom: 4px;
  font-weight: 500;
}

.order-phone-info {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.order-phone-link {
  color: var(--admin-text-main);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.order-phone-link:hover {
  color: var(--color-emerald);
  text-decoration: underline;
}

.order-addr-info {
  font-size: 0.78rem;
  color: var(--admin-text-muted);
  margin-bottom: 10px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.order-items-preview-strip {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.order-item-chip-img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--admin-border);
  flex-shrink: 0;
}

.order-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
}

.order-total-price {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-emerald);
}

.order-advance-btn {
  background-color: var(--admin-elevated);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-main);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}

.order-advance-btn:hover {
  background-color: var(--color-emerald);
  border-color: var(--color-emerald);
}

/* ================= 5. PRODUCTS & INVENTORY (PIM) ================= */
.products-grid-admin {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.admin-product-item {
  background-color: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
}

.admin-product-item:hover {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: var(--shadow-card);
}

.admin-product-top {
  display: flex;
  gap: 12px;
}

.admin-prod-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--admin-border);
}

.admin-prod-details {
  flex: 1;
}

.admin-prod-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--admin-text-main);
  line-height: 1.25;
}

.admin-prod-cat {
  font-size: 0.75rem;
  color: var(--admin-text-muted);
  margin-top: 4px;
}

.admin-prod-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--admin-border);
  padding-top: 12px;
}

.admin-price-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.admin-price-input {
  width: 70px;
  background-color: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  color: var(--admin-text-main);
  font-family: var(--font-heading);
  font-weight: 700;
  padding: 4px 6px;
  text-align: right;
  outline: none;
}

.stock-toggle-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  box-sizing: border-box;
  text-align: center;
}

.stock-toggle-btn.in-stock {
  background-color: var(--color-emerald-bg);
  color: var(--color-emerald);
  border: 1px solid rgba(4, 120, 87, 0.25);
}

[data-theme="dark"] .stock-toggle-btn.in-stock {
  border-color: rgba(52, 211, 153, 0.3);
}

.stock-toggle-btn.out-stock {
  background-color: var(--color-rose-bg);
  color: var(--color-rose);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

[data-theme="dark"] .stock-toggle-btn.out-stock {
  border-color: rgba(239, 68, 68, 0.3);
}

/* ================= 6. PROMOS & CRM ================= */
.promos-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.promo-card-admin {
  background-color: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.promo-badge-tag {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-emerald);
  background-color: var(--color-emerald-bg);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(4, 120, 87, 0.4);
  width: fit-content;
}

[data-theme="dark"] .promo-badge-tag {
  border-color: rgba(52, 211, 153, 0.4);
}

.admin-btn-primary {
  background-color: var(--color-emerald);
  color: #FFFFFF;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}

.admin-btn-primary:hover {
  background-color: var(--color-emerald-dark);
}

/* Table */
.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.admin-data-table th, .admin-data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
  font-size: 0.85rem;
}

.admin-data-table th {
  background-color: var(--admin-card);
  color: var(--admin-text-muted);
  font-weight: 600;
}

.admin-data-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* ================= 7. MODAL (DETAIL & PACKING SLIP) ================= */
.admin-dialog {
  padding: 0;
  border: none;
  background: transparent;
  max-width: 650px;
  width: 90vw;
  margin: auto;
}

.admin-dialog.admin-dialog-lg {
  max-width: 920px;
  width: 95vw;
}

.admin-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.admin-modal-card {
  background-color: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  color: var(--admin-text-main);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.admin-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.admin-modal-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--admin-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

#modal-order-id {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 3px 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.08);
}

[data-theme="dark"] #modal-order-id {
  color: #34d399;
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.admin-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--color-emerald-bg);
  color: var(--color-emerald);
  border: 1px solid rgba(4, 120, 87, 0.25);
}

.badge-status-processing {
  background-color: var(--color-amber-bg);
  color: var(--color-amber);
  border: 1px solid rgba(180, 83, 9, 0.25);
}

.badge-status-new {
  background-color: var(--color-blue-bg);
  color: var(--color-blue);
  border: 1px solid rgba(29, 78, 216, 0.25);
}

.badge-status-transit {
  background-color: #EEF2FF;
  color: #4338CA;
  border: 1px solid rgba(67, 56, 202, 0.25);
}

.badge-status-delivered {
  background-color: var(--color-emerald-bg);
  color: var(--color-emerald);
  border: 1px solid rgba(4, 120, 87, 0.25);
}

[data-theme="dark"] .badge-status-transit {
  background-color: rgba(99, 102, 241, 0.2);
  color: #A5B4FC;
  border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .badge-status-new {
  border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .badge-status-processing {
  border-color: rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .badge-status-delivered {
  border-color: rgba(52, 211, 153, 0.3);
}

.badge-weight-recalc {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--color-emerald-bg);
  color: var(--color-emerald);
  border: 1px solid rgba(4, 120, 87, 0.25);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

[data-theme="dark"] .badge-weight-recalc {
  border-color: rgba(52, 211, 153, 0.25);
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.admin-header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--admin-border);
  background: var(--admin-card);
  color: var(--admin-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  box-sizing: border-box;
}

.btn-table-duplicate {
  background: var(--admin-elevated);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-muted);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  box-sizing: border-box;
}

.btn-table-duplicate:hover {
  background: var(--admin-card);
  color: var(--color-emerald);
  border-color: rgba(5, 150, 105, 0.4);
}

.admin-header-icon-btn:hover {
  background: var(--admin-elevated);
  color: var(--color-emerald);
  border-color: rgba(5, 150, 105, 0.4);
  transform: translateY(-1px);
}

.admin-header-icon-btn:focus-visible {
  outline: 2px solid var(--color-emerald);
  outline-offset: 2px;
}

.admin-close-btn {
  background: transparent;
  border: none;
  color: var(--admin-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

.admin-modal-body {
  padding: 20px;
  overflow-y: auto;
}

.admin-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Order Modal Footer & Unified Apple/HIG Action Buttons */
.order-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--admin-border);
  background: var(--admin-surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-footer-utils {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.order-footer-pipeline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.order-footer-btn {
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
  line-height: 1;
  text-decoration: none;
}

.order-footer-btn-util {
  background-color: var(--admin-card);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-main);
}

.order-footer-btn-util:hover {
  background-color: var(--admin-elevated);
  border-color: var(--color-emerald);
}

.order-footer-btn-danger {
  background-color: var(--color-rose-bg, #fee2e2);
  color: var(--color-rose, #dc2626);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.order-footer-btn-danger:hover {
  background-color: #fecaca;
  border-color: #dc2626;
}

.order-status-btn {
  color: #FFFFFF;
  border: 1px solid transparent;
}

.status-btn-processing {
  background-color: #D97706;
}

.status-btn-processing:hover {
  background-color: #B45309;
}

.status-btn-transit {
  background-color: #4F46E5;
}

.status-btn-transit:hover {
  background-color: #4338CA;
}

.status-btn-delivered {
  background-color: #059669;
}

.status-btn-delivered:hover {
  background-color: #047857;
}

.order-status-btn.is-current-status {
  box-shadow: 0 0 0 2px var(--admin-surface), 0 0 0 4px currentColor;
  font-weight: 700;
}

.btn-print-slip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--admin-card);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-main);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-print-slip:hover {
  background-color: var(--admin-elevated);
}

/* Print CSS */
@media print {
  body * {
    visibility: hidden;
  }
  #admin-order-modal, #admin-order-modal * {
    visibility: visible;
  }
  #admin-order-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .admin-modal-card {
    border: none;
    background: #FFFFFF;
    color: #000000;
    box-shadow: none;
  }
  .admin-header, .admin-metrics-strip, .admin-close-btn, .admin-modal-footer {
    display: none !important;
  }
}

/* ================= 9. STOCK CONTROLS & MASTER SWITCHES ================= */
.stock-master-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.stock-toggle-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--admin-card);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-border-subtle);
}

.stock-box-label {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  font-weight: 500;
}

.stock-state-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-emerald);
}

/* Toggle Switch UI & Wrapper */
.switch-control-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  margin: 0;
  vertical-align: middle;
}

.switch-control-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--admin-text-main);
  white-space: nowrap;
}

.switch-ui {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  min-width: 44px;
  max-width: 44px;
  min-height: 24px;
  max-height: 24px;
  flex-shrink: 0;
  vertical-align: middle;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: -10px;
  right: -10px;
}

.switch-ui input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.slider-ui {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #374151;
  transition: background-color 0.2s ease;
  border-radius: 24px;
}

.slider-ui:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  bottom: auto;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.switch-ui input:checked + .slider-ui {
  background-color: var(--color-emerald);
}

.switch-ui input:checked + .slider-ui:before {
  transform: translateX(20px);
}

/* Filter Toolbar */
.admin-filter-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  flex: 1;
  max-width: 360px;
}

.admin-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--admin-text-main);
  font-size: 0.88rem;
  width: 100%;
}

.admin-select-box select {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  color: var(--admin-text-main);
  padding: 8px 14px;
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
}

/* Products Table */
.products-table-wrap {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.products-table-admin input[type="number"] {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  color: var(--admin-text-main);
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  width: 85px;
  outline: none;
}

.products-table-admin input[type="number"]:focus {
  border-color: var(--color-emerald);
}

.prod-stock-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.prod-stock-unit {
  font-size: 0.78rem;
  color: var(--admin-text-muted);
}

.btn-prod-action {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-prod-edit {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
}

.btn-prod-edit:hover {
  background: rgba(59, 130, 246, 0.3);
}

.btn-prod-delete {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
}

.btn-prod-delete:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Categories Grid */
.categories-grid-admin {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .categories-grid-admin {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .categories-grid-admin {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

@media (min-width: 1440px) {
  .categories-grid-admin {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

@media (min-width: 2200px) {
  .categories-grid-admin {
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
  }
}

.admin-category-card,
.category-admin-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md, 12px);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease,
              box-shadow 0.2s ease;
  position: relative;
}

.admin-category-card:hover,
.category-admin-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.admin-category-card.cat-disabled {
  opacity: 0.65;
  background: var(--admin-elevated);
  border-style: dashed;
}

.cat-card-header,
.category-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.cat-card-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.cat-icon-badge,
.cat-emoji-badge {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--admin-elevated);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  overflow: hidden;
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.cat-card-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-card-title,
.category-card-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--admin-text-main);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.cat-card-slug-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--admin-text-muted);
  flex-wrap: wrap;
}

.cat-card-sub,
.category-card-sub {
  font-size: 0.78rem;
  color: var(--admin-text-muted);
}

.cat-slug-pill {
  font-size: 0.75rem;
  color: var(--admin-text-muted);
}

.cat-slug-pill code {
  color: var(--color-emerald);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  background: rgba(16, 185, 129, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
}

.cat-card-header .switch-ui,
.category-card-top .switch-ui {
  flex-shrink: 0;
  margin: 0;
}

.cat-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--admin-border);
  gap: 12px;
  flex-wrap: wrap;
}

.cat-card-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--admin-text-muted);
  font-weight: 600;
}

.cat-card-count svg {
  flex-shrink: 0;
  color: var(--admin-text-muted);
}

.cat-count-val {
  color: var(--admin-text-main);
  font-weight: 700;
}

.cat-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-edit-cat,
.btn-delete-cat {
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-edit-cat {
  background: var(--admin-elevated);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-main);
}

.btn-edit-cat:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--color-emerald) !important;
  color: var(--color-emerald) !important;
}

.btn-delete-cat {
  background: var(--color-rose-bg, #fee2e2);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--color-rose, #dc2626);
}

.btn-delete-cat:hover {
  background: #fecaca !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
}

[data-theme="dark"] .btn-delete-cat {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

[data-theme="dark"] .btn-delete-cat:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
}

/* Settings Tab */
.settings-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1024px) {
  .settings-grid-layout {
    grid-template-columns: 1fr;
  }
}

.settings-section-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 20px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--admin-border-subtle);
}

.settings-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-title {
  font-weight: 700;
  font-size: 1rem;
}

.settings-sub {
  font-size: 0.78rem;
  color: var(--admin-text-muted);
}

.settings-form-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--admin-text-muted);
}

.form-group input, .form-group select, .form-group textarea {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  color: var(--admin-text-main);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--color-emerald);
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.form-group {
  min-width: 0;
}

.form-group label {
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
}

@media (max-width: 640px) {
  .form-row-2,
  .form-row-3 {
    grid-template-columns: 1fr;
  }
}

/* Global Responsive Table Containment */
.orders-table-view,
.products-table-wrap,
.customers-table-wrap,
.admins-table-wrap,
.table-responsive {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

/* Promotional Banner Grid */
.promo-banner-admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(340px, 1.2fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .promo-banner-admin-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Telegram Channel Subscription Settings Grid */
.channel-sub-admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .channel-sub-admin-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Order Detail Modal Summary Grid */
.order-modal-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  background: var(--admin-card);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--admin-border);
}
@media (max-width: 640px) {
  .admin-modal-header {
    padding: 12px 14px;
    gap: 8px;
  }
  .modal-title-wrap {
    gap: 6px;
  }
  .admin-modal-title {
    font-size: 1.05rem;
  }
  .badge-ai-sparkle {
    font-size: 0.68rem;
    padding: 2px 6px;
  }
  .order-modal-summary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }
}
@media (max-width: 420px) {
  .badge-ai-sparkle {
    display: none;
  }
}

/* Touch Targets for Interactive Table & Form Buttons (>= 38-44px) */
.btn-open-cust-card {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  box-sizing: border-box;
}
.btn-delete-item,
.btn-delete-cust,
.btn-delete-cat,
.btn-delete-promo,
.btn-delete-order,
.btn-del-bc {
  min-height: 38px;
  min-width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.pb-preset-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px !important;
  font-size: 0.8rem !important;
  box-sizing: border-box;
}

.form-add-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) 140px;
  gap: 12px;
  align-items: end;
}

@media (max-width: 640px) {
  .form-add-admin-grid {
    grid-template-columns: 1fr;
  }
}

.input-with-button {
  display: flex;
  align-items: center;
  position: relative;
}

.input-with-button input {
  width: 100%;
  padding-right: 42px;
}

.btn-toggle-eye {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.field-hint {
  font-size: 0.72rem;
  color: var(--admin-text-faint);
}

/* Product Modal Layout & AI Elements */
.modal-card-lg {
  max-width: 920px !important;
  width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-product-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.product-form-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 24px;
  padding: 20px 24px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.form-col-left,
.form-col-right {
  min-width: 0;
}

@media (max-width: 820px) {
  .product-form-layout {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }
}

.quick-discount-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.ai-trigger-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 12px 0 6px 0;
}

.ai-pill-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-emerald);
  display: inline-block;
  margin-bottom: 2px;
}

.btn-ai-action {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-ai-action:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-ai-action.btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.ai-media-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.ai-media-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.media-preview-box {
  width: 100%;
  height: 140px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #060D0A;
  border: 1px solid var(--admin-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Unit selector row with add button */
.unit-control-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.unit-select-field {
  flex: 1 1 auto;
  min-width: 0;
}

.btn-add-unit {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--color-emerald);
  border-radius: var(--radius-sm);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-add-unit:hover {
  background: var(--color-emerald);
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* Form group discounts */
.form-group-discounts {
  margin-top: 6px;
}

.form-group-discounts label {
  font-size: 0.78rem;
  color: var(--admin-text-muted);
  margin-bottom: 4px;
}

/* Related products control */
.related-toggle-wrap {
  display: flex;
  align-items: center;
  min-height: 38px;
}

.admin-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--admin-text-main);
  cursor: pointer;
  user-select: none;
}

.admin-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-emerald);
  cursor: pointer;
}

/* Dropzone styling */
.media-upload-dropzone {
  border: 2px dashed rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  background: rgba(16, 185, 129, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 10px;
  position: relative;
}

.media-upload-dropzone:hover,
.media-upload-dropzone.dragover {
  border-color: var(--color-emerald);
  background: rgba(16, 185, 129, 0.12);
  transform: translateY(-1px);
}

.media-upload-dropzone.is-uploading {
  pointer-events: none;
  opacity: 0.9;
  border-color: var(--color-emerald) !important;
  background: rgba(16, 185, 129, 0.12) !important;
}

@keyframes adminPulseBorder {
  0%, 100% { border-color: var(--color-amber, #f59e0b); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50% { border-color: var(--color-amber, #f59e0b); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.2); }
}

.media-upload-dropzone.highlight-pulse {
  animation: adminPulseBorder 0.8s ease-in-out 3;
}

.dropzone-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px;
}

.dropzone-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(16, 185, 129, 0.25);
  border-top-color: var(--color-emerald);
  border-radius: 50%;
  animation: dropzone-spin 0.75s linear infinite;
  display: inline-block;
}

@keyframes dropzone-spin {
  to { transform: rotate(360deg); }
}

.media-upload-dropzone svg {
  color: var(--color-emerald);
}

.dropzone-text {
  font-size: 0.8rem;
  color: var(--admin-text-main);
}

.dropzone-text u {
  color: var(--color-emerald);
  text-decoration: underline;
}

.dropzone-sub {
  font-size: 0.7rem;
  color: var(--admin-text-faint);
}

/* ================= Toast Notification System (Top Layer & Dialog Resilient) ================= */
#admin-toast-container {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  top: auto !important;
  left: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  z-index: 2147483647 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  pointer-events: none !important;
  max-width: min(440px, calc(100vw - 32px)) !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
}

#admin-toast-container:popover-open {
  display: flex !important;
}

.admin-dialog #admin-toast-container {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 2147483647 !important;
}

.admin-toast {
  pointer-events: auto !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 13px 18px !important;
  border-radius: 12px !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  color: #FFFFFF !important;
  word-break: break-word !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 3px 10px rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
}

.admin-toast-success {
  background: #065F46 !important;
  border-color: rgba(52, 211, 153, 0.45) !important;
}

.admin-toast-error {
  background: #991B1B !important;
  border-color: rgba(248, 113, 113, 0.5) !important;
}

.admin-toast-warning,
.admin-toast-warn {
  background: #B45309 !important;
  border-color: rgba(251, 191, 36, 0.5) !important;
}

.admin-toast-icon {
  flex-shrink: 0 !important;
  width: 20px !important;
  height: 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-top: 1px !important;
}

.admin-toast-content {
  flex: 1 !important;
  min-width: 0 !important;
  color: #FFFFFF !important;
}

/* Gallery Thumbnails Grid */
.gallery-previews-container {
  margin-top: 4px;
}

.gallery-thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.gallery-thumb-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--admin-border);
  background: #08110D;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.gallery-thumb-card:hover {
  transform: translateY(-1px);
  border-color: var(--color-emerald);
}

.gallery-thumb-card.is-main {
  border: 2px solid var(--color-emerald);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.gallery-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumb-main-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  background: var(--color-emerald);
  color: #FFFFFF;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.gallery-thumb-remove-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  cursor: pointer;
  transition: background 0.15s ease;
  line-height: 1;
}

.gallery-thumb-remove-btn:hover {
  background: #EF4444;
}

.btn-remove-video {
  font-size: 0.75rem;
  background: transparent;
  border: none;
  color: #EF4444;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.15s ease;
  font-weight: 600;
}

.btn-remove-video:hover {
  background: rgba(239, 68, 68, 0.1);
  text-decoration: underline;
}

.badge-ai-sparkle {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(139, 92, 246, 0.2)) !important;
  color: #A7F3D0 !important;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Clickable Customer Rows */
.clickable-rows tbody tr {
  cursor: pointer;
  transition: var(--transition);
}

.clickable-rows tbody tr:hover {
  background-color: rgba(16, 185, 129, 0.08);
}

/* Customer Detail Modal */
.cust-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .cust-card-grid {
    grid-template-columns: 1fr;
  }
}

.cust-info-box {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.cust-box-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--admin-text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.utm-tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.8rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.utm-tag-row:last-child {
  border-bottom: none;
}

.utm-key {
  color: var(--admin-text-muted);
}

.utm-val {
  font-weight: 600;
  color: var(--color-emerald);
  font-family: monospace;
}

.channel-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.sub-active {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

.sub-inactive {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
}

/* ================= 9. DISCOUNT PRESETS, WEIGHT RECALCULATION & ROBOKASSA ================= */
.quick-discount-pills {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-discount-preset {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-main);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-discount-preset:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--color-emerald);
  color: #34D399;
}

.table-discount-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--color-rose-bg);
  color: #B91C1C;
  border: 1px solid rgba(185, 28, 28, 0.25);
}

[data-theme="dark"] .table-discount-badge {
  background: rgba(239, 68, 68, 0.18);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.table-old-price-line {
  font-size: 0.75rem;
  color: var(--admin-text-faint);
  text-decoration: line-through;
  margin-top: 2px;
}

/* Weight Adjustment & Assembly Checklist in Order Modal */
.order-checklist-section-header {
  margin-top: 18px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--admin-border);
}

.order-checklist-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--admin-text-muted);
  text-transform: uppercase;
}

.weight-row-box {
  background: var(--admin-elevated);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.weight-row-label {
  font-size: 0.82rem;
  color: var(--admin-text-muted);
  font-weight: 600;
}

.weight-row-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.weight-actual-input {
  width: 80px;
  height: 38px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  color: var(--admin-text-main);
  padding: 0 8px;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  font-family: var(--font-heading);
  box-sizing: border-box;
}

.weight-actual-input:focus {
  border-color: var(--color-emerald);
  outline: none;
  box-shadow: 0 0 0 2px rgba(4, 120, 87, 0.2);
}

[data-theme="dark"] .weight-actual-input {
  background: rgba(0, 0, 0, 0.4);
  color: #F3F4F6;
  border-color: var(--color-emerald);
}

.weight-row-unit {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--admin-text-main);
}

.weight-recalc-summary {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

[data-theme="dark"] .weight-recalc-summary {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}

.weight-recalc-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weight-recalc-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #047857;
}

[data-theme="dark"] .weight-recalc-label {
  color: #34D399;
}

.weight-recalc-sub {
  font-size: 0.82rem;
  color: var(--admin-text-muted);
  font-weight: 500;
}

.weight-recalc-action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.weight-recalc-amount {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--color-emerald);
  white-space: nowrap;
}

.btn-save-weights-action {
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  background-color: var(--color-emerald);
  color: #FFFFFF;
  border: none;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.btn-save-weights-action:hover {
  background-color: var(--color-emerald-dark);
}

.order-bot-notice {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #93C5FD;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

/* ================= 10. THEME SWITCHER CONTROLS ================= */
.admin-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background-color: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-full);
  color: var(--admin-text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.admin-theme-btn:hover {
  background-color: var(--admin-elevated);
  border-color: var(--color-emerald);
  transform: translateY(-1px);
}

.admin-theme-btn .theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-amber);
}

.btn-theme-choice {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--admin-border);
  background: var(--admin-card);
  color: var(--admin-text-main);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-theme-choice:hover {
  border-color: var(--color-emerald);
}

.btn-theme-choice.active {
  background: var(--color-emerald);
  color: #FFFFFF;
  border-color: var(--color-emerald);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

/* ================= 11. BULK ACTIONS TOOLBAR & MODAL ================= */
.bulk-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.bulk-bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.bulk-select-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--admin-text-main);
}

.bulk-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  background: var(--color-emerald);
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 800;
}

.bulk-quick-link {
  background: none;
  border: none;
  color: var(--color-emerald);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 4px;
  transition: var(--transition);
}

.bulk-quick-link:hover {
  color: var(--color-emerald-dark);
}

.bulk-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bulk-bar-divider {
  width: 1px;
  height: 24px;
  background: var(--admin-border);
  margin: 0 4px;
}

.bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.bulk-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bulk-btn-action {
  background: var(--admin-elevated);
  border-color: var(--admin-border);
  color: var(--admin-text-main);
}

.bulk-btn-action:hover:not(:disabled) {
  background: var(--admin-card);
  border-color: var(--color-emerald);
  color: var(--color-emerald);
}

.bulk-btn-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--color-emerald);
}

.bulk-btn-success:hover:not(:disabled) {
  background: var(--color-emerald);
  color: #FFFFFF;
}

.bulk-btn-warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--color-amber);
}

.bulk-btn-warning:hover:not(:disabled) {
  background: var(--color-amber);
  color: #FFFFFF;
}

.bulk-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--color-rose);
}

.bulk-btn-danger:hover:not(:disabled) {
  background: var(--color-rose);
  color: #FFFFFF;
}

/* Checkbox and table row selection */
.admin-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--color-emerald);
  cursor: pointer;
  border-radius: 4px;
}

tr.row-selected td {
  background-color: rgba(16, 185, 129, 0.08) !important;
}

/* Bulk Modal UI */
.bulk-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.bulk-tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.bulk-tab-btn:hover {
  color: var(--admin-text-main);
  border-color: var(--color-emerald);
}

.bulk-tab-btn.active {
  background: var(--color-emerald);
  color: #FFFFFF;
  border-color: var(--color-emerald);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.bulk-pane {
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.admin-select-ui, .admin-input-ui {
  width: 100%;
  padding: 8px 12px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  color: var(--admin-text-main);
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}

.admin-select-ui:focus, .admin-input-ui:focus {
  border-color: var(--color-emerald);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.btn-bulk-discount-pill {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--admin-border);
  background: var(--admin-card);
  color: var(--admin-text-main);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-bulk-discount-pill:hover, .btn-bulk-discount-pill.active {
  background: var(--color-emerald);
  color: #FFFFFF;
  border-color: var(--color-emerald);
}

.bulk-preview-summary {
  background: var(--admin-elevated);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--admin-text-main);
}

/* Responsive Admin Header & Layout Overrides */
@media (max-width: 1280px) {
  .admin-brand-text .brand-tag {
    display: none;
  }
  .admin-store-link span,
  .admin-quick-btn#btn-admin-logout span,
  .admin-quick-btn#btn-create-test-order span,
  .admin-quick-btn#btn-create-order span {
    display: none;
  }
  .admin-store-link,
  .admin-quick-btn#btn-admin-logout,
  .admin-quick-btn#btn-create-test-order,
  .admin-quick-btn#btn-create-order {
    padding: 7px 10px;
    min-width: 38px;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .admin-top-bar {
    padding: 0 12px;
    height: 56px;
    gap: 8px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
  }
  .admin-header-left {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }
  .admin-brand {
    min-width: 0;
    gap: 8px;
  }
  .admin-logo-badge {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }
  .admin-brand-text {
    min-width: 0;
    overflow: hidden;
  }
  .brand-title {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
  .brand-title .brand-sub {
    font-size: 0.75rem;
  }
  .admin-brand-text .brand-tag {
    display: none !important;
  }
  .admin-header-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .admin-quick-btn#btn-create-test-order {
    display: none !important;
  }
  .admin-quick-btn#btn-create-order {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .admin-quick-btn#btn-create-order span {
    display: none !important;
  }
  .admin-theme-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .admin-theme-btn .theme-name {
    display: none !important;
  }
  .admin-store-link {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .admin-store-link span {
    display: none !important;
  }
  .admin-quick-btn#btn-admin-logout {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    margin-left: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .admin-quick-btn#btn-admin-logout span {
    display: none !important;
  }
  .admin-user-pill {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .admin-user-pill .user-label {
    display: none !important;
  }

  /* Navigation Tabs Bar */
  .admin-nav-bar {
    padding: 0 8px;
    height: 52px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 16px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 16px), transparent);
  }
  .admin-nav-tabs {
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 4px;
    padding: 4px;
  }
  .admin-nav-btn {
    min-height: 44px;
    padding: 6px 12px;
    font-size: 0.84rem;
  }

  /* KPI Metrics Strip: 2-column grid bounded strictly to screen width */
  .admin-metrics-strip {
    padding: 10px 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow-x: clip;
    width: 100%;
    box-sizing: border-box;
  }
  .metric-card {
    min-width: 0;
    padding: 10px;
    gap: 8px;
    border-radius: var(--radius-md);
  }
  .metric-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
  }
  .metric-content {
    min-width: 0;
    overflow: hidden;
  }
  .metric-value {
    font-size: 1.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .metric-label {
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Secondary badges hidden on narrow screens to prevent column blowout */
  .metric-trend,
  .metric-sub-pill,
  .metric-note,
  .metric-status-ok {
    display: none !important;
  }

  /* Main Container */
  .admin-main-container {
    padding: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: clip;
  }
  .pane-action-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .stock-master-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }
  .stock-toggle-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 8px 14px;
    box-sizing: border-box;
    background: var(--admin-card);
    border: 1px solid var(--admin-border-subtle);
    border-radius: var(--radius-sm);
  }
  .stock-box-label {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    color: var(--admin-text-main);
    font-weight: 600;
    white-space: nowrap;
  }
  .stock-toggle-box .switch-ui {
    margin-left: 8px;
    margin-right: 6px;
    flex-shrink: 0;
  }
  .stock-state-text {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 80px;
    text-align: right;
  }
  .admin-filter-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .admin-search-box {
    max-width: 100%;
  }
  .admin-select-box select {
    width: 100%;
  }

  /* iOS Auto-Zoom Prevention */
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
  select,
  textarea,
  .admin-input,
  .admin-inline-input {
    font-size: 16px !important;
  }

  /* Mobile Touch Targets >= 44x44px */
  .admin-btn-primary,
  .admin-btn-secondary,
  .btn-create-category,
  .btn-add-promo,
  .btn-save-schedule,
  .view-btn,
  .sched-day-pill {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .order-advance-btn {
    min-height: 40px;
    padding: 8px 14px;
  }
  .order-card-del-btn {
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn-edit-cat,
  .btn-delete-cat {
    min-height: 40px;
  }
  .switch-ui {
    width: 44px !important;
    height: 24px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    display: inline-block !important;
    position: relative !important;
    flex-shrink: 0 !important;
  }

  /* Data Tables Transformation: Clean horizontal swipe with containment */
  .orders-table-view,
  .products-table-wrap,
  .customers-table-wrap,
  .admins-table-wrap,
  .table-responsive {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .products-table-admin {
    width: max-content;
    min-width: 100%;
  }
  .products-table-admin input[type="number"] {
    width: 82px;
    min-height: 40px;
    padding: 6px 8px;
  }
  .customers-table-wrap .admin-data-table {
    width: max-content;
    min-width: 100%;
  }

  /* Kanban Board on Mobile: Snap-scrolling columns */
  .kanban-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(280px, 85vw));
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 16px;
    overscroll-behavior-x: contain;
  }
  .kanban-col {
    scroll-snap-align: start;
    min-height: 480px;
  }

  /* Dialogs and Modals on Mobile */
  .admin-dialog,
  .admin-dialog.admin-dialog-lg {
    max-width: 95vw !important;
    width: 95vw !important;
    margin: auto;
  }
  .admin-modal-card {
    max-height: 90vh;
    border-radius: var(--radius-lg);
  }
  .admin-close-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .admin-modal-body {
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .admin-modal-footer {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .admin-modal-footer:not(.order-modal-footer) button {
    min-height: 44px;
    flex: 1 1 auto;
  }
  .order-modal-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .order-footer-utils {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px;
  }
  .order-footer-utils .order-footer-btn {
    width: 100%;
    padding: 0 10px;
    font-size: 13px;
    flex: none;
  }
  .order-footer-pipeline {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    gap: 8px;
  }
  .order-footer-pipeline .order-footer-btn {
    width: 100%;
    padding: 0 6px;
    font-size: 13px;
    flex: none;
  }
  .weight-recalc-summary {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .weight-recalc-action-row {
    justify-content: space-between;
    width: 100%;
  }
  .btn-save-weights-action {
    flex: 1;
    font-size: 13px;
    padding: 0 12px;
  }
}

@media (max-width: 480px) {
  .brand-title .brand-sub {
    display: none !important;
  }
  .admin-top-bar {
    padding: 0 8px;
    gap: 6px;
  }
  .admin-header-right {
    gap: 4px;
  }
  .admin-theme-btn,
  .admin-store-link,
  .admin-quick-btn#btn-admin-logout,
  .admin-quick-btn#btn-create-order {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }
  .admin-user-pill {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }
}

/* Delivery Settings & Promocodes Master Mobile Adaptations */
@media (max-width: 680px) {
  .delivery-settings-card .card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .delivery-header-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .delivery-header-actions .switch-control-wrap {
    width: 100%;
    justify-content: flex-start;
  }
  .delivery-header-actions #btn-save-delivery-settings {
    width: 100%;
    justify-content: center;
  }
  .promocodes-master-card {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
}

/* ========================================================
   Schedule & Operating Hours Pane Styles
   ======================================================== */
.schedule-admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.taste-of-week-card {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.taste-of-week-title {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.taste-url-hint {
  word-break: break-all;
  font-weight: 500;
  font-size: 0.9em;
  color: var(--admin-text-muted);
}

.taste-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.taste-slot-card {
  background: var(--admin-bg);
  border: 2px solid var(--admin-border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.taste-slot-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .schedule-admin-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .taste-of-week-card {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .taste-of-week-card {
    padding: 14px !important;
  }
  .taste-slots-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .taste-slot-card {
    padding: 12px !important;
  }
  .sched-days-checklist {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)) !important;
  }
}

.taste-slot-card:hover {
  border-color: var(--color-emerald) !important;
}

.btn-delete-item, .btn-delete-cust, .btn-delete-cat, .btn-delete-promo, .btn-delete-order {
  transition: all 0.2s ease;
}

.btn-delete-item:hover, .btn-delete-cust:hover, .btn-delete-cat:hover, .btn-delete-promo:hover, .btn-delete-order:hover {
  background: #fecaca !important;
  border-color: #ef4444 !important;
}

/* ================= Category Modal & Controls ================= */
.cat-icon-preview-box {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--radius-md, 8px);
  background: var(--admin-elevated);
  border: 1.5px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  overflow: hidden;
  transition: var(--transition, all 0.2s ease);
}

.cat-icon-preview-box:hover {
  border-color: var(--color-emerald);
}

.cat-icon-preview-box svg {
  width: 24px;
  height: 24px;
  max-width: 26px;
  max-height: 26px;
  display: block;
}

.cat-icon-preview-box img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.btn-upload-svg {
  position: absolute;
  right: 4px;
  height: 32px;
  padding: 0 12px;
  background: var(--admin-elevated);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-main);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition, all 0.2s ease);
  user-select: none;
}

.btn-upload-svg:hover {
  background: var(--admin-card-hover, #22302C);
  border-color: var(--color-emerald);
  color: var(--color-emerald);
}

.cat-quick-emoji {
  border: 1px solid var(--admin-border);
  background: var(--admin-elevated);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.2;
  transition: var(--transition, all 0.2s ease);
}

.cat-quick-emoji:hover {
  border-color: var(--color-emerald);
  transform: scale(1.12);
}

.btn-edit-cat {
  transition: var(--transition, all 0.2s ease);
}

.btn-edit-cat:hover {
  border-color: var(--color-emerald) !important;
  color: var(--color-emerald) !important;
}

/* ================= Unified Button System ================= */
.admin-btn-secondary,
.btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--radius-md, 8px);
  background: var(--admin-elevated, #1A2421);
  color: var(--admin-text-main, #F1F5F3);
  border: 1px solid var(--admin-border, rgba(255, 255, 255, 0.12));
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.admin-btn-secondary:hover,
.btn-cancel:hover {
  background: var(--admin-card-hover, #22302C);
  border-color: var(--color-emerald, #10B981);
  color: var(--color-emerald, #10B981);
}

.admin-btn-secondary:focus-visible,
.btn-cancel:focus-visible {
  outline: 2px solid var(--color-emerald);
  outline-offset: 2px;
}

.admin-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 20px;
  border-radius: var(--radius-md, 8px);
  background-color: var(--color-emerald, #10B981);
  color: #FFFFFF;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.admin-btn-primary:hover {
  background-color: var(--color-emerald-dark, #059669);
}

.admin-btn-primary:focus-visible {
  outline: 2px solid var(--color-emerald);
  outline-offset: 2px;
}

/* Light theme polish */
[data-theme="light"] .admin-btn-secondary,
[data-theme="light"] .btn-cancel {
  background: #F3F4F6;
  border-color: #D1D5DB;
  color: #1F2937;
}

[data-theme="light"] .admin-btn-secondary:hover,
[data-theme="light"] .btn-cancel:hover {
  background: #E5E7EB;
  border-color: var(--color-emerald);
  color: var(--color-emerald);
}

[data-theme="light"] .btn-upload-svg {
  background: #F3F4F6;
  border-color: #D1D5DB;
  color: #1F2937;
}

[data-theme="light"] .btn-upload-svg:hover {
  background: #E5E7EB;
  border-color: var(--color-emerald);
  color: var(--color-emerald);
}

[data-theme="light"] .cat-icon-preview-box {
  background: #F9FAFB;
  border-color: #D1D5DB;
}

[data-theme="light"] .cat-quick-emoji {
  background: #F9FAFB;
  border-color: #E5E7EB;
}

/* ==========================================================================
   ADMIN MESSENGER AUTH MODAL (Telegram / MAX OTP Gate)
   Matches Store & Landing Design System: #172A24 Emerald Glass
   ========================================================================== */
.admin-dialog.auth-modal {
  padding: 16px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  max-width: 472px;
  width: 100%;
}

.admin-dialog.auth-modal::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.auth-modal .auth-card {
  width: 100%;
  max-width: 440px;
  background-color: #172A24 !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75), 0 4px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  margin: auto;
}

.auth-modal .modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-modal .modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.25;
  margin: 0;
}

.auth-modal .modal-subtitle {
  display: block;
  font-family: var(--font-body);
  font-size: 0.813rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
  line-height: 1.4;
}

.auth-modal .modal-body.auth-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  color: #FFFFFF;
}

.auth-channel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.channel-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: none;
  border: none;
  border-radius: var(--radius-full);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.938rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition: var(--transition);
}

.channel-tab-btn.active {
  background: #FFFFFF;
  color: #0F172A;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.bot-info-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.bot-info-text strong {
  display: block;
  font-size: 0.938rem;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.bot-info-text p {
  font-size: 0.813rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.45;
  margin: 0;
}

.auth-actions-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  width: 100%;
}

.btn-auth-primary {
  width: 100%;
  height: 48px;
  background: #FFFFFF;
  color: #0F172A;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  box-sizing: border-box;
}

.btn-auth-primary:hover {
  background: #F1F5F9;
  transform: translateY(-1px);
}

.auth-live-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(42, 171, 238, 0.12);
  border: 1px solid rgba(42, 171, 238, 0.35);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.813rem;
  color: #60A5FA;
  margin: 0;
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: livePulse 1.6s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes livePulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.btn-link-subtle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.813rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px 10px;
  margin: 0;
  transition: color 0.15s ease;
}

.btn-link-subtle:hover {
  color: #FFFFFF;
}

.code-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.813rem;
  color: #34D399;
  margin-bottom: 16px;
}

.status-dot-sent {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #34D399;
  animation: pulseSent 1.8s infinite;
  flex-shrink: 0;
}

@keyframes pulseSent {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.profile-preview-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  text-align: left;
}

.preview-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #152722;
  border: 1.5px solid #F59E0B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #F59E0B;
  overflow: hidden;
  flex-shrink: 0;
}

.preview-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}

.preview-name {
  font-size: 0.938rem;
  font-weight: 700;
  color: #FFFFFF;
}

.preview-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.otp-inputs-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 18px;
}

.otp-digit {
  width: 44px;
  height: 52px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 700;
  color: #FFFFFF;
  text-align: center;
  outline: none;
  transition: var(--transition);
}

.otp-digit:focus {
  border-color: #FFFFFF;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.known-user-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  text-align: left;
}

.known-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: #152722;
  border: 1.5px solid #F59E0B;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.known-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.known-user-avatar .profile-avatar-initials {
  font-size: 0.95rem;
  font-weight: 700;
  color: #F59E0B;
}

.known-user-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}

.known-user-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.known-user-sub {
  font-size: 0.78rem;
  color: #34D399;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ========================================================
   Settings Bottom Action Footer
   ======================================================== */
.settings-footer-actions {
  margin-top: 28px;
  padding: 16px 24px;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg, 12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.settings-footer-hint {
  font-size: 0.88rem;
  color: var(--admin-text-muted);
}

.btn-save-settings-main {
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: var(--radius-md, 8px);
}

@media (max-width: 680px) {
  .settings-footer-actions {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 12px;
  }
  .btn-save-settings-main {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================================
   Manual Order Creation Modal Styles
   ======================================================== */
.manual-order-form .order-section-block {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--admin-border);
}

.manual-order-form .order-section-block:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.manual-order-form .order-section-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--admin-text-main);
  margin: 0 0 12px 0;
  font-family: var(--font-heading);
}

.manual-add-product-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.manual-order-items-table-wrap {
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md, 8px);
  overflow-x: auto;
}

.manual-order-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.manual-order-items-table th {
  background: var(--admin-elevated);
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--admin-border);
}

.manual-order-items-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}

.manual-order-items-table tr:last-child td {
  border-bottom: none;
}

.manual-order-empty-state {
  padding: 24px 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--admin-text-muted);
}

.manual-qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--admin-card);
}

.manual-qty-stepper .btn-stepper {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--admin-elevated);
  color: var(--admin-text-main);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.manual-qty-stepper .btn-stepper:hover {
  background: var(--color-emerald-bg, rgba(16, 185, 129, 0.15));
  color: var(--color-emerald);
}

.manual-qty-stepper .manual-qty-input {
  width: 44px;
  height: 28px;
  border: none;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  color: var(--admin-text-main);
}

.btn-remove-manual-item {
  background: none;
  border: none;
  color: var(--color-rose, #dc2626);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 6px;
  border-radius: 4px;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.btn-remove-manual-item:hover {
  opacity: 1;
  background: rgba(220, 38, 38, 0.1);
}

.manual-order-summary-box {
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md, 8px);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.manual-order-summary-box .summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  color: var(--admin-text-muted);
}

.manual-order-summary-box .summary-line span:last-child {
  font-weight: 600;
  color: var(--admin-text-main);
}

.manual-order-summary-box .summary-total {
  border-top: 1px solid var(--admin-border);
  padding-top: 8px;
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--admin-text-main);
}

.manual-order-summary-box .summary-total span:last-child {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-emerald);
}

/* =========================================================================
   TELEGRAM SYSTEM MESSAGES & RIGHT-CLICK FORMATTING CONTEXT MENU
   ========================================================================= */

/* Subtab Navigation Strip */
.tg-subtab-strip {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.tg-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--admin-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tg-subtab-btn:hover {
  background: var(--admin-elevated);
  color: var(--admin-text-main);
}

.tg-subtab-btn.active {
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

.tg-subtab-badge {
  font-size: 0.72rem;
  background: var(--color-emerald);
  color: #fff;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}

/* Subtab panes display */
.tg-subtab-pane {
  display: none;
}

.tg-subtab-pane.active {
  display: block;
}

/* Message Selector Strip */
.tg-msg-selector-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 18px;
  -webkit-overflow-scrolling: touch;
}

.tg-msg-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 9999px;
  border: 1px solid var(--admin-border);
  background: var(--admin-elevated);
  color: var(--admin-text-main);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.tg-msg-pill:hover {
  border-color: var(--color-emerald);
  color: var(--color-emerald);
}

.tg-msg-pill.active {
  background: var(--color-emerald);
  color: #ffffff;
  border-color: var(--color-emerald);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.tg-pill-icon {
  font-size: 1rem;
  line-height: 1;
}

/* 2-Column Workspace Grid */
.tg-messages-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr);
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .tg-messages-workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* Left Card: Editor */
.tg-msg-editor-card {
  background: var(--admin-elevated);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 20px;
}

.tg-msg-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.tg-msg-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tg-msg-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  font-family: monospace;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-emerald);
}

.tg-msg-active-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--admin-text-main);
}

.tg-btn-ghost-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  background: transparent;
  color: var(--admin-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tg-btn-ghost-sm:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-rose, #ef4444);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Trigger & Timing Box */
.tg-msg-trigger-banner {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}

.trigger-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.trigger-icon-box {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.trigger-content {
  flex: 1;
}

.trigger-heading {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--admin-text-muted);
  margin-bottom: 2px;
}

.trigger-text {
  font-size: 0.86rem;
  color: var(--admin-text-main);
  line-height: 1.45;
}

/* Formatting Toolbar */
.tg-editor-toolbar-wrap {
  margin-bottom: 10px;
}

.tg-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 4px 6px;
  flex-wrap: wrap;
}

.tg-fmt-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--admin-text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.9rem;
}

.tg-fmt-btn:hover {
  background: var(--admin-elevated);
  color: var(--color-emerald);
}

.tg-fmt-separator {
  width: 1px;
  height: 20px;
  background: var(--admin-border);
  margin: 0 4px;
}

.tg-fmt-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--admin-text-muted);
  margin-top: 5px;
  padding: 0 2px;
}

.tg-code-textarea {
  width: 100%;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 12px;
  background: var(--admin-bg);
  color: var(--admin-text-main);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  transition: border-color 0.15s ease;
}

.tg-code-textarea:focus {
  outline: none;
  border-color: var(--color-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Courier subblock */
.tg-courier-subblock-wrap {
  background: rgba(56, 189, 248, 0.05);
  border: 1px dashed rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

/* Variable Chips */
.tg-variables-section {
  border-top: 1px solid var(--admin-border);
  padding-top: 14px;
  margin-top: 14px;
}

.tg-variables-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--admin-text-muted);
  margin-bottom: 8px;
}

.tg-variable-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tg-variable-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.76rem;
  font-family: monospace;
  color: var(--color-emerald);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tg-variable-chip:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--color-emerald);
  transform: translateY(-1px);
}

/* Right Column: Live Telegram Message Preview */
.tg-msg-preview-card {
  background: var(--admin-elevated);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 20px;
  position: sticky;
  top: 80px;
}

.tg-preview-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.tg-preview-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-emerald);
}

.tg-chat-preview-container {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;
  color: #f1f5f9;
}

.tg-bubble-sender-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.tg-bot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
}

.tg-bot-meta {
  display: flex;
  flex-direction: column;
}

.tg-bot-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #38bdf8;
}

.tg-bot-tag {
  font-size: 0.7rem;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

.tg-bot-handle {
  font-size: 0.72rem;
  color: #64748b;
}

.tg-bubble-card {
  background: #1e293b;
  color: #f1f5f9;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  border-bottom-left-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Telegram Links in Preview */
.tg-bubble-card a {
  color: #38bdf8;
  text-decoration: none;
}

.tg-bubble-card a:hover {
  text-decoration: underline;
}

/* Telegram Blockquote in Preview - matches screenshot 1! */
.tg-bubble-card blockquote {
  border-left: 3px solid #10b981;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 4px;
  padding: 6px 12px;
  margin: 8px 0;
  position: relative;
  font-style: normal;
}

.tg-bubble-card blockquote::before {
  content: "”";
  position: absolute;
  right: 8px;
  top: 0px;
  font-size: 1.4rem;
  color: rgba(16, 185, 129, 0.45);
  line-height: 1;
  font-family: Georgia, serif;
  pointer-events: none;
}

/* Telegram Code in Preview */
.tg-bubble-card code {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.85rem;
}

/* Telegram Spoiler in Preview */
.tg-bubble-card tg-spoiler {
  background: rgba(255, 255, 255, 0.2);
  filter: blur(4px);
  border-radius: 3px;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.tg-bubble-card tg-spoiler:hover {
  filter: blur(0px);
}

/* Inline Action Button in Telegram Chat */
.tg-bubble-action-btn-wrap {
  margin-top: 8px;
}

.tg-bubble-inline-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background: #334155;
  color: #38bdf8;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 10px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid rgba(56, 189, 248, 0.2);
  transition: background 0.15s ease;
}

.tg-bubble-inline-btn:hover {
  background: #3b4d66;
}

.tg-bubble-footer-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 4px;
}

.tg-double-check {
  color: #10b981;
  font-weight: 700;
  letter-spacing: -1px;
}

.tg-preview-test-bar {
  margin-top: 14px;
}

/* =========================================================================
   macOS / TELEGRAM CONTEXT MENU STYLING (MATCHING SCREENSHOT 2)
   ========================================================================= */

.tg-ctx-menu {
  position: fixed;
  z-index: 10000;
  min-width: 200px;
  background: #ffffff;
  color: #1e293b;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.08);
  padding: 5px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;
  font-size: 0.88rem;
  user-select: none;
  animation: tgCtxFadeIn 0.1s ease-out;
}

[data-theme="dark"] .tg-ctx-menu {
  background: #1e293b;
  color: #f1f5f9;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

@keyframes tgCtxFadeIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.tg-ctx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  cursor: pointer;
  position: relative;
  transition: background 0.1s ease;
}

.tg-ctx-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="dark"] .tg-ctx-item:hover {
  background: #334155;
  color: #ffffff;
}

.tg-ctx-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tg-ctx-key {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-left: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro", "Segoe UI", Roboto, sans-serif;
}

.tg-ctx-arrow {
  font-size: 1.1rem;
  line-height: 1;
  color: #94a3b8;
  margin-left: 16px;
}

.tg-ctx-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

[data-theme="dark"] .tg-ctx-divider {
  background: rgba(255, 255, 255, 0.1);
}

/* Submenu container - matching screenshot 2 with red boundary style */
.tg-ctx-submenu {
  display: none;
  position: absolute;
  top: -4px;
  left: 100%;
  min-width: 210px;
  background: #ffffff;
  color: #1e293b;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.08);
  padding: 5px 0;
  z-index: 10001;
}

[data-theme="dark"] .tg-ctx-submenu {
  background: #1e293b;
  color: #f1f5f9;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.tg-ctx-item.has-submenu:hover > .tg-ctx-submenu,
.tg-ctx-submenu:hover {
  display: block;
}

.tg-ctx-submenu.flip-left {
  left: auto;
  right: 100%;
}

/* ==========================================================================
   DELIVERY ZONES & POLYGON EDITOR
   ========================================================================== */

.zones-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.zones-status-pill {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--admin-elevated);
  color: var(--admin-text-muted);
  border: 1px solid var(--admin-border);
}

.zones-status-pill.is-enforced {
  background: var(--color-emerald-bg);
  color: var(--color-emerald);
  border-color: rgba(4, 120, 87, 0.25);
}

.zones-keys-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.zones-keys-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--admin-text-main);
}

.zones-keys-summary::-webkit-details-marker {
  display: none;
}

.zones-keys-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zones-keys-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--color-amber-bg);
  color: var(--color-amber);
}

.zones-keys-badge.is-ready {
  background: var(--color-emerald-bg);
  color: var(--color-emerald);
}

.zones-keys-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--admin-border-subtle);
}

.zones-keys-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding-top: 12px;
}

.zones-keys-grid label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--admin-text-muted);
  margin-bottom: 4px;
}

.zones-keys-grid .admin-input,
.zones-form .admin-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-border);
  background: var(--admin-bg);
  color: var(--admin-text-main);
  font-size: 0.88rem;
}

.zones-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}

.zones-map-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.zones-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--color-emerald-bg);
  color: var(--admin-text-main);
  border-bottom: 1px solid var(--admin-border);
  font-size: 0.84rem;
  font-weight: 500;
}

.zones-map-toolbar-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.zones-map-canvas {
  width: 100%;
  height: 580px;
  background: var(--admin-elevated);
  position: relative;
}

.zones-map-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: var(--admin-text-muted);
  font-size: 0.9rem;
}

.zones-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.zones-sidebar-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.zones-sidebar-header {
  margin-bottom: 12px;
}

.zones-sidebar-header h4 {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--admin-text-main);
}

.zone-form-hint {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
  color: var(--admin-text-muted);
}

.zones-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.zones-form .form-group {
  margin: 0;
}

.zones-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--admin-text-muted);
  margin-bottom: 4px;
}

.zone-color-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zone-color-input {
  width: 36px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  background: var(--admin-bg);
  cursor: pointer;
}

.zone-color-swatches {
  display: flex;
  gap: 6px;
}

.zone-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease;
}

.zone-swatch:hover {
  transform: scale(1.12);
}

.zone-active-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--admin-text-main) !important;
  font-size: 0.84rem !important;
  margin: 0 !important;
}

.zones-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.admin-btn-ghost {
  background: transparent;
  border: 1px solid var(--admin-border);
  color: var(--admin-text-main);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.admin-btn-ghost:hover {
  background: var(--admin-elevated);
}

.admin-btn-danger {
  background: var(--color-rose-bg);
  border: 1px solid rgba(185, 28, 28, 0.25);
  color: var(--color-rose);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
}

.admin-zones-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.zone-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  background: var(--admin-bg);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.zone-list-item:hover {
  border-color: var(--color-emerald);
}

.zone-list-item.is-selected {
  border-color: var(--color-emerald);
  background: var(--color-emerald-bg);
}

.zone-list-item.is-inactive {
  opacity: 0.6;
}

.zone-list-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.zone-list-info {
  flex: 1;
  min-width: 0;
}

.zone-list-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--admin-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zone-list-meta {
  font-size: 0.76rem;
  color: var(--admin-text-muted);
  margin-top: 2px;
}

.zones-empty-msg {
  padding: 16px;
  text-align: center;
  color: var(--admin-text-muted);
  font-size: 0.84rem;
}

@media (max-width: 1024px) {
  .zones-keys-grid {
    grid-template-columns: 1fr;
  }
  .zones-workspace-grid {
    grid-template-columns: 1fr;
  }
  .zones-map-canvas {
    height: 400px;
  }
}





