/* ========================================================
   LunaLens Studio — Pixel-Perfect Luxury Boutique Admin (admin.css)
   Clean, Bright, Luminous & Modern Aesthetic (简洁明亮奢华美学)
   ======================================================== */

:root {
  /* Crisp Luminous Canvas & Backgrounds */
  --bg-admin: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  
  /* High-contrast, elegant typography */
  --text-main: #0f172a;       /* Slate 900 - ultra crisp & clear */
  --text-secondary: #334155;  /* Slate 700 - rich readable */
  --text-muted: #64748b;      /* Slate 500 */
  --text-light: #94a3b8;      /* Slate 400 */
  
  /* Luminous White & Modern Sidebar (简洁明亮高雅侧栏) */
  --sidebar-bg: #ffffff;
  --sidebar-border: #eef2f6;
  --sidebar-text: #475569;
  --sidebar-text-muted: #94a3b8;
  --sidebar-hover: #f8fafc;
  --sidebar-hover-text: #0f172a;
  --sidebar-active-bg: #fff1f2;
  --sidebar-active-text: #e11d48;
  --sidebar-active-border: #fecdd3;
  
  /* Radiant Sakura Rose Palette (明亮高雅法式樱粉) */
  --rose-primary: #e11d48;    /* Rose 600 - vibrant, luxurious, high clarity */
  --rose-hover: #be123c;      /* Rose 700 */
  --rose-active: #9f1239;     /* Rose 800 */
  --rose-soft: #fff1f2;       /* Rose 50 - clean sakura glow */
  --bg-rose-soft: #fff1f2;
  --rose-gradient: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  --rose-light-gradient: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  
  /* Fresh Status Colors */
  --green-success: #10b981;
  --green-soft: #ecfdf5;
  --green-border: #a7f3d0;
  --amber-warning: #f59e0b;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;
  --blue-info: #3b82f6;
  --blue-soft: #eff6ff;
  --blue-border: #bfdbfe;
  
  /* Precision Hairline Borders */
  --border-card: #eef2f6;
  --border-soft: #f8fafc;
  --border-rose: #fecdd3;
  
  /* Modern Smooth Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;
  
  /* Luminous Layered Shadows (Apple / Stripe High-Precision) */
  --shadow-subtle: 0 1px 2px 0 rgba(0, 0, 0, 0.04), 0 1px 3px -1px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 2px 8px -2px rgba(15, 23, 42, 0.04), 0 8px 24px -4px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 10px 25px -4px rgba(225, 29, 72, 0.12), 0 4px 12px -2px rgba(225, 29, 72, 0.06);
  --shadow-modal: 0 25px 60px -15px rgba(15, 23, 42, 0.18);
  
  --font-main: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Outfit", -apple-system, BlinkMacSystemFont, sans-serif;
  
  --sidebar-width: 250px;
  --header-height: 68px;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-admin);
  color: var(--text-main);
  line-height: 1.5;
  height: 100vh;
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ================= 1. Clean Luminous Boutique Sidebar ================= */
.admin-sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 20;
  flex-shrink: 0;
  padding: 16px 14px 14px 14px;
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 1px 0 6px rgba(15, 23, 42, 0.02);
  box-sizing: border-box;
  overflow: hidden;
}

.sidebar-brand-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px 14px 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.sidebar-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.28);
}

.sidebar-brand-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.sidebar-brand-name {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.sidebar-brand-tag {
  font-size: 9.5px;
  font-weight: 800;
  color: #e11d48;
  background: #fff1f2;
  border: 1px solid #ffe4e6;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-menu-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar-menu-list::-webkit-scrollbar {
  display: none;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 12px 10px 4px 10px;
  text-transform: uppercase;
  margin: 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sidebar-text);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1.3;
  border: 1px solid transparent;
}

.sidebar-nav-item svg {
  width: 16px;
  height: 16px;
  stroke: #64748b;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

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

.sidebar-nav-item:hover svg {
  stroke: var(--rose-primary);
}

.sidebar-nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 700;
  border-color: var(--sidebar-active-border);
  box-shadow: 0 1px 4px rgba(225, 29, 72, 0.08);
}

.sidebar-nav-item.active svg {
  stroke: var(--sidebar-active-text);
  stroke-width: 2.2;
}

/* Compact Sidebar Bottom Bar */
.sidebar-bottom-wrap {
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
  flex-shrink: 0;
  margin-top: auto;
}

.sidebar-user-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #eef2f6;
  transition: all 0.2s ease;
}

.sidebar-user-compact:hover {
  border-color: #e2e8f0;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.sidebar-user-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sidebar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.2);
}

.sidebar-user-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-signout-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.sidebar-signout-btn:hover {
  color: #e11d48;
  border-color: #fecdd3;
  background: #fff1f2;
}

/* ================= 2. Admin Main Content Area ================= */
.admin-main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
  background: var(--bg-admin);
}

.admin-header {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.admin-header-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 20px;
}

.admin-header-left {
  display: none;
}

.admin-mobile-toggle-btn {
  display: none;
}

.admin-mobile-brand-title {
  display: none;
}

.admin-mobile-search-bar {
  display: none;
}

.header-search {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  min-height: 42px;
  flex: 0 1 580px;
  max-width: 580px;
  min-width: 220px;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.header-search:hover {
  border-color: #cbd5e1;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.header-search:focus-within {
  border-color: var(--rose-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3.5px rgba(225, 29, 72, 0.12), 0 4px 14px rgba(225, 29, 72, 0.06);
}

.header-search .search-icon {
  stroke: #64748b;
  transition: stroke 0.2s ease, transform 0.2s ease;
}

.header-search:focus-within .search-icon {
  stroke: var(--rose-primary);
  transform: scale(1.08);
}

.header-search input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-main);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
  width: 100%;
  letter-spacing: -0.01em;
}

.header-search input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.search-shortcut-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 2px 7px;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  pointer-events: none;
  flex-shrink: 0;
  line-height: 1.2;
  user-select: none;
  transition: opacity 0.15s ease;
}

.header-search:focus-within .search-shortcut-badge {
  opacity: 0.4;
}

.search-clear-btn {
  background: #f1f5f9;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.search-clear-btn:hover {
  color: #ffffff;
  background: var(--rose-primary);
  transform: scale(1.08);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.header-storefront-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.header-storefront-btn:hover {
  border-color: #fecdd3;
  color: #e11d48;
  background: #fff1f2;
}

.header-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-admin-badge:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  background: var(--bg-admin);
}

.content-container {
  max-width: 1320px;
  margin: 0 auto;
}

/* ================= 3. Metric Cards Grid ================= */
.metric-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-rose);
}

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

.metric-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--rose-soft);
  color: var(--rose-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.metric-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.trend-badge.up {
  background: var(--green-soft);
  color: var(--green-success);
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

/* Shortcuts Bar */
.dash-shortcuts-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.dash-shortcut-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.dash-shortcut-btn:hover {
  border-color: #fecdd3;
  color: #e11d48;
  background: #fff1f2;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.1);
}

/* ================= 4. Luxury Admin Tables ================= */
.admin-table-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.02), 0 8px 24px rgba(15,23,42,0.02);
  overflow: hidden;
  margin-bottom: 28px;
}

.admin-table-header {
  padding: 18px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: #ffffff;
}

.admin-table-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: #f8fafc;
  padding: 13px 18px;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1.5px solid var(--border-card);
}

.admin-table td {
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--text-main);
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #fff8f9;
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 800;
}

.status-pill.preparing {
  background: var(--amber-soft);
  color: #b45309;
  border: 1px solid #fde68a;
}

.status-pill.pending {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.status-pill.paid {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.status-pill.dispatched {
  background: var(--blue-soft);
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.status-pill.delivered {
  background: var(--green-soft);
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-pill.cancelled {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Action Buttons */
.btn-admin-action {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-admin-action:hover {
  border-color: var(--border-rose);
  color: var(--rose-primary);
  background: var(--rose-soft);
}

.btn-admin-primary {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--rose-gradient);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.28);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-admin-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.38);
}

.btn-outline-pill {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-outline-pill:hover {
  border-color: var(--border-rose);
  color: var(--rose-primary);
  background: var(--rose-soft);
}

/* Form Controls */
.boutique-input, .boutique-select {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #0f172a;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.boutique-input:focus, .boutique-select:focus {
  border-color: var(--rose-primary);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

.boutique-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.boutique-form-group {
  margin-bottom: 14px;
}

/* ================= 5. Analytics & Dashboard Charts ================= */
.analytics-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.analytics-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-subtle);
  box-sizing: border-box;
  overflow: hidden;
}

.chart-bars-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 180px;
  padding-top: 20px;
  border-bottom: 1px solid #f1f5f9;
  gap: 12px;
}

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

.chart-bar-pill {
  width: 100%;
  max-width: 38px;
  background: linear-gradient(180deg, #fb7185 0%, #e11d48 100%);
  border-radius: 6px 6px 0 0;
  transition: height 0.4s ease;
  position: relative;
}

.chart-bar-pill:hover {
  background: linear-gradient(180deg, #f43f5e 0%, #be123c 100%);
}

.chart-bar-pill:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.chart-bar-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  width: 100%;
  box-sizing: border-box;
}

.rank-item:last-child {
  border-bottom: none;
}

.rank-item > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.rank-item > div:first-child > div:last-child {
  min-width: 0;
  overflow: hidden;
}

.rank-item > div:first-child strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px !important;
}

.rank-item > div:last-child {
  flex-shrink: 0;
  text-align: right;
  white-space: nowrap;
}

.rank-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: 11.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rank-badge.top-1 { background: #fef08a; color: #854d0e; }
.rank-badge.top-2 { background: #e2e8f0; color: #334155; }
.rank-badge.top-3 { background: #ffedd5; color: #9a3412; }

/* Progress bar */
.bar-progress-wrap {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.bar-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--rose-primary);
}

/* Settings Form Tabs & Groups */
.settings-section-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-subtle);
}

.settings-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-section-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0 0 18px 0;
}

/* Toggle Switch */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .switch-slider {
  background-color: #10b981;
}

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

/* ================= 6. Admin Boutique Modal Perfection ================= */
.boutique-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.boutique-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.boutique-modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px 36px;
  position: relative;
  transform: scale(0.96);
  transition: transform 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.boutique-modal-backdrop.active .boutique-modal-dialog {
  transform: scale(1);
}

.boutique-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-card);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.boutique-modal-close:hover {
  background: var(--bg-rose-soft);
  color: var(--rose-primary);
  border-color: var(--border-rose);
  transform: rotate(90deg);
}

.modal-section-divider {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  margin: 18px 0 12px 0;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border-card);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================= 7. Luxury Analytics KPI Cards (Balanced 4x2 Grid) ================= */
.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) {
  .analytics-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 600px) {
  .analytics-kpi-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

.analytics-kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 120px;
  box-sizing: border-box;
}

.analytics-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(225, 29, 72, 0.06), 0 8px 10px -6px rgba(225, 29, 72, 0.04);
  border-color: #fecdd3;
}

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

.kpi-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-bottom: 8px;
}

.kpi-currency {
  font-size: 14px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: -0.01em;
}

.kpi-number {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
  line-height: 1.1;
  white-space: nowrap;
}

.kpi-unit {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-left: 3px;
}

.kpi-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  flex-wrap: wrap;
}

.trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11px;
}

.trend-pill.up {
  background: #ecfdf5;
  color: #059669;
}

.kpi-subtext {
  color: #94a3b8;
  font-size: 11px;
}

.kpi-info-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  padding: 2px 8px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #f1f5f9;
}

.kpi-info-tag.green {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #dcfce7;
}

.kpi-info-tag.purple {
  background: #faf5ff;
  color: #9333ea;
  border-color: #f3e8ff;
}

.kpi-info-tag.sky {
  background: #f0f9ff;
  color: #0284c7;
  border-color: #e0f2fe;
}

.live-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #e11d48;
  background: #fff1f2;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #ffe4e6;
}

.live-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e11d48;
  box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.7);
  animation: pulseLive 1.8s infinite;
}

@keyframes pulseLive {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(225, 29, 72, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

/* ================= 8. COMPREHENSIVE RESPONSIVE DESIGN ================= */
.admin-mobile-toggle-btn {
  display: none;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.sidebar-close-btn {
  display: none;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sidebar-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.admin-sidebar-backdrop {
  display: none;
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.4) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  z-index: 9998 !important;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.admin-sidebar-backdrop.active {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

@media (max-width: 992px) {
  body {
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
  }

  .sidebar-close-btn {
    display: flex !important;
  }

  .admin-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 250px !important;
    max-width: 78vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 9999 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 16px 14px 14px 14px !important;
    background: #ffffff !important;
  }

  .admin-sidebar.active {
    transform: translateX(0) !important;
  }

  .sidebar-brand-box {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 4px 16px 4px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    margin-bottom: 12px !important;
    flex-shrink: 0 !important;
  }

  .sidebar-menu-list {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    min-height: 0 !important;
    padding-bottom: 10px !important;
    gap: 4px !important;
  }

  .sidebar-nav-item {
    padding: 10px 14px !important;
    font-size: 13.5px !important;
    gap: 12px !important;
  }

  .sidebar-bottom-wrap {
    flex-shrink: 0 !important;
    border-top: 1px solid #f1f5f9 !important;
    padding-top: 10px !important;
    margin-top: auto !important;
  }

  .admin-main-wrap {
    width: 100%;
    height: auto !important;
    min-height: 100vh;
    overflow-y: visible !important;
  }

  .admin-mobile-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid var(--border-card);
    font-size: 18px;
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    flex-shrink: 0;
    cursor: pointer;
    touch-action: manipulation;
  }

  .admin-header {
    height: auto !important;
    padding: 10px 16px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    background: #ffffff !important;
    border-bottom: 1px solid var(--border-card) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
  }

  .admin-header-main-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .admin-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
  }

  .admin-mobile-brand-title {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    color: var(--text-main) !important;
    letter-spacing: -0.02em !important;
  }

  .admin-header-main-row .header-search {
    display: flex !important;
    flex: 1 1 auto !important;
    max-width: 580px !important;
    min-width: 180px !important;
  }

  .admin-mobile-search-bar {
    display: none !important;
  }

  @media (max-width: 640px) {
    .admin-header-main-row .header-search {
      display: none !important;
    }

    .admin-mobile-search-bar {
      display: flex !important;
      align-items: center !important;
      background: #f8fafc !important;
      border: 1.5px solid #e2e8f0 !important;
      border-radius: var(--radius-pill) !important;
      padding: 8px 14px !important;
      gap: 8px !important;
      position: relative !important;
      width: 100% !important;
      margin-top: 8px !important;
    }

    .admin-mobile-search-bar input {
      border: none !important;
      background: transparent !important;
      outline: none !important;
      font-family: var(--font-main) !important;
      font-size: 13px !important;
      color: var(--text-main) !important;
      width: 100% !important;
    }

    .header-storefront-btn .header-storefront-label {
      display: none !important;
    }

    .header-storefront-btn {
      padding: 6px 9px !important;
    }

    .header-admin-badge strong {
      display: none !important;
    }

    .header-admin-badge {
      padding: 3px !important;
      border-radius: 50% !important;
    }
  }

  .header-actions {
    margin-left: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  .header-db-badge {
    display: none !important;
  }

  .header-live-label, #headerAdminName, .header-storefront-label {
    display: none !important;
  }

  .header-live-badge {
    padding: 4px 8px !important;
    font-size: 11.5px !important;
    border-radius: 999px !important;
  }

  .header-admin-badge {
    padding: 2px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .header-storefront-btn {
    padding: 5px 9px !important;
    font-size: 12px !important;
    border-radius: 999px !important;
  }

  .admin-content {
    padding: 14px 12px !important;
    overflow-y: visible !important;
    height: auto !important;
  }

  .content-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  .tab-panel {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .analytics-kpi-grid, .metric-cards-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 16px !important;
  }

  .analytics-kpi-card, .metric-card {
    padding: 12px 10px !important;
    min-height: 90px !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  .kpi-title, .metric-title {
    font-size: 10px !important;
    letter-spacing: 0.02em !important;
  }

  .kpi-number, .metric-value {
    font-size: 17px !important;
    line-height: 1.2 !important;
    word-break: break-word !important;
  }

  .kpi-currency {
    font-size: 11.5px !important;
  }

  .kpi-unit {
    font-size: 10.5px !important;
  }

  .kpi-footer, .metric-footer {
    font-size: 9.5px !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
  }

  .brand-overview-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .analytics-grid-2, .analytics-grid-3 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .chart-card {
    padding: 14px 12px !important;
    border-radius: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .chart-bars-wrap {
    height: 140px !important;
    gap: 6px !important;
  }

  .chart-bar-pill {
    max-width: 22px !important;
  }

  .rank-item {
    padding: 8px 0 !important;
  }

  .rank-item > div:first-child strong {
    font-size: 12px !important;
  }

  .rank-item > div:last-child strong {
    font-size: 12px !important;
  }

  .rank-badge {
    width: 20px !important;
    height: 20px !important;
    font-size: 10px !important;
  }
}

@media (max-width: 480px) {
  .analytics-kpi-grid, .metric-cards-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .analytics-kpi-card, .metric-card {
    padding: 10px 8px !important;
    min-height: 85px !important;
  }

  .kpi-icon-badge, .metric-icon-badge {
    width: 24px !important;
    height: 24px !important;
    font-size: 12px !important;
  }

  .kpi-title, .metric-title {
    font-size: 9px !important;
  }

  .kpi-number, .metric-value {
    font-size: 15.5px !important;
  }

  .kpi-footer, .metric-footer {
    font-size: 9px !important;
    gap: 3px !important;
  }
}
