
/* ===== Print Styles ===== */
@media print {
  /* Hide chrome */
  .admin-nav, .admin-bottom-nav, .admin-topbar, .admin-sidebar,
  .quick-actions, .saved-filters-bar, .admin-modal-overlay,
  .admin-toast, .admin-confirm-overlay, .notification-dropdown,
  .orders-quick-tabs, .admin-pagination, .admin-search,
  button, .admin-btn { display: none !important; }

  /* Reset layout */
  .admin-main { margin: 0 !important; padding: 20pt !important; }
  .admin-content { margin-left: 0 !important; padding: 0 !important; }
  .admin-section { display: block !important; }
  .admin-section:not(.active) { display: none !important; }

  /* Tables */
  .admin-table-wrap { overflow: visible !important; }
  .admin-table { width: 100% !important; font-size: 9pt; border-collapse: collapse; }
  .admin-table th { background: #f0f0f0 !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .admin-table th, .admin-table td { padding: 6pt 8pt; border: 1px solid #ccc; }
  .hs-table { font-size: 9pt; }
  .hs-table th, .hs-table td { padding: 4px 8px; }

  /* Cards */
  .stat-card, .admin-panel { border: 1px solid #ccc; break-inside: avoid; box-shadow: none !important; }
  .admin-stats { gap: 8pt; }

  /* Typography */
  body { font-size: 10pt; color: #000 !important; background: #fff !important; }
  a { color: #000 !important; text-decoration: none !important; }

  /* Strip backgrounds */
  .admin-header { background: none !important; border-bottom: 2pt solid #000; padding-bottom: 8pt; margin-bottom: 12pt; }
}

/* ── Responsive: Quick Tabs ── */
@media (max-width: 768px) {
  .orders-quick-tabs { gap: 1px; padding: 3px; }
  .oqt-tab { padding: 6px 10px; font-size: 0.72rem; }
  .oqt-tab .oqt-count { display: none; }
  .order-items-badge { display: none; }
  .order-payment-method { display: none; }
  .admin-table th:nth-child(5),
  .admin-table td:nth-child(5),
  .admin-table th:nth-child(7),
  .admin-table td:nth-child(7) { display: none; }
}

/* ══════════════════════════════════════════
   Admin Interconnect Styles
   ══════════════════════════════════════════ */

/* ── Shop Health Sidebar Ring ── */
.sh-sidebar-widget {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0 8px; gap: 2px;
}
.sh-ring { display: block; }
.sh-ring-value {
  font-size: 1.1rem; font-weight: 800; margin-top: -42px;
  text-align: center; display: block; line-height: 1;
}
.sh-ring-label {
  font-size: 0.62rem; color: var(--text-tertiary); text-transform: uppercase;
  letter-spacing: 0.5px; margin-top: 22px; display: block; text-align: center;
}

/* ── Shop Health Dashboard ── */
.sh-dashboard { margin-bottom: 16px; }
.sh-dashboard-body {
  display: flex; gap: 24px; padding: 16px;
  align-items: center;
}
.sh-ring-big { position: relative; flex-shrink: 0; }
.sh-ring-big-inner {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
}
.sh-bars { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sh-bar-row { display: flex; align-items: center; gap: 8px; }
.sh-bar-label {
  width: 110px; font-size: 0.78rem; font-weight: 500;
  display: flex; align-items: center; gap: 4px; color: var(--text-secondary);
}
.sh-bar-track {
  flex: 1; height: 8px; background: var(--bg-secondary);
  border-radius: 4px; overflow: hidden;
}
.sh-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 1s ease;
}
.sh-bar-score {
  width: 42px; font-size: 0.72rem; font-weight: 600;
  text-align: right; font-family: var(--mono);
}
@media (max-width: 768px) {
  .sh-dashboard-body { flex-direction: column; }
  .sh-bar-label { width: 90px; }
}

/* ── Nav Health Dots ── */
.nav-health-dot {
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%;
}
.dot-red { background: var(--danger); }
.dot-yellow { background: var(--warning); }
.dot-green { display: none; }
.dot-gray { background: var(--text-tertiary); opacity: 0.5; }
.dot-pulse { animation: dotPulse 2s ease-in-out infinite; }
@keyframes dotPulse {
  0%, 100% { opacity: 0.3; transform: translateY(-50%) scale(1); }
  50% { opacity: 0.8; transform: translateY(-50%) scale(1.3); }
}

/* ── Catalog Completeness ── */
.completeness-panel {
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px 16px; margin-bottom: 12px;
}
.completeness-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 600; margin-bottom: 10px;
  color: var(--text-secondary);
}
.completeness-bars { display: flex; flex-direction: column; gap: 6px; }
.completeness-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; transition: background 0.15s;
  border-radius: 4px;
}
.completeness-row:hover { background: var(--bg-secondary); }
.completeness-label {
  width: 140px; font-size: 0.78rem;
  display: flex; align-items: center; gap: 4px;
}
.completeness-track {
  flex: 1; height: 6px; background: var(--bg-secondary);
  border-radius: 3px; overflow: hidden;
}
.completeness-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.completeness-pct {
  width: 100px; font-size: 0.72rem; font-weight: 600;
  text-align: right; font-family: var(--mono);
}

/* ── Action Queue ── */
.aq-group { margin-bottom: 12px; }
.aq-group-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; margin-bottom: 6px; padding-left: 2px;
}
.aq-group-label.priority-urgent { color: var(--danger); }
.aq-group-label.priority-today { color: var(--warning); }
.aq-group-label.priority-week { color: var(--info); }
.aq-group-label.priority-improve { color: var(--text-tertiary); }
.aq-group-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.action-card {
  position: relative; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--bg-primary);
  overflow: hidden; flex: 1 1 220px; max-width: 320px;
  transition: all 0.15s;
}
.action-card:hover { border-color: var(--text-tertiary); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.action-card.priority-urgent { border-left: 3px solid var(--danger); }
.action-card.priority-today { border-left: 3px solid var(--warning); }
.action-card.priority-week { border-left: 3px solid var(--info); }
.action-card.priority-improve { border-left: 3px solid var(--border); }
.action-card-main {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer;
}
.action-card-icon { flex-shrink: 0; color: var(--text-secondary); }
.action-card-content { flex: 1; min-width: 0; }
.action-card-title { font-size: 0.82rem; font-weight: 600; }
.action-card-desc { font-size: 0.72rem; color: var(--text-tertiary); margin-top: 1px; }
.action-card-dismiss {
  position: absolute; top: 4px; right: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--text-tertiary); padding: 2px;
  opacity: 0; transition: opacity 0.15s;
}
.action-card:hover .action-card-dismiss { opacity: 1; }

/* ── Next Actions Bar ── */
.next-actions-bar {
  position: fixed; bottom: -80px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 10px 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  z-index: 9999; transition: bottom 0.4s ease;
  max-width: 90vw;
}
.next-actions-bar.show { bottom: 24px; }
.na-label {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.78rem; font-weight: 600; color: var(--text-secondary);
  white-space: nowrap;
}
.na-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.na-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--bg-secondary);
  cursor: pointer; font-size: 0.78rem; font-weight: 500;
  transition: all 0.15s; white-space: nowrap;
}
.na-btn:hover { border-color: var(--yellow); background: var(--yellow); color: var(--black); }
.na-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-tertiary); padding: 4px;
}
@media (max-width: 768px) {
  .next-actions-bar {
    left: 8px; right: 8px; transform: none;
    bottom: -100px; flex-wrap: wrap;
  }
  .next-actions-bar.show { bottom: 70px; }
}

/* ── Unified Timeline ── */
.timeline-unified {
  position: relative; padding-left: 20px;
}
.timeline-unified::before {
  content: ''; position: absolute; left: 6px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item {
  position: relative; display: flex; align-items: flex-start;
  gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle, var(--border));
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  position: absolute; left: -20px; top: 12px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--bg-primary);
  flex-shrink: 0; z-index: 1;
}
.timeline-content { flex: 1; min-width: 0; }
.timeline-title {
  font-size: 0.82rem; font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}
.timeline-detail { font-size: 0.72rem; color: var(--text-tertiary); margin-top: 1px; }
.timeline-date {
  font-size: 0.72rem; color: var(--text-tertiary);
  white-space: nowrap; flex-shrink: 0;
}

/* ── Connected Section (product sidebar) ── */
.connected-section { margin-top: 12px; }
.connected-title {
  font-size: 0.78rem; font-weight: 600; margin-bottom: 6px;
  display: flex; align-items: center; gap: 4px; color: var(--text-secondary);
}
.connected-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; border-bottom: 1px solid var(--border-subtle, var(--border));
  text-decoration: none; color: inherit;
}
.connected-item:hover { color: var(--info); }

/* ── Achievements ── */
.achievements-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.achievement-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--r-sm);
  font-size: 0.75rem; font-weight: 500;
  border: 1px solid var(--border);
}
.achievement-badge.unlocked {
  background: linear-gradient(135deg, rgba(240,180,41,0.08), rgba(245,158,11,0.12));
  border-color: rgba(240,180,41,0.3); color: var(--text-primary);
}
.achievement-badge.locked {
  opacity: 0.4; filter: grayscale(1);
}
.toast-milestone {
  position: fixed; bottom: -100px; right: 24px;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #1c1a15 0%, #2a2520 100%);
  border: 1px solid rgba(240,180,41,0.3);
  border-radius: var(--r-md); padding: 16px 20px;
  box-shadow: 0 0 30px rgba(240,180,41,0.15), 0 8px 32px rgba(0,0,0,0.3);
  z-index: 10000; transition: bottom 0.5s ease;
  color: #fff; max-width: 340px;
}
.toast-milestone.show { bottom: 24px; }
.milestone-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(240,180,41,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; animation: milestoneShimmer 2s ease-in-out infinite;
}
@keyframes milestoneShimmer {
  0%, 100% { box-shadow: 0 0 10px rgba(240,180,41,0.2); }
  50% { box-shadow: 0 0 25px rgba(240,180,41,0.5); }
}
.milestone-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.5px; color: #f0b429; }
.milestone-title { font-size: 0.92rem; font-weight: 700; }
.milestone-desc { font-size: 0.75rem; color: rgba(255,255,255,0.6); }

/* ── Streak Badge ── */
.streak-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--r-sm);
  background: rgba(249,115,22,0.1); border: 1px solid rgba(249,115,22,0.2);
  font-size: 0.72rem; font-weight: 700; color: #f97316;
}

/* ══════════════════════════════════════════
   PHASE 5 — Navigation + Dashboard Redesign
   ══════════════════════════════════════════ */

/* ── Collapsible Nav Groups ── */
.nav-group { margin-bottom: 2px; }
.nav-group-label .nav-chevron {
  width: 14px; height: 14px;
  opacity: 0.4;
  transition: transform 0.2s var(--ease), opacity 0.15s;
  flex-shrink: 0;
}
.nav-group-label:hover .nav-chevron { opacity: 0.7; }
.nav-group.collapsed .nav-chevron { transform: rotate(-90deg); }
.nav-group-items {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.25s var(--ease);
  overflow: hidden;
}
.nav-group.collapsed .nav-group-items {
  grid-template-rows: 0fr;
}
.nav-group-items > div {
  min-height: 0;
  overflow: hidden;
}

/* ── Sidebar Collapse Toggle ── */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-xs);
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  transition: all 0.15s;
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
}
.sidebar-collapse-btn .lucide { width: 14px; height: 14px; }

/* Collapsed sidebar state */
.admin-sidebar.collapsed-mode {
  width: var(--admin-sidebar-collapsed);
}
.admin-sidebar.collapsed-mode .admin-logo a span,
.admin-sidebar.collapsed-mode .admin-logo-sub,
.admin-sidebar.collapsed-mode .nav-group-label,
.admin-sidebar.collapsed-mode .admin-nav a span,
.admin-sidebar.collapsed-mode .nav-badge,
.admin-sidebar.collapsed-mode .admin-user-name,
.admin-sidebar.collapsed-mode .admin-user-role,
.admin-sidebar.collapsed-mode .admin-logout,
.admin-sidebar.collapsed-mode .recent-items-widget,
.admin-sidebar.collapsed-mode .admin-shortcuts-hint,
.admin-sidebar.collapsed-mode #shop-health-sidebar,
.admin-sidebar.collapsed-mode #streak-counter,
.admin-sidebar.collapsed-mode .sidebar-collapse-wrap {
  display: none;
}
.admin-sidebar.collapsed-mode .admin-logo a {
  justify-content: center;
  gap: 0;
}
.admin-sidebar.collapsed-mode .admin-logo {
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.admin-sidebar.collapsed-mode .admin-nav {
  padding: 8px 6px;
}
.admin-sidebar.collapsed-mode .admin-nav a {
  justify-content: center;
  padding: 10px;
  border-left: none;
  margin-left: 0;
}
.admin-sidebar.collapsed-mode .admin-nav a .lucide {
  width: 20px; height: 20px;
}
.admin-sidebar.collapsed-mode .nav-group-items {
  grid-template-rows: 1fr !important;
}
.admin-sidebar.collapsed-mode .admin-user-info {
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.admin-layout:has(.admin-sidebar.collapsed-mode) .admin-main {
  margin-left: var(--admin-sidebar-collapsed);
}

/* Tooltip on hover for collapsed sidebar */
.admin-sidebar.collapsed-mode .admin-nav a {
  position: relative;
}
.admin-sidebar.collapsed-mode .admin-nav a::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: var(--bg-root);
  color: #e4e5e7;
  padding: 5px 10px;
  border-radius: var(--r-xs);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.admin-sidebar.collapsed-mode .admin-nav a:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ── Dashboard Welcome Header ── */
.dash-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #1a1710 0%, #2a2418 50%, #1e1a12 100%);
  border-radius: var(--r-lg);
  border: 1px solid rgba(240, 180, 41, 0.15);
  position: relative;
  overflow: hidden;
}
.dash-welcome::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.08) 0%, transparent 70%);
  pointer-events: none;
}
.dash-welcome-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.dash-welcome-text p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  font-weight: 400;
}
.dash-welcome-summary {
  display: flex;
  gap: 24px;
  flex-shrink: 0;
}
.dash-welcome-stat {
  text-align: center;
}
.dash-welcome-stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--brand);
  font-family: var(--mono);
  line-height: 1.2;
}
.dash-welcome-stat-label {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ── Dashboard Bento Grid ── */
.dash-bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.dash-bento > * { min-width: 0; }
.bento-12 { grid-column: span 12; }
.bento-8 { grid-column: span 8; }
.bento-6 { grid-column: span 6; }
.bento-4 { grid-column: span 4; }
.bento-3 { grid-column: span 3; }

@media (max-width: 1200px) {
  .bento-8 { grid-column: span 12; }
  .bento-4 { grid-column: span 6; }
  .bento-3 { grid-column: span 6; }
}
@media (max-width: 768px) {
  .dash-bento { grid-template-columns: 1fr; }
  .bento-12, .bento-8, .bento-6, .bento-4, .bento-3 { grid-column: span 1; }
  .dash-welcome {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }
  .dash-welcome-summary { gap: 16px; }
}

/* ── Analytics Tabs ── */
.dash-analytics-tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--bg-input);
  border-radius: var(--r-sm);
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.dash-analytics-tab {
  padding: 7px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--r-xs);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: var(--font);
}
.dash-analytics-tab:hover { color: var(--text-primary); background: var(--bg-card); }
.dash-analytics-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--sh-xs);
  font-weight: 700;
}
.dash-analytics-tab .lucide { width: 14px; height: 14px; }
.dash-analytics-pane { display: none; }
.dash-analytics-pane.active { display: block; }

/* ── Skeleton Loading ── */
@keyframes skeletonShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--border-subtle) 37%, var(--bg-input) 63%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease infinite;
  border-radius: var(--r-xs);
}
.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-text:last-child { margin-bottom: 0; }
.skeleton-text.sm { height: 10px; width: 60%; }
.skeleton-text.lg { height: 20px; width: 40%; }

/* Skeleton table rows */
.skeleton-row {
  display: flex;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}
.skeleton-row:last-child { border-bottom: none; }
.skeleton-cell {
  height: 14px;
  border-radius: 4px;
  flex: 1;
}
.skeleton-cell.w-20 { flex: 0 0 20%; }
.skeleton-cell.w-30 { flex: 0 0 30%; }
.skeleton-cell.w-15 { flex: 0 0 15%; }
.skeleton-cell.badge { height: 24px; width: 70px; flex: none; border-radius: var(--r-sm); }

/* Skeleton stat card */
.skeleton-stat-card {
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.skeleton-stat-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  margin-bottom: 12px;
}
.skeleton-stat-value {
  height: 24px; width: 50%;
  border-radius: 4px;
  margin-top: 6px;
}

/* ── Performance: off-screen panels ── */
.admin-section:not(.active) {
  content-visibility: hidden;
  contain-intrinsic-size: auto 500px;
}

/* ── Sidebar + main transitions ── */
.admin-sidebar { transition: width 0.25s var(--ease); }
.admin-main { transition: margin-left 0.25s var(--ease); }

/* ── Nav group active indicator ── */
.nav-group-label.has-active { color: rgba(240, 180, 41, 0.6); }

/* Hide sidebar collapsed mode on mobile */
@media (max-width: 768px) {
  .sidebar-collapse-wrap { display: none !important; }
  .admin-sidebar.collapsed-mode {
    width: 280px;
    transform: translateX(-100%);
  }
  .admin-sidebar.collapsed-mode .admin-logo a span,
  .admin-sidebar.collapsed-mode .admin-logo-sub,
  .admin-sidebar.collapsed-mode .nav-group-label,
  .admin-sidebar.collapsed-mode .admin-nav a span,
  .admin-sidebar.collapsed-mode .nav-badge,
  .admin-sidebar.collapsed-mode .admin-user-name,
  .admin-sidebar.collapsed-mode .admin-user-role,
  .admin-sidebar.collapsed-mode .admin-logout,
  .admin-sidebar.collapsed-mode .recent-items-widget,
  .admin-sidebar.collapsed-mode .admin-shortcuts-hint,
  .admin-sidebar.collapsed-mode #shop-health-sidebar,
  .admin-sidebar.collapsed-mode #streak-counter {
    display: revert;
  }
  .admin-sidebar.collapsed-mode .admin-nav a {
    justify-content: flex-start;
    padding: 9px 14px;
  }
  .admin-sidebar.collapsed-mode .admin-nav a::after { display: none; }
}

/* ═══════════════════════════════════════════
   PANEL ENHANCEMENTS v2 (2026-03-14)
   ═══════════════════════════════════════════ */

/* Bulk price editor highlight */
#bulk-price-table tbody tr { transition: background .2s; }
#bulk-price-table tbody tr:hover { background: rgba(240,180,41,0.04) !important; }
#bulk-price-table input[type="number"] { font-family: var(--mono); }

/* KPI goal progress bars */
#kpi-goals-widget .admin-panel-body > div {
  transition: transform .15s;
}
#kpi-goals-widget .admin-panel-body > div:hover {
  transform: translateY(-2px);
}

/* Fulfillment batch bar */
#ful-batch-bar { align-items: center; }
#ful-view-tabs button.active {
  background: var(--brand);
  color: var(--black);
  border-color: var(--brand);
}

/* Pipeline analytics modal */
#pipeline-analytics-modal .admin-stats {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* Dunning level badges */
.status-badge.cancelled { background: rgba(220,38,38,0.12); color: #dc2626; }

/* Enhanced stat cards for new panels */
.stat-card .comparison-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}
.comparison-badge.comparison-up { color: #16a34a; background: rgba(22,163,106,0.1); }
.comparison-badge.comparison-down { color: #dc2626; background: rgba(220,38,38,0.1); }
.comparison-badge.comparison-flat { color: #94a3b8; background: rgba(148,163,184,0.1); }

/* Reorder urgency indicators */
.reorder-critical { animation: pulse-red 2s infinite; }
@keyframes pulse-red {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 3px rgba(220,38,38,0.2); }
}

/* Condition assessment form */
.condition-checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 0.82rem;
  cursor: pointer;
}

/* Report panes animation */
.report-pane { display: none; }
.report-pane.active { display: block; animation: fadeIn .2s ease; }

/* Agent performance bars */
.agent-perf-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.agent-perf-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .5s;
}

/* Modal overlay z-index for stacked modals */
#dunning-overview-modal,
#bulk-price-modal,
#margin-alerts-modal,
#credit-overview-modal,
#health-scores-modal,
#return-analytics-modal,
#pipeline-analytics-modal,
#ab-test-modal,
#auto-reply-modal,
#auto-reply-editor,
#agent-perf-modal,
#kpi-editor-modal,
#sched-report-modal {
  z-index: 1100;
}

/* ══════════════════════════════════════════
   Accessibility: Reduced Motion
   ══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .admin-toast { transition: none !important; }
  .admin-modal-overlay, .admin-confirm-overlay { animation: none !important; }
  .admin-modal { animation: none !important; }
  .skeleton { animation: none !important; background: var(--bg-input) !important; }
}

/* ══════════════════════════════════════════
   Dark Mode (system preference)
   ══════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-main: #111318;
    --bg-card: #1a1d24;
    --bg-card-hover: #22252e;
    --bg-input: #1e2028;
    --bg-elevated: #1e2128;
    --bg-modal-overlay: rgba(0, 0, 0, 0.7);

    --border: #2a2d36;
    --border-subtle: #22252e;

    --text-primary: #e4e6eb;
    --text-secondary: #a0a8b8;
    --text-tertiary: #6b7280;

    --sh-xs: 0 1px 2px rgba(0,0,0,0.2);
    --sh-sm: 0 1px 4px rgba(0,0,0,0.25);
    --sh-md: 0 4px 20px rgba(0,0,0,0.3);
    --sh-lg: 0 16px 48px rgba(0,0,0,0.4);
    --sh-card: 0 1px 4px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.03);
    --sh-card-hover: 0 8px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);

    --success-bg: #064e3b;
    --warning-bg: #78350f;
    --danger-bg: #7f1d1d;
    --info-bg: #1e3a5f;
    --purple-bg: #2e1065;
    --yellow-light: #3d2800;

    --bg-secondary: var(--bg-input);
    --bg-tertiary: #22252e;
  }

  body { color-scheme: dark; }

  .admin-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
  .admin-table tbody tr:hover { background: rgba(255,255,255,0.04); }

  .admin-input, .admin-select, select, textarea {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border);
  }

  .admin-modal { background: var(--bg-card); }
  .hs-sidebar { background: var(--bg-elevated); border-color: var(--border); }

  .status-badge, .hs-status { border: 1px solid rgba(255,255,255,0.1); }

  img, svg { opacity: 0.9; }
}
