/* ==========================================================================
   MGStore Admin Management Stylesheet
   ========================================================================== */

:root {
  --admin-sidebar-bg: #0f172a;
  --admin-sidebar-text: #94a3b8;
  --admin-sidebar-active: #38bdf8;
  --admin-primary: #2563eb;
  --admin-primary-hover: #1d4ed8;
  --admin-success: #10b981;
  --admin-danger: #ef4444;
  --admin-warning: #f59e0b;
  --admin-bg: #f8fafc;
  --admin-card-bg: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text-main: #1e293b;
  --admin-text-muted: #64748b;
}

html {
  height: 100%;
}

body.admin-body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  margin: 0;
  padding: 0;
  display: flex;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

/* SIDEBAR */
.admin-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--admin-sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
  overflow-y: auto;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-brand {
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.admin-logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
  flex-shrink: 0;
}

.admin-brand-text h2 {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 2px 0;
  letter-spacing: -0.3px;
}

.admin-brand-text span {
  font-size: 11px;
  color: var(--admin-sidebar-text);
  font-weight: 500;
}

.admin-nav {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--admin-sidebar-text);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.18s ease;
  cursor: pointer;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  transform: translateX(2px);
}

.admin-nav-item.active {
  background: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
  font-weight: 700;
  border-left: 3px solid #3b82f6;
}

.admin-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.view-store-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 0;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  transition: background 0.15s;
  text-decoration: none;
}

.view-store-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* MAIN CONTENT */
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--admin-bg);
}

.admin-topbar {
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

.admin-page-title h1 {
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.4px;
}

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

.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
}

.admin-btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.admin-btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.admin-btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.admin-btn-outline {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.admin-btn-outline:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.admin-btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

/* CONTENT VIEWPORT */
.admin-content {
  flex: 1;
  padding: 36px 40px;
  background-color: var(--admin-bg);
  box-sizing: border-box;
}

.admin-tab-pane {
  display: none;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
}

.admin-tab-pane.active {
  display: block;
}

/* CARDS & GRIDS */
.admin-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

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

.admin-card-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-box {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--admin-text-main);
}

.stat-label {
  font-size: 12px;
  color: var(--admin-text-muted);
}

/* FORMS */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

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

.form-group.full-width {
  grid-column: span 2;
}

.form-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--admin-text-main);
}

.form-help {
  font-size: 11px;
  color: var(--admin-text-muted);
}

.form-input, .form-select, .form-textarea {
  padding: 10px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13.5px;
  background: #fff;
  color: var(--admin-text-main);
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

/* CATEGORY MANAGER */
.category-manager-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.cat-tree-list {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  max-height: 520px;
  overflow-y: auto;
  background: #fff;
}

.cat-tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--admin-border);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.cat-tree-item:hover, .cat-tree-item.selected {
  background: #eff6ff;
  color: var(--admin-primary);
}

.cat-tree-item.depth-2 {
  padding-left: 36px;
  font-size: 13px;
  font-weight: 500;
  color: var(--admin-text-muted);
}

.cat-tree-item.depth-3 {
  padding-left: 56px;
  font-size: 12px;
  font-weight: 400;
  color: #94a3b8;
}

/* PRESETS GRID (MULTI-INDUSTRY) */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.preset-card {
  border: 2px solid var(--admin-border);
  border-radius: 12px;
  padding: 24px;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}

.preset-card:hover {
  border-color: var(--admin-primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.preset-card.active {
  border-color: var(--admin-primary);
  background: #eff6ff;
}

.preset-badge {
  display: inline-block;
  background: #e2e8f0;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 12px;
  align-self: flex-start;
}

.preset-card-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

.preset-card-desc {
  font-size: 13px;
  color: var(--admin-text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
  flex: 1;
}

.preset-btn {
  width: 100%;
  padding: 10px 0;
  background: var(--admin-primary);
  color: #fff;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  transition: background 0.15s;
}

.preset-btn:hover {
  background: var(--admin-primary-hover);
}

/* DATA TABLE */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  background: var(--admin-bg);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--admin-text-muted);
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border);
  font-size: 13px;
}

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

.table-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--admin-border);
}

/* BANNER CARDS & PREVIEW */
.banner-card {
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

@media (max-width: 900px) {
  .banner-card {
    flex-direction: column;
  }
}

.banner-preview-box {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.banner-preview-img {
  width: 100%;
  height: 130px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--admin-border);
  background: #f1f5f9;
}

.banner-form-content {
  flex: 1;
  width: 100%;
}

.file-upload-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ================= USER CONVENIENCE ENHANCEMENTS ================= */

/* 1. FLOATING TOAST NOTIFICATIONS */
.admin-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.admin-toast {
  background: #1e293b;
  color: #fff;
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInToast 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
  min-width: 280px;
}

.admin-toast.success { border-left: 5px solid #10b981; }
.admin-toast.error { border-left: 5px solid #ef4444; }
.admin-toast.info { border-left: 5px solid #3b82f6; }

@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 2. LOCATION BADGES */
.badge-loc {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: #eff6ff;
  color: #2563eb;
  margin-left: 6px;
  vertical-align: middle;
}
.badge-footer { background: #f1f5f9; color: #475569; }
.badge-header { background: #fef3c7; color: #d97706; }
.badge-main { background: #ecfdf5; color: #059669; }

/* 3. CATEGORY LEVEL BADGES */
.badge-level-1 { background: #dbeafe; color: #1e40af; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.badge-level-2 { background: #f3e8ff; color: #6b21a8; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.badge-level-3 { background: #f1f5f9; color: #475569; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; }

/* 4. SETUP CHECKLIST CARD */
.setup-checklist-card {
  background: linear-gradient(135deg, #f0f7ff 0%, #f4fbf7 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.checklist-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.step-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.step-item:hover {
  border-color: #2563eb;
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(37,99,235,0.12);
}
.step-badge {
  font-size: 11px;
  font-weight: 800;
  color: #2563eb;
  text-transform: uppercase;
}
.step-title {
  font-size: 14px;
  font-weight: 800;
  color: #1e293b;
}
.step-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}
.step-action {
  margin-top: auto;
  padding-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 5. FILTER PILL NAV */
.filter-pill-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-pill-btn {
  padding: 8px 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--admin-border);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--admin-text-main);
}
.filter-pill-btn.active, .filter-pill-btn:hover {
  background: var(--admin-primary);
  color: #fff;
  border-color: var(--admin-primary);
}

/* 6. PRODUCT MODAL LIVE PREVIEW GRID */
.product-modal-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
}
@media (max-width: 900px) {
  .product-modal-grid {
    grid-template-columns: 1fr;
  }
}
.product-live-preview-box {
  background: #f8fafc;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.preview-card-mock {
  width: 240px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.preview-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f1f5f9;
}
.preview-card-body {
  padding: 12px 14px;
}
.preview-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #222;
  margin-bottom: 6px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-card-price {
  font-size: 16px;
  font-weight: 900;
  color: #111;
}
.preview-card-orig {
  font-size: 12px;
  color: #999;
  text-decoration: line-through;
  margin-left: 6px;
}
.preview-card-disc {
  font-size: 13px;
  font-weight: 800;
  color: #e53935;
  margin-left: 6px;
}
.preview-card-tags {
  margin-top: 8px;
  display: flex;
  gap: 4px;
}
.tag-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
}
.tag-best { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.tag-new { background: #e0e7ff; color: #4338ca; border: 1px solid #a5b4fc; }
.tag-md { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.tag-rec { background: #d1fae5; color: #059669; border: 1px solid #a7f3d0; }

.badge-tag.clickable {
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
}
.badge-tag.clickable:hover {
  transform: translateY(-1px);
  filter: brightness(0.95);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.badge-tag.inactive {
  opacity: 0.35;
  background: #f8fafc;
  color: #94a3b8;
  border: 1px dashed #cbd5e1;
}
.badge-tag.inactive:hover {
  opacity: 0.75;
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* 배너 규격 뱃지 & ON/OFF 토글 스타일 */
.banner-spec-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: -0.2px;
}
.banner-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}
.banner-toggle-pill.is-active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}
.banner-toggle-pill input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #2563eb;
}
.banner-card.is-off {
  opacity: 0.55;
  border-color: #e2e8f0;
  background: #fafafa;
}
.banner-card.is-off .banner-preview-img {
  filter: grayscale(80%);
}

/* 브랜드 로고 추천 프리셋 버튼 */
.brand-presets-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.brand-preset-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.brand-preset-btn:hover {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #f8fafc;
}
.brand-preset-btn.is-active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  box-shadow: 0 0 0 1px #2563eb;
}

/* ================= LUXURY ADMIN DASHBOARD ================= */
.dash-quick-bar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  flex-wrap: wrap;
  gap: 12px;
}
.dash-quick-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.dash-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.dash-status-badge {
  font-size: 11px;
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  padding: 2px 8px;
  border-radius: 9999px;
}
.dash-quick-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-btn-ghost {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}
.admin-btn-ghost:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Luxury KPI Grid */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1024px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .dash-kpi-grid {
    grid-template-columns: 1fr;
  }
}
.dash-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}
.dash-kpi-card:hover {
  transform: translateY(-2px);
  border-color: #94a3b8;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}
.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.kpi-label {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: -0.3px;
}
.kpi-link {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
}
.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 10px;
}
.kpi-num {
  font-size: 30px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -1px;
  line-height: 1;
}
.kpi-unit {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
}
.kpi-submetrics {
  font-size: 11.5px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  margin-top: auto;
}
.kpi-submetrics strong {
  color: #0f172a;
  font-weight: 800;
}
.kpi-divider {
  color: #cbd5e1;
}

/* Split Grid: Recent Products + Reviews */
.dash-split-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 960px) {
  .dash-split-grid {
    grid-template-columns: 1fr;
  }
}
.dash-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}
.dash-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.dash-panel-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 2px 0;
}
.dash-panel-subtitle {
  font-size: 11.5px;
  color: #64748b;
  margin: 0;
}
.dash-panel-action {
  background: transparent;
  border: none;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
}
.dash-panel-action:hover {
  text-decoration: underline;
}

/* Mini Table */
.dash-table-wrap {
  overflow-x: auto;
}
.dash-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.dash-mini-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}
.dash-mini-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.dash-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  display: block;
}
.dash-prod-name {
  font-weight: 700;
  color: #1e293b;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-cat-label {
  font-size: 11px;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.dash-tag-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  display: inline-block;
}
.dash-tag-pill.tag-best {
  background: #fee2e2;
  color: #b91c1c;
}
.dash-tag-pill.tag-new {
  background: #dbeafe;
  color: #1d4ed8;
}
.dash-tag-pill.tag-md {
  background: #fef3c7;
  color: #b45309;
}

/* Recent Reviews List */
.dash-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-review-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all 0.15s ease;
}
.dash-review-card:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}
.dash-review-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dash-review-prod {
  font-size: 12px;
  font-weight: 800;
  color: #1e293b;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-review-rating {
  font-size: 10.5px;
  font-weight: 700;
  color: #1e40af;
  background: #dbeafe;
  padding: 2px 6px;
  border-radius: 4px;
}
.dash-review-comment {
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
  max-height: 34px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.dash-review-meta {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

/* System Strip */
.dash-system-strip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #64748b;
  flex-wrap: wrap;
  gap: 10px;
}
.dash-sys-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-sys-dot.online {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

/* ================= SWITCH TOGGLE & STATUS BADGES ================= */
.admin-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.admin-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.admin-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .25s ease;
  border-radius: 24px;
}
.admin-switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: .25s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.admin-switch input:checked + .admin-switch-slider {
  background-color: #0055b8;
}
.admin-switch input:checked + .admin-switch-slider:before {
  transform: translateX(20px);
}

.sec-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
}
.sec-badge.on {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.sec-badge.off {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

/* Homepage TOC Section Rows */
.toc-section-item {
  border-bottom: 1px solid #f1f5f9;
  transition: all 0.2s ease;
  background: #ffffff;
}
.toc-section-item:last-child {
  border-bottom: none;
}
.toc-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.toc-section-header:hover {
  background: #f8fafc;
}
.toc-section-item.is-off .toc-section-header {
  opacity: 0.65;
  background: #fafafa;
}
.toc-section-item.expanded {
  box-shadow: 0 4px 12px rgba(0, 85, 184, 0.06);
}
.toc-section-item.expanded .toc-section-header {
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
}
.toc-section-body {
  display: none;
  padding: 24px 22px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  animation: panelSlideDown 0.2s ease-out;
}
.toc-section-item.expanded .toc-section-body {
  display: block;
}
@keyframes panelSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.btn-edit-toggle {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}
.btn-edit-toggle:hover {
  border-color: #0055b8;
  color: #0055b8;
  background: #f0f7ff;
}
.toc-section-item.expanded .btn-edit-toggle {
  background: #0055b8;
  color: #ffffff;
  border-color: #0055b8;
}
.toc-sec-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toc-section-item.is-on .toc-sec-num {
  background: #eff6ff;
  color: #0055b8;
}

/* Payment Method Cards */
.pay-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  transition: all 0.2s ease;
}
.pay-card.is-off {
  background: #fbfcfd;
  opacity: 0.72;
}
.pay-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 18px;
  word-break: keep-all;
}
.pay-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pay-card-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}
.pay-card-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) {
  .pay-card-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}





