/* ================================================================
   HONEYVIA ADMIN CONSOLE — Clean Sidebar Dashboard
   Modern, minimal admin UI with fixed sidebar navigation
   ================================================================ */

/* ---------- Design Tokens ---------- */
:root {
  --admin-sidebar-width: 260px;
  --admin-sidebar-bg: linear-gradient(180deg, #d85300 0%, #ce4c00 60%, #b83e00 100%);
  --admin-sidebar-hover: rgba(255, 255, 255, 0.12);
  --admin-sidebar-active: rgba(255, 255, 255, 0.18);
  --admin-sidebar-text: rgba(255, 255, 255, 0.7);
  --admin-sidebar-text-active: #ffffff;
  --admin-sidebar-border: rgba(255, 255, 255, 0.12);

  --admin-bg: #f4f5f7;
  --admin-surface: #ffffff;
  --admin-surface-hover: #fafafa;
  --admin-border: #e5e7eb;
  --admin-border-light: #f0f0f0;

  --admin-text-primary: #111827;
  --admin-text-secondary: #6b7280;
  --admin-text-tertiary: #9ca3af;

  --admin-accent: #d4a03c;
  --admin-accent-light: #fef3c7;
  --admin-accent-dark: #b8860b;

  --admin-success: #059669;
  --admin-success-light: #d1fae5;
  --admin-warning: #d97706;
  --admin-warning-light: #fef3c7;
  --admin-danger: #dc2626;
  --admin-danger-light: #fee2e2;
  --admin-info: #2563eb;
  --admin-info-light: #dbeafe;

  --admin-radius-sm: 6px;
  --admin-radius: 10px;
  --admin-radius-lg: 14px;

  --admin-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --admin-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --admin-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --admin-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);

  --admin-font: 'Inter', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --admin-font-display: 'Outfit', 'Inter', sans-serif;
}

/* ---------- Reset for Admin ---------- */
.admin-shell {
  display: flex;
  min-height: 100vh;
  background: var(--admin-bg);
  font-family: var(--admin-font);
  color: var(--admin-text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.admin-shell *,
.admin-shell *::before,
.admin-shell *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--admin-sidebar-width);
  height: 100vh;
  background: var(--admin-sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.2s ease;
}

/* Sidebar Header / Brand */
.sidebar-brand {
  padding: 22px 20px;
  border-bottom: 1px solid var(--admin-sidebar-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

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

.sidebar-brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  font-family: var(--admin-font-display);
}

.sidebar-brand-label {
  font-size: 0.7rem;
  color: var(--admin-sidebar-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--admin-sidebar-text);
  padding: 16px 12px 6px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--admin-sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}

.sidebar-nav-item:hover {
  background: var(--admin-sidebar-hover);
  color: rgba(255, 255, 255, 0.85);
}

.sidebar-nav-item.active {
  background: var(--admin-sidebar-active);
  color: var(--admin-sidebar-text-active);
}

.sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: #ffffff;
  border-radius: 0 3px 3px 0;
}

.sidebar-nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.sidebar-nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  min-width: 22px;
  text-align: center;
}

.sidebar-nav-item.active .sidebar-nav-badge {
  background: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.sidebar-nav-badge.urgent {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
}

/* Sidebar Footer / Profile */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--admin-sidebar-border);
}

.sidebar-store-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--admin-sidebar-text);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  margin-bottom: 10px;
}

.sidebar-store-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar-store-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.sidebar-profile-info {
  display: flex;
  flex-direction: column;
}

.sidebar-profile-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
}

.sidebar-profile-role {
  font-size: 0.7rem;
  color: var(--admin-sidebar-text);
}

/* ================================================================
   MAIN CONTENT AREA
   ================================================================ */
.admin-main {
  margin-left: var(--admin-sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Bar */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--admin-text-primary);
  font-family: var(--admin-font-display);
}

.topbar-subtitle {
  font-size: 0.82rem;
  color: var(--admin-text-secondary);
  display: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-sync {
  font-size: 0.78rem;
  color: var(--admin-text-tertiary);
  padding-right: 16px;
  border-right: 1px solid var(--admin-border);
  margin-right: 6px;
}

/* MongoDB Live Connection Badge */
.admin-db-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #059669;
  letter-spacing: 0.01em;
  margin-right: 4px;
  transition: all 0.2s ease;
}

.admin-db-badge.connecting {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.28);
  color: #d97706;
}

.admin-db-badge .db-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  animation: db-pulse 2s infinite ease-in-out;
}

.admin-db-badge.connecting .db-badge-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

@keyframes db-pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Content */
.admin-content {
  flex: 1;
  padding: 28px 32px 48px;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--admin-radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--admin-font);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.admin-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-btn-primary {
  background: var(--admin-text-primary);
  color: #ffffff;
  border-color: var(--admin-text-primary);
}

.admin-btn-primary:hover {
  background: #374151;
  border-color: #374151;
}

.admin-btn-secondary {
  background: var(--admin-surface);
  color: var(--admin-text-primary);
  border-color: var(--admin-border);
}

.admin-btn-secondary:hover {
  background: var(--admin-surface-hover);
  border-color: #d1d5db;
}

.admin-btn-accent {
  background: var(--admin-accent);
  color: #1a1a2e;
  border-color: var(--admin-accent);
}

.admin-btn-accent:hover {
  background: var(--admin-accent-dark);
  border-color: var(--admin-accent-dark);
  color: #ffffff;
}

.admin-btn-danger {
  background: #ffffff;
  color: var(--admin-danger);
  border-color: #fecaca;
}

.admin-btn-danger:hover {
  background: var(--admin-danger-light);
  border-color: var(--admin-danger);
}

.admin-btn-sm {
  padding: 5px 10px;
  font-size: 0.75rem;
  border-radius: 5px;
}

/* ================================================================
   KPI / METRIC CARDS
   ================================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 20px;
  transition: box-shadow 0.2s ease;
}

.kpi-card:hover {
  box-shadow: var(--admin-shadow-md);
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--admin-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-icon.amber { background: var(--admin-accent-light); color: #b45309; }
.kpi-icon.green { background: var(--admin-success-light); color: #059669; }
.kpi-icon.red { background: var(--admin-danger-light); color: #dc2626; }
.kpi-icon.blue { background: var(--admin-info-light); color: #2563eb; }
.kpi-icon.purple { background: #ede9fe; color: #7c3aed; }

.kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--admin-text-primary);
  font-family: var(--admin-font-display);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.kpi-meta {
  font-size: 0.75rem;
  color: var(--admin-text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.kpi-trend {
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
}

.kpi-trend.up {
  color: var(--admin-success);
  background: var(--admin-success-light);
}

.kpi-trend.down {
  color: var(--admin-danger);
  background: var(--admin-danger-light);
}

.kpi-trend.neutral {
  color: var(--admin-warning);
  background: var(--admin-warning-light);
}

/* ================================================================
   CARDS / PANELS
   ================================================================ */
.admin-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.admin-card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--admin-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--admin-text-primary);
}

.admin-card-subtitle {
  font-size: 0.78rem;
  color: var(--admin-text-secondary);
  margin-top: 2px;
}

.admin-card-body {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.admin-card-body.flush {
  padding: 0;
}

/* Two-column grid */
.admin-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.admin-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

/* Section title inside content */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--admin-text-primary);
  font-family: var(--admin-font-display);
}

.section-heading p {
  font-size: 0.82rem;
  color: var(--admin-text-secondary);
  margin-top: 2px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================================================================
   DATA TABLES
   ================================================================ */
.admin-table-wrap {
  overflow-x: auto;
}

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

.admin-table thead {
  background: #f9fafb;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table thead th {
  padding: 10px 16px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--admin-text-secondary);
  text-align: left;
  white-space: nowrap;
}

.admin-table tbody tr {
  border-bottom: 1px solid var(--admin-border-light);
  transition: background 0.12s ease;
}

.admin-table tbody tr:last-child {
  border-bottom: none;
}

.admin-table tbody tr:hover {
  background: #f9fafb;
}

.admin-table tbody td {
  padding: 12px 16px;
  color: var(--admin-text-primary);
  vertical-align: middle;
}

.table-cell-main {
  font-weight: 600;
}

.table-cell-sub {
  font-size: 0.75rem;
  color: var(--admin-text-secondary);
  margin-top: 1px;
}

.table-product-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-product-img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--admin-border);
  flex-shrink: 0;
}

/* ================================================================
   TOOLBAR (Filters + Search)
   ================================================================ */
.admin-toolbar {
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--admin-border-light);
  flex-wrap: wrap;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-chip {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  color: var(--admin-text-secondary);
  border: 1px solid transparent;
  font-family: var(--admin-font);
}

.filter-chip:hover {
  background: #f3f4f6;
  color: var(--admin-text-primary);
}

.filter-chip.active {
  background: var(--admin-text-primary);
  color: #ffffff;
  border-color: var(--admin-text-primary);
}

.toolbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  padding: 6px 12px;
  min-width: 220px;
  transition: border-color 0.15s ease;
}

.toolbar-search:focus-within {
  border-color: var(--admin-accent);
  background: #ffffff;
}

.toolbar-search svg {
  width: 15px;
  height: 15px;
  stroke: var(--admin-text-tertiary);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.toolbar-search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.82rem;
  font-family: var(--admin-font);
  color: var(--admin-text-primary);
  width: 100%;
}

.toolbar-search input::placeholder {
  color: var(--admin-text-tertiary);
}

/* ================================================================
   STATUS BADGES
   ================================================================ */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.pending::before { background: var(--admin-warning); }
.status-dot.pending { color: var(--admin-warning); }
.status-dot.processing::before { background: var(--admin-info); }
.status-dot.processing { color: var(--admin-info); }
.status-dot.shipped::before { background: #8b5cf6; }
.status-dot.shipped { color: #8b5cf6; }
.status-dot.delivered::before { background: var(--admin-success); }
.status-dot.delivered { color: var(--admin-success); }
.status-dot.cancelled::before { background: var(--admin-danger); }
.status-dot.cancelled { color: var(--admin-danger); }
.status-dot.active::before { background: var(--admin-success); }
.status-dot.active { color: var(--admin-success); }
.status-dot.unsubscribed::before { background: var(--admin-text-tertiary); }
.status-dot.unsubscribed { color: var(--admin-text-tertiary); }
.status-dot.recovered::before { background: var(--admin-success); }
.status-dot.recovered { color: var(--admin-success); }
.status-dot.unrecovered::before { background: var(--admin-danger); }
.status-dot.unrecovered { color: var(--admin-danger); }
.status-dot.discount::before { background: var(--admin-warning); }
.status-dot.discount { color: var(--admin-warning); }
.status-dot.in-stock::before { background: var(--admin-success); }
.status-dot.in-stock { color: var(--admin-success); }
.status-dot.low-stock::before { background: var(--admin-warning); }
.status-dot.low-stock { color: var(--admin-warning); }
.status-dot.out-of-stock::before { background: var(--admin-danger); }
.status-dot.out-of-stock { color: var(--admin-danger); }

/* ================================================================
   CHART BARS
   ================================================================ */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex: 1;
  min-height: 180px;
  padding: 0 8px;
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
}

.chart-bar-col:hover .chart-bar-val {
  opacity: 1;
  transform: translateY(0);
}

.chart-bar-val {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--admin-text-secondary);
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.2s ease;
}

.chart-bar-fill {
  width: 100%;
  max-width: 44px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--admin-accent), #e8c76a);
  transition: height 0.4s ease;
}

.chart-bar-label {
  font-size: 0.7rem;
  color: var(--admin-text-tertiary);
  font-weight: 500;
}

/* ================================================================
   PROGRESS BARS
   ================================================================ */
.progress-bar-wrap {
  margin-bottom: 16px;
}

.progress-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.progress-bar-header .label {
  color: var(--admin-text-primary);
  font-weight: 500;
}

.progress-bar-header .val {
  font-weight: 700;
  color: var(--admin-text-secondary);
}

.progress-bar-track {
  height: 8px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ================================================================
   FORM ELEMENTS
   ================================================================ */
.form-group {
  margin-bottom: 16px;
}

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

.form-input,
.form-select {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  font-size: 0.85rem;
  font-family: var(--admin-font);
  color: var(--admin-text-primary);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px rgba(212, 160, 60, 0.1);
}

.form-input-inline {
  padding: 5px 10px;
  border: 1px solid var(--admin-border);
  border-radius: 5px;
  font-size: 0.82rem;
  font-family: var(--admin-font);
  color: var(--admin-text-primary);
  width: 80px;
  text-align: center;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input-inline:focus {
  border-color: var(--admin-accent);
}

.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  font-size: 0.85rem;
  font-family: var(--admin-font);
  color: var(--admin-text-primary);
  min-height: 100px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-textarea:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px rgba(212, 160, 60, 0.1);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--admin-success);
}

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

/* ================================================================
   AUTOMATION RULE CARDS
   ================================================================ */
.rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--admin-border-light);
  gap: 16px;
}

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

.rule-info h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--admin-text-primary);
  margin-bottom: 2px;
}

.rule-info p {
  font-size: 0.78rem;
  color: var(--admin-text-secondary);
  max-width: 420px;
}

.rule-info code {
  background: var(--admin-accent-light);
  color: var(--admin-accent-dark);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ================================================================
   COUPON CARDS GRID
   ================================================================ */
.coupon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.coupon-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 20px 22px;
  position: relative;
  transition: all 0.2s ease;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.coupon-card:hover {
  box-shadow: var(--admin-shadow-md);
  border-color: #cbd5e1;
}

.coupon-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.coupon-code-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.coupon-delete-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  flex-shrink: 0;
  margin: 0;
}

.coupon-delete-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.coupon-delete-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

.coupon-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--admin-text-primary);
  letter-spacing: 0.04em;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px dashed #cbd5e1;
  display: inline-block;
}

.coupon-desc {
  font-size: 0.84rem;
  color: var(--admin-text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}

.coupon-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--admin-text-tertiary);
  padding-top: 14px;
  border-top: 1px dashed var(--admin-border);
}

/* ================================================================
   ABANDONED CART HERO
   ================================================================ */
.recovery-banner {
  background: linear-gradient(135deg, #fef2f2, #fff7ed);
  border: 1px solid #fecaca;
  border-radius: var(--admin-radius);
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.recovery-banner h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--admin-danger);
  margin-bottom: 4px;
}

.recovery-banner p {
  font-size: 0.82rem;
  color: var(--admin-text-secondary);
}

.recovery-stats {
  display: flex;
  gap: 16px;
}

.recovery-stat-box {
  background: #ffffff;
  border-radius: 10px;
  padding: 12px 20px;
  text-align: center;
  box-shadow: var(--admin-shadow-sm);
}

.recovery-stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-text-tertiary);
}

.recovery-stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--admin-font-display);
}

.recovery-stat-value.red { color: var(--admin-danger); }
.recovery-stat-value.green { color: var(--admin-success); }

/* ================================================================
   MODALS & DIALOGS
   ================================================================ */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.admin-modal-box {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 25px 65px -12px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(15, 23, 42, 0.05);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  animation: adminModalPop 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

@keyframes adminModalPop {
  from {
    transform: scale(0.96) translateY(12px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Modal Header */
.admin-modal-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.admin-modal-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-modal-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fef3c7 0%, #ffedd5 100%);
  border: 1px solid #fde68a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d97706;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.12);
}

.admin-modal-icon-badge svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-modal-header h3 {
  font-family: var(--admin-font-display), 'Outfit', -apple-system, sans-serif !important;
  font-style: normal !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.02em !important;
  line-height: 1.3 !important;
  margin: 0;
}

.admin-modal-subtitle {
  font-size: 0.84rem;
  color: #64748b;
  margin-top: 3px;
  font-family: var(--admin-font);
  line-height: 1.45;
  font-weight: 400;
}

.admin-modal-close {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 50%;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  flex-shrink: 0;
}

.admin-modal-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-modal-close:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #dc2626;
  transform: rotate(90deg);
}

/* Modal Body */
.admin-modal-body {
  padding: 26px 28px 28px;
}

/* Form Groups & Inputs */
.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 20px;
}

.admin-form-group:last-child {
  margin-bottom: 0;
}

.admin-form-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--admin-font);
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.01em;
  margin-bottom: 0;
}

.admin-form-group label .label-optional {
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 400;
}

.admin-form-group label .label-badge {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 10px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-form-row .admin-form-group {
  margin-bottom: 0;
}

.admin-form-input,
.admin-form-select,
.admin-form-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-family: var(--admin-font);
  font-size: 0.9rem;
  color: #0f172a;
  line-height: 1.5;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  outline: none;
}

.admin-form-input:hover,
.admin-form-select:hover,
.admin-form-textarea:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}

.admin-form-input:focus,
.admin-form-select:focus,
.admin-form-textarea:focus {
  background: #ffffff;
  border-color: #d85300;
  box-shadow: 0 0 0 4px rgba(216, 83, 0, 0.12);
}

.admin-form-input::placeholder,
.admin-form-textarea::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.admin-form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 42px;
  cursor: pointer;
}

.admin-form-textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.55;
}

/* Affix wrappers for inputs */
.admin-input-affix {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.admin-input-prefix {
  position: absolute;
  left: 14px;
  color: #64748b;
  font-weight: 600;
  font-size: 0.92rem;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

.admin-input-affix .admin-form-input.has-prefix {
  padding-left: 34px;
}

.admin-input-suffix {
  position: absolute;
  right: 14px;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

.admin-input-affix .admin-form-input.has-suffix {
  padding-right: 52px;
}

/* Info Banner in Modals */
.admin-modal-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 0.82rem;
  color: #92400e;
  line-height: 1.5;
  margin-top: 18px;
}

.admin-modal-info-banner svg {
  width: 18px;
  height: 18px;
  stroke: #d97706;
  fill: none;
  stroke-width: 2.2;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Modal Footer */
.admin-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
}

.admin-modal-footer .admin-btn-secondary {
  background: #f8fafc;
  color: #475569;
  border: 1.5px solid #e2e8f0;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-modal-footer .admin-btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.admin-modal-footer .admin-btn-primary {
  background: linear-gradient(135deg, #d85300 0%, #b83e00 100%);
  color: #ffffff;
  border: none;
  padding: 11px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(216, 83, 0, 0.28);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-modal-footer .admin-btn-primary:hover {
  background: linear-gradient(135deg, #e65c05 0%, #c44400 100%);
  box-shadow: 0 6px 20px rgba(216, 83, 0, 0.42);
  transform: translateY(-1px);
  color: #ffffff;
}

.admin-modal-footer .admin-btn-primary:active {
  transform: translateY(0);
}

.admin-modal-footer .admin-btn-primary svg {
  width: 16px;
  height: 16px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 2.2;
}


/* ================================================================
   INVOICE (Printable)
   ================================================================ */
.invoice-paper {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 32px;
}

.invoice-header-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--admin-border-light);
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.85rem;
}

.invoice-table thead th {
  background: #f9fafb;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--admin-text-secondary);
  border-bottom: 1px solid var(--admin-border);
  text-align: left;
}

.invoice-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--admin-border-light);
}

.invoice-totals {
  display: flex;
  justify-content: flex-end;
}

.invoice-totals-box {
  width: 240px;
}

.invoice-totals-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--admin-text-secondary);
}

.invoice-totals-row.total {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--admin-text-primary);
  border-top: 2px solid var(--admin-text-primary);
  padding-top: 10px;
  margin-top: 6px;
}

/* ================================================================
   TOASTS
   ================================================================ */
.admin-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.admin-toast {
  background: var(--admin-text-primary);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: var(--admin-shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.25s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 380px;
}

@keyframes toastIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ================================================================
   EMPTY STATES
   ================================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--admin-text-secondary);
}

.empty-state-icon {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon svg {
  width: 48px;
  height: 48px;
  stroke: var(--admin-text-tertiary);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--admin-text-primary);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 0.82rem;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .admin-grid-2,
  .admin-grid-3 {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    width: 64px;
    --admin-sidebar-width: 64px;
  }
  .sidebar-brand-text,
  .sidebar-section-label,
  .sidebar-nav-item span:not(.sidebar-nav-icon),
  .sidebar-nav-badge,
  .sidebar-profile-info,
  .sidebar-store-link span {
    display: none;
  }
  .sidebar-nav-item {
    justify-content: center;
    padding: 12px;
  }
  .sidebar-nav-item.active::before {
    display: none;
  }
  .admin-main {
    margin-left: 64px;
  }
  .admin-topbar {
    padding: 0 16px;
  }
  .admin-content {
    padding: 16px;
  }
  .recovery-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Print styles */
@media print {
  .admin-sidebar,
  .admin-topbar,
  .admin-toast-container {
    display: none !important;
  }
  .admin-main {
    margin-left: 0 !important;
  }
  .admin-content {
    padding: 0 !important;
  }
}

/* ================================================================
   PROFESSIONAL ANALYTICS & INSIGHTS SUITE
   ================================================================ */
.card-subtitle-text {
  font-size: 0.78rem;
  color: var(--admin-text-secondary);
  font-weight: 400;
  margin-top: 3px;
}

/* Topbar live beacon & timeframe switch */
.analytics-topbar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.analytics-live-beacon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--admin-text-primary);
}

.beacon-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  position: relative;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: beaconPulse 2s infinite ease-out;
}

.beacon-pulse-dot.mini {
  width: 7px;
  height: 7px;
}

@keyframes beaconPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.beacon-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: #065f46;
}

.beacon-text strong {
  color: #047857;
  font-weight: 700;
}

.analytics-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 3px 8px;
  border-radius: 12px;
}

.analytics-timeframe-group {
  display: inline-flex;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

.timeframe-pill-btn {
  border: none;
  background: transparent;
  color: var(--admin-text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timeframe-pill-btn:hover {
  color: var(--admin-text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.timeframe-pill-btn.active {
  background: #ffffff;
  color: #c2410c;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Metric Strip inside card */
.analytics-metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.metric-pill {
  background: #f8fafc;
  border: 1px solid var(--admin-border-light);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pill-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--admin-text-tertiary);
  font-weight: 600;
}

.pill-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--admin-text-primary);
  font-family: var(--admin-font-display);
}

.analytics-retention-bar {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--admin-border-light);
}

.retention-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--admin-text-secondary);
}

.retention-info strong {
  color: var(--admin-text-primary);
}

.retention-track {
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  display: flex;
  overflow: hidden;
  margin-top: 6px;
}

.retention-fill.new {
  background: #c2410c;
}

.retention-fill.returning {
  background: #f59e0b;
}

/* Channels List */
.acquisition-channel-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.channel-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  margin-bottom: 5px;
}

.channel-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.channel-name {
  font-weight: 600;
  color: var(--admin-text-primary);
}

.channel-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-visits {
  font-size: 0.78rem;
  color: var(--admin-text-secondary);
  font-weight: 500;
}

.channel-conv-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--admin-success-light);
  color: var(--admin-success);
  padding: 2px 7px;
  border-radius: 10px;
}

.channel-track {
  height: 7px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}

.channel-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.channel-summary-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 18px;
}

.summary-box-icon svg {
  width: 18px;
  height: 18px;
  stroke: #d97706;
}

.summary-box-text {
  font-size: 0.78rem;
  line-height: 1.45;
  color: #92400e;
}

/* Country Table */
.analytics-badge-count {
  font-size: 0.75rem;
  font-weight: 700;
  background: #f1f5f9;
  color: var(--admin-text-secondary);
  padding: 4px 10px;
  border-radius: 12px;
}

.analytics-country-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.analytics-country-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--admin-text-tertiary);
  padding: 10px 18px;
  background: #fafafa;
  border-bottom: 1px solid var(--admin-border-light);
  font-weight: 600;
}

.analytics-country-table th,
.analytics-country-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--admin-border-light);
  vertical-align: middle;
  white-space: nowrap;
}

.country-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.country-flag-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.country-name {
  font-weight: 600;
  color: var(--admin-text-primary);
  white-space: nowrap;
  font-size: 0.88rem;
}

.country-share-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

.mini-bar-track {
  width: 55px;
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  background: #c2410c;
  border-radius: 3px;
}

.time-spent-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
  display: inline-block;
}

.bounce-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--admin-text-secondary);
}

.domestic-metros-footer {
  padding: 14px 18px;
  background: #fafafa;
  border-top: 1px solid var(--admin-border-light);
}

.domestic-metros-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--admin-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.domestic-metros-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metro-chip {
  font-size: 0.76rem;
  background: #ffffff;
  border: 1px solid var(--admin-border);
  padding: 4px 10px;
  border-radius: 20px;
  color: var(--admin-text-primary);
}

.metro-chip strong {
  color: #c2410c;
}

/* Time Spent & Dwell Duration */
.time-dwell-pill {
  font-size: 0.76rem;
  font-weight: 700;
  color: #047857;
  background: #d1fae5;
  padding: 3px 10px;
  border-radius: 12px;
}

.duration-highlight-banner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.duration-stat {
  text-align: center;
}

.stat-big {
  font-size: 1.35rem;
  font-weight: 800;
  color: #9a3412;
  font-family: var(--admin-font-display);
}

.stat-label {
  font-size: 0.72rem;
  color: #7c2d12;
  font-weight: 500;
  margin-top: 2px;
}

.duration-list-heading,
.device-split-heading {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--admin-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.duration-bucket-item {
  margin-bottom: 11px;
}

.bucket-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.bucket-bracket {
  font-weight: 700;
  color: var(--admin-text-primary);
}

.bucket-desc {
  color: var(--admin-text-secondary);
  font-size: 0.78rem;
}

.bucket-val {
  font-weight: 600;
  color: var(--admin-text-primary);
  font-size: 0.78rem;
}

.bucket-track {
  height: 7px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.bucket-fill {
  height: 100%;
  border-radius: 4px;
}

.device-split-wrap {
  border-top: 1px solid var(--admin-border-light);
  padding-top: 16px;
  margin-top: 16px;
}

.device-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.device-card {
  background: #f8fafc;
  border: 1px solid var(--admin-border-light);
  border-radius: 8px;
  padding: 10px 12px;
}

.device-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.device-icon svg {
  width: 16px;
  height: 16px;
  stroke: #c2410c;
}

.device-pct {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--admin-text-primary);
}

.device-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--admin-text-primary);
}

.device-time {
  font-size: 0.74rem;
  color: var(--admin-text-secondary);
  margin-top: 2px;
}

.device-time strong {
  color: var(--admin-text-primary);
}

.device-note {
  font-size: 0.68rem;
  color: var(--admin-text-tertiary);
  margin-top: 4px;
  line-height: 1.3;
}

/* Product Analytics Table */
.table-product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.table-thumb,
.table-product-img {
  width: 44px;
  height: 44px;
  min-width: 44px;
  max-width: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--admin-border-light);
  background: #f8fafc;
  flex-shrink: 0;
  display: block;
}

.table-product-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--admin-text-primary);
  line-height: 1.3;
}

#analytics-products-table td {
  padding: 12px 18px;
  vertical-align: middle;
}

.product-analytics-search .admin-input-search {
  padding: 6px 12px;
  font-size: 0.8rem;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: #fafafa;
  min-width: 180px;
}

.product-analytics-search .admin-input-search:focus {
  outline: none;
  background: #ffffff;
  border-color: #c2410c;
}

.product-interest-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 3px;
}

.badge-fire {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.badge-high {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-trend {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-steady {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.views-metric-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.views-bar-track {
  width: 80px;
  height: 5px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}

.views-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #c2410c, #f59e0b);
  border-radius: 3px;
}

.unique-viewers-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--admin-text-secondary);
}

.time-spent-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.time-clock-icon svg {
  width: 14px;
  height: 14px;
  stroke: var(--admin-text-tertiary);
}

.atc-rate-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.atc-rate-text {
  font-weight: 700;
  color: var(--admin-success);
  font-size: 0.85rem;
}

.atc-mini-track {
  width: 60px;
  height: 5px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}

.atc-mini-fill {
  height: 100%;
  background: var(--admin-success);
  border-radius: 3px;
}

.product-revenue-text {
  font-weight: 700;
  color: var(--admin-text-primary);
  font-size: 0.88rem;
}

.view-storefront-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #c2410c;
  background: #ffedd5;
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.view-storefront-btn:hover {
  background: #fed7aa;
  color: #9a3412;
}

.view-storefront-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
}

.analytics-table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  background: #fafafa;
  border-top: 1px solid var(--admin-border-light);
  font-size: 0.82rem;
  color: var(--admin-text-secondary);
}

.footer-stat-item span {
  color: var(--admin-text-tertiary);
  margin-right: 4px;
}

.footer-stat-item strong {
  color: var(--admin-text-primary);
}

@media (max-width: 900px) {
  .analytics-topbar-controls {
    flex-wrap: wrap;
  }
  .analytics-metric-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .device-cards-grid {
    grid-template-columns: 1fr;
  }
  .duration-highlight-banner {
    grid-template-columns: 1fr;
  }
  .analytics-table-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ================================================================
   JWT ADMIN AUTHENTICATION & LOGIN PORTAL STYLES
   Clean white page background with signature Honeyvia orange admin box
   ================================================================ */
.admin-login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: #ffffff;
  background-image: 
    radial-gradient(#e5e7eb 1px, transparent 1px),
    radial-gradient(#d85300 0.5px, transparent 0.5px);
  background-size: 32px 32px, 96px 96px;
  position: relative;
  overflow: hidden;
  font-family: var(--admin-font);
  color: #111827;
  box-sizing: border-box;
}

.admin-login-ambient {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 750px;
  height: 500px;
  background: radial-gradient(ellipse at center, rgba(216, 83, 0, 0.12) 0%, rgba(206, 76, 0, 0.04) 50%, transparent 75%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 1;
}

.admin-login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #d85300 0%, #ce4c00 60%, #b83e00 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 40px 36px 34px;
  box-shadow: 
    0 25px 60px -10px rgba(206, 76, 0, 0.42),
    0 12px 28px -6px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: adminLoginFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  color: #ffffff;
}

@keyframes adminLoginFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.admin-login-header {
  text-align: center;
  margin-bottom: 24px;
}

.admin-login-crest {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.admin-login-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.admin-login-title {
  font-family: var(--admin-font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.admin-login-error {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 2px solid #ef4444;
  color: #b91c1c;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  animation: adminShake 0.3s ease;
}

.admin-login-error svg {
  color: #dc2626;
  flex-shrink: 0;
}

@keyframes adminShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.admin-form-group label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.admin-input-icon {
  position: absolute;
  left: 14px;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.admin-input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  background: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  color: #111827;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.admin-input::placeholder {
  color: #9ca3af;
}

.admin-input:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5), 0 4px 14px rgba(0, 0, 0, 0.12);
  background: #ffffff;
}

.admin-input-action {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.admin-input-action:hover {
  color: #111827;
}

.admin-login-submit {
  width: 100%;
  padding: 14px 20px;
  background: #ffffff;
  color: #b83e00;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  margin-top: 4px;
}

.admin-login-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  background: #fff8f5;
  color: #9a3412;
}

.admin-login-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.admin-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(184, 62, 0, 0.2);
  border-top-color: #b83e00;
  border-radius: 50%;
  animation: adminSpin 0.7s linear infinite;
}

@keyframes adminSpin {
  to { transform: rotate(360deg); }
}

.admin-login-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.admin-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.admin-back-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.admin-security-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.72rem;
}

.admin-security-note svg {
  color: #ffffff;
}

/* Topbar & Sidebar Auth Controls */
.admin-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--admin-text-primary);
  box-shadow: var(--admin-shadow-sm);
}

.user-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.user-name {
  color: var(--admin-text-primary);
}

.user-role-badge {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #ecfdf5;
  color: #059669;
  padding: 2px 6px;
  border-radius: 4px;
}

.admin-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: 4px;
}

.admin-logout-btn:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.sidebar-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logout-icon {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-logout-icon:hover {
  background: rgba(239, 68, 68, 0.9);
  transform: scale(1.05);
}

/* ================================================================
   BLOGS & JOURNAL MANAGEMENT TAB STYLING
   ================================================================ */
.blog-status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.blog-status-toggle.status-published {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.blog-status-toggle.status-published:hover {
  background: #d1fae5;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.15);
}

.blog-status-toggle.status-draft {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

.blog-status-toggle.status-draft:hover {
  background: #fde68a;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.15);
}

.admin-category-pill {
  display: inline-block;
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: 12px;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 600;
  border: 1px solid #ffedd5;
  white-space: nowrap;
}

.admin-btn-micro {
  padding: 3px 8px;
  font-size: 0.75rem;
  font-family: monospace;
  font-weight: 600;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-btn-micro:hover {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}

.admin-chip-btn:hover {
  background: #fff7ed !important;
  color: #c2410c !important;
  border-color: #ea580c !important;
}

.text-danger:hover {
  color: #ef4444 !important;
  border-color: #fca5a5 !important;
  background: #fef2f2 !important;
}



