/* ============================================
   MAISON NOIR — Admin Panel Stylesheet
   ============================================ */

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

:root {
  --sidebar-w: 260px;
  --topbar-h: 72px;

  /* Light theme */
  --bg: #f4f2ef;
  --surface: #ffffff;
  --surface-2: #f9f8f6;
  --border: #eaeae7;
  --text: #1a1a1a;
  --text-2: #6b6b6b;
  --text-3: #a0a0a0;

  /* Sidebar */
  --sb-bg: #0d0d0d;
  --sb-text: rgba(248,246,242,0.65);
  --sb-text-active: #f8f6f2;
  --sb-accent: #c9a96e;
  --sb-hover: rgba(255,255,255,0.06);
  --sb-active: rgba(201,169,110,0.12);

  /* Accent */
  --gold: #c9a96e;
  --gold-light: rgba(201,169,110,0.12);
  --grey-100: #f4f2ef;
  --grey-200: #eaeae7;
  --grey-600: #6b6b6b;

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --page-pad-x: clamp(1.25rem, 3vw, 2.5rem);
  --page-pad-y: clamp(1.5rem, 3vw, 2.25rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --radius: 10px;
}

body.dark {
  --bg: #111111;
  --surface: #1a1a1a;
  --surface-2: #222222;
  --border: #2a2a2a;
  --text: #f0ede8;
  --text-2: #9a9a9a;
  --text-3: #555555;
}

html { font-size: 15px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.35s var(--ease-out);
  overflow-y: auto;
  scrollbar-width: none;
}

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.75rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand-icon {
  width: 38px; height: 38px;
  background: var(--gold);
  color: #0d0d0d;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.brand-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--sb-text-active);
}

.brand-name span { color: var(--gold); }

.brand-sub {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sb-text);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0.875rem;
}

.nav-group-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 0.75rem 0.625rem 0.4rem;
  margin-top: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sb-text);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  position: relative;
  margin-bottom: 2px;
}

.nav-item svg {
  width: 18px; height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  flex-shrink: 0;
}

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

.nav-item.active {
  background: var(--sb-active);
  color: var(--sb-accent);
}

.nav-item.active svg { stroke: var(--sb-accent); }

.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: #0d0d0d;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px; height: 36px;
  background: var(--gold);
  color: #0d0d0d;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info strong {
  display: block;
  font-size: 0.8rem;
  color: var(--sb-text-active);
  font-weight: 600;
}

.user-info span {
  font-size: 0.65rem;
  color: var(--sb-text);
  letter-spacing: 0.05em;
}

.view-store-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sb-text);
  transition: background 0.2s, color 0.2s;
}

.view-store-btn:hover { background: var(--sb-hover); color: var(--sb-text-active); }
.view-store-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* ============================================
   MAIN AREA
   ============================================ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  gap: 1.5rem;
}

.topbar-left { flex: 1; min-width: 0; }

.page-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
}

.breadcrumb {
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--grey-100);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 0.875rem;
  height: 38px;
  transition: border-color 0.2s;
}

.search-box:focus-within { border-color: var(--gold); }

.search-box svg {
  width: 15px; height: 15px;
  stroke: var(--text-3);
  fill: none;
  stroke-width: 1.5;
  flex-shrink: 0;
}

.search-box input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text);
  outline: none;
  width: 200px;
}

.search-box input::placeholder { color: var(--text-3); }

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--grey-100);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}

.topbar-btn:hover { background: var(--gold-light); border-color: var(--gold); }

.topbar-btn svg {
  width: 16px; height: 16px;
  stroke: var(--text-2);
  fill: none;
  stroke-width: 1.5;
}

.notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: #e07b6a;
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}

/* ============================================
   PAGES
   ============================================ */
.page {
  display: none;
  padding: var(--page-pad-y) var(--page-pad-x);
  animation: fadeIn 0.3s ease;
}

.page.active { display: block; }

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

/* ============================================
   KPI CARDS
   ============================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5) var(--sp-5);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
}

.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.kpi-icon {
  width: 42px; height: 42px;
  background: rgba(var(--accent-rgb, 201,169,110), 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon svg {
  width: 20px; height: 20px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
}

.kpi-data { flex: 1; min-width: 0; }

.kpi-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-2);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.kpi-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.kpi-change {
  font-size: 0.72rem;
  font-weight: 500;
}

.kpi-change.up { color: #27ae60; }
.kpi-change.down { color: #e74c3c; }

/* ============================================
   CARD
   ============================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0;
  margin-bottom: 1.25rem;
}

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.card-header p {
  font-size: 0.75rem;
  color: var(--text-3);
}

/* ============================================
   CHARTS
   ============================================ */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.chart-card { padding-bottom: 1.5rem; }

.chart-wrap {
  padding: 0 1.5rem;
  height: 260px;
  position: relative;
}

.chart-wrap canvas { width: 100% !important; height: 100% !important; }

.donut-wrap {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.donut-wrap canvas { width: 180px !important; height: 180px !important; }

.donut-legend { width: 100%; }

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
}

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

.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.legend-left { display: flex; align-items: center; color: var(--text-2); }
.legend-pct { font-weight: 600; color: var(--text); }

.chart-period {
  display: flex;
  gap: 2px;
  background: var(--grey-100);
  border-radius: 6px;
  padding: 2px;
}

.period-btn {
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  background: transparent;
  border: none;
  font-family: inherit;
}

.period-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* ============================================
   BOTTOM ROW
   ============================================ */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.25rem;
}

/* ============================================
   MINI TABLE (Dashboard)
   ============================================ */
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.mini-table th {
  padding: 0.6rem 1.5rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}

.mini-table td {
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}

.mini-table tr:last-child td { border-bottom: none; }
.mini-table tr:hover td { background: var(--surface-2); }
.mini-table td:first-child { font-weight: 600; color: var(--text); font-family: 'Cormorant Garamond', serif; font-size: 0.9rem; }

/* ============================================
   STATUS PILLS
   ============================================ */
.status-pill {
  display: inline-block;
  padding: 0.28rem 0.65rem;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.status-pill.fulfilled { background: rgba(39,174,96,0.1); color: #27ae60; }
.status-pill.processing { background: rgba(52,152,219,0.12); color: #2980b9; }
.status-pill.shipped { background: rgba(155,123,181,0.12); color: #9b7bb5; }
.status-pill.pending { background: rgba(243,156,18,0.12); color: #d68910; }
.status-pill.cancelled { background: rgba(231,76,60,0.1); color: #e74c3c; }
.status-pill.active { background: rgba(39,174,96,0.1); color: #27ae60; }
.status-pill.draft { background: rgba(149,165,166,0.15); color: #7f8c8d; }
.status-pill.archived { background: rgba(231,76,60,0.1); color: #e74c3c; }
.status-pill.low { background: rgba(243,156,18,0.12); color: #d68910; }

/* ============================================
   TOP PRODUCTS
   ============================================ */
.top-product-list { padding: 0 1.5rem 1.5rem; }

.top-product-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

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

.tp-img {
  width: 44px; height: 56px;
  border-radius: 6px;
  flex-shrink: 0;
}

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

.tp-info strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-info span {
  font-size: 0.7rem;
  color: var(--text-3);
}

.tp-right { min-width: 90px; text-align: right; }

.tp-rev {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.tp-bar {
  height: 3px;
  background: var(--grey-100);
  border-radius: 100px;
  overflow: hidden;
}

.tp-bar div {
  height: 100%;
  background: var(--gold);
  border-radius: 100px;
}

/* ============================================
   PAGE TOOLBAR
   ============================================ */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.toolbar-filters {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  flex-wrap: wrap;
}

.select-input {
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.55rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.select-input:focus { border-color: var(--gold); }

/* ============================================
   DATA TABLE
   ============================================ */
.table-card { overflow: hidden; }

.table-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.table-header-row h3 {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-count {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--gold-light);
  color: var(--gold);
  padding: 2px 8px;
  border-radius: 100px;
}

.table-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 0.75rem;
  height: 36px;
  transition: border-color 0.2s;
}

.table-search:focus-within { border-color: var(--gold); }

.table-search svg {
  width: 14px; height: 14px;
  stroke: var(--text-3);
  fill: none;
  stroke-width: 1.5;
}

.table-search input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--text);
  outline: none;
  width: 180px;
}

.table-search input::placeholder { color: var(--text-3); }

.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th {
  padding: 0.75rem 1.25rem;
  text-align: left;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s, background 0.2s;
}
.data-table th.sortable:hover {
  color: var(--text);
  background: var(--gold-light);
}
.data-table th.sortable span {
  margin-left: 0.4rem;
  opacity: 0.4;
  color: var(--gold);
  font-size: 0.7rem;
  transition: opacity 0.2s;
}
.data-table th.sortable:hover span { opacity: 1; }

.data-table td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover td { background: var(--surface-2); }

.data-table input[type="checkbox"] {
  width: 15px; height: 15px;
  cursor: pointer;
  accent-color: var(--gold);
}

/* Product thumbnail in table */
.product-thumb {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.product-thumb-img {
  width: 42px; height: 52px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--grey-100);
  flex-shrink: 0;
}

.product-thumb-info strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-thumb-info span {
  font-size: 0.72rem;
  color: var(--text-3);
}

/* Action buttons in table */
.action-btns {
  display: flex;
  gap: 0.4rem;
}

.action-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  color: var(--text-3);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-family: inherit;
}

.action-btn svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.action-btn:hover { background: var(--gold-light); color: var(--gold); border-color: var(--gold); }
.action-btn.danger:hover { background: rgba(231,76,60,0.08); color: #e74c3c; border-color: #e74c3c; }

/* ============================================
   PAGINATION
   ============================================ */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.page-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-2);
  font-family: inherit;
  transition: all 0.2s;
}

.page-btn:hover { background: var(--gold-light); border-color: var(--gold); color: var(--gold); }
.page-btn.active { background: var(--gold); border-color: var(--gold); color: #fff; }

/* ============================================
   ANALYTICS PAGE
   ============================================ */
.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.analytics-kpi {
  padding: 1.5rem;
}

.ak-label {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 0.5rem;
}

.ak-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.ak-change { font-size: 0.75rem; font-weight: 500; }
.ak-change.up { color: #27ae60; }
.ak-change.down { color: #e74c3c; }

/* ============================================
   COLLECTIONS ADMIN
   ============================================ */
.collections-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.collection-admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.collection-admin-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.ca-img {
  height: 200px;
  background-size: cover;
  background-position: center;
}

.ca-body {
  padding: 1.25rem;
}

.ca-body h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.ca-body p { font-size: 0.78rem; color: var(--text-3); margin-bottom: 1rem; }

.ca-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ca-count {
  font-size: 0.72rem;
  color: var(--text-3);
}

/* ============================================
   SETTINGS
   ============================================ */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
}

.settings-card { padding: var(--sp-6); }

.settings-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.form-group { margin-bottom: var(--sp-5); }

.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: var(--sp-2);
}

.form-input {
  width: 100%;
  padding: 0.7rem 0.95rem;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.12);
}

textarea.form-input { resize: vertical; min-height: 80px; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) 0;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-2);
}

.toggle-row:last-of-type { border-bottom: none; }

.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }

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

.toggle span {
  position: absolute;
  inset: 0;
  background: var(--grey-200);
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle span::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle input:checked + span { background: var(--gold); }
.toggle input:checked + span::before { transform: translateX(20px); }

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: var(--gold);
  color: #0d0d0d;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}

.btn-primary:hover { background: #b8954f; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-primary svg {
  width: 15px; height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.btn-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}

.btn-text:hover { opacity: 0.75; }

.btn-ghost-dark {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.25rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}

.btn-ghost-dark:hover { background: var(--surface-2); color: var(--text); }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  backdrop-filter: blur(3px);
  padding: 1.5rem;
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px);
  transition: transform 0.3s var(--ease-out);
}

.modal-overlay.open .modal { transform: translateY(0); }

.wide-modal { max-width: 780px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-header h2 {
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--grey-100);
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  font-family: inherit;
}

.modal-close:hover { background: var(--grey-200); transform: rotate(90deg); }

.modal-body { padding: 2rem; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* Modal form grid */
.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.modal-form-grid .full { grid-column: 1 / -1; }

/* Size checkboxes */
.size-checkboxes {
  display: flex;
  gap: 0.5rem;
}

.size-check input { display: none; }

.size-check span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-2);
}

.size-check input:checked + span {
  background: var(--gold);
  border-color: var(--gold);
  color: #0d0d0d;
}

/* Image picker */
.size-checkboxes { flex-wrap: wrap; }

.img-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.img-picker {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.2s;
}
.img-picker.has-image { border-style: solid; border-color: var(--gold); }
.img-picker-preview {
  aspect-ratio: 1;
  background: var(--surface);
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 0.7rem;
  text-align: center;
  line-height: 1.3;
  overflow: hidden;
  position: relative;
}
.img-picker-placeholder {
  font-size: 0.75rem;
  font-weight: 500;
}
.img-picker-placeholder br + * { display: block; font-size: 1.25rem; font-weight: 300; margin-top: 0.25rem; }
.img-picker-controls {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.img-picker-upload {
  flex: 1;
  text-align: center;
  padding: 0.4rem 0.25rem;
  background: var(--text);
  color: var(--surface);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: opacity 0.2s;
}
.img-picker-upload:hover { opacity: 0.85; }
.img-picker-upload input[type=file] { display: none; }
.img-picker-url {
  padding: 0.4rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: all 0.2s;
}
.img-picker-url:hover { background: var(--surface-2); color: var(--text); }
.img-picker-remove {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-3);
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.img-picker.has-image .img-picker-remove { display: flex; }
.img-picker-remove:hover { color: #c0392b; border-color: #c0392b; }

@media (max-width: 768px) {
  .img-picker-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   CONTENT EDITOR PAGE
   ============================================ */
.content-editor {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  max-width: 920px;
}
.content-section { padding: var(--sp-6); }
.content-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.content-hint {
  font-size: 0.74rem;
  color: var(--text-3);
  font-weight: 400;
  line-height: 1.5;
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.content-save { margin-top: 0.5rem; }

/* Repeatable item cards (slides, collections, lookbook, features) */
.content-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  position: relative;
}
.content-item-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.content-item-remove:hover { color: #c0392b; border-color: #c0392b; }
.content-item-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 0.75rem;
}
.content-item .form-group { margin-bottom: 0.75rem; }
.content-item .form-group:last-child { margin-bottom: 0; }

/* Inline image picker (smaller, single slot) used inside content items */
.inline-img-picker {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 0.5rem;
}
.inline-img-thumb {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  background: var(--surface-2);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.inline-img-controls {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.inline-img-controls label,
.inline-img-controls button {
  padding: 0.35rem 0.65rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all 0.2s;
}
.inline-img-controls label { background: var(--text); color: var(--surface); border-color: var(--text); }
.inline-img-controls input[type=file] { display: none; }
.inline-img-controls button:hover { background: var(--surface-2); color: var(--text); }

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

/* ============================================
   PRODUCT MODAL v2 — Tabbed layout
   ============================================ */
.product-modal-v2 {
  max-width: 860px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.product-modal-v2 .modal-header {
  align-items: flex-start;
  padding: 1.5rem 2rem 1.25rem;
}
.product-modal-v2 .modal-subtitle {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-3);
  font-weight: 400;
}

/* Tabs row */
.pm-tabs {
  display: flex;
  gap: 0;
  padding: 0 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.pm-tabs::-webkit-scrollbar { display: none; }
.pm-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-3);
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
  margin-bottom: -1px;
}
.pm-tab svg { flex-shrink: 0; }
.pm-tab:hover { color: var(--text-2); }
.pm-tab.active {
  color: var(--text);
  border-bottom-color: var(--gold);
}

/* Body + panels */
.pm-body {
  padding: 1.75rem 2rem 1.25rem;
  flex: 1;
  overflow-y: auto;
  max-height: calc(90vh - 180px);
}
.pm-panel { display: none; }
.pm-panel.active { display: block; animation: pm-fade 0.25s ease; }
@keyframes pm-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pm-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.pm-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.pm-section-head { margin-bottom: 1rem; }
.pm-section-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.pm-section-hint {
  font-size: 0.72rem;
  color: var(--text-3);
  line-height: 1.5;
}
.pm-section-hint code {
  background: var(--surface-2);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.7rem;
  color: var(--text-2);
  font-family: 'SF Mono', Consolas, monospace;
}

.pm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}
.pm-grid .full { grid-column: 1 / -1; }
.pm-grid .form-group { margin-bottom: 0; }

.pm-helper {
  display: inline-block;
  margin-left: 0.4rem;
  font-weight: 400;
  font-size: 0.68rem;
  color: var(--text-3);
  letter-spacing: 0;
  text-transform: none;
}

.req { color: #c0392b; font-weight: 600; }

.pm-images { gap: 1rem; }

/* Footer */
.pm-footer {
  justify-content: space-between;
  align-items: center;
}
.pm-footer-steps {
  display: flex;
  gap: 0.5rem;
}
.pm-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, transform 0.2s;
}
.pm-step-dot.active {
  background: var(--gold);
  transform: scale(1.2);
}
.pm-step-dot.done {
  background: var(--text);
}
.pm-footer-actions {
  display: flex;
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .product-modal-v2 { max-width: 100%; }
  .pm-tabs { padding: 0 1rem; }
  .pm-tab { padding: 0.75rem 0.85rem; font-size: 0.72rem; }
  .pm-tab span { display: none; }
  .pm-body { padding: 1.25rem 1rem; }
  .pm-grid { grid-template-columns: 1fr; }
  .pm-footer { flex-direction: column-reverse; gap: 0.75rem; align-items: stretch; }
  .pm-footer-steps { justify-content: center; }
  .pm-footer-actions { justify-content: space-between; }
}

/* ============================================
   ORDER DETAIL MODAL
   ============================================ */
.order-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.od-section { margin-bottom: 1.5rem; }

.od-section h4 {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.875rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.od-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.83rem;
  color: var(--text-2);
}

.od-item strong { color: var(--text); }
.od-item:last-child { border-top: 1px solid var(--border); margin-top: 0.5rem; font-weight: 600; color: var(--text); }

.od-products-list { margin-bottom: 1.5rem; }

.od-product {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.od-product-img {
  width: 48px; height: 60px;
  border-radius: 6px;
  background: var(--grey-100);
  flex-shrink: 0;
}

.od-product-info strong {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
}

.od-product-info span {
  font-size: 0.75rem;
  color: var(--text-3);
}

.od-product-price {
  margin-left: auto;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Status update in modal */
.status-update-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.status-update-row label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

/* ============================================
   TOAST
   ============================================ */
.admin-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  background: var(--sb-bg);
  color: var(--sb-text-active);
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(calc(100% + 1.5rem));
  transition: transform 0.4s var(--ease-out);
  border-left: 3px solid var(--gold);
  max-width: 320px;
  pointer-events: none;
}

.admin-toast.show { transform: translateY(0); }

/* ============================================
   NOTIFICATION PANEL
   ============================================ */
.notif-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 0.5rem);
  right: 1.5rem;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 600;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}

.notif-panel.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.notif-panel-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.notif-mark-all {
  background: none;
  border: none;
  font-size: 0.72rem;
  color: var(--gold);
  cursor: pointer;
  font-weight: 500;
  padding: 0;
}

.notif-mark-all:hover { text-decoration: underline; }

.notif-list { max-height: 380px; overflow-y: auto; }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: rgba(201,169,110,0.04); }

.notif-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.notif-icon svg { width: 16px; height: 16px; fill: none; stroke-width: 1.8; }
.notif-icon.order { background: rgba(123,155,161,0.12); }
.notif-icon.order svg { stroke: #7b9ba1; }
.notif-icon.stock { background: rgba(230,123,106,0.12); }
.notif-icon.stock svg { stroke: #e07b6a; }
.notif-icon.user { background: rgba(155,123,181,0.12); }
.notif-icon.user svg { stroke: #9b7bb5; }

.notif-content { flex: 1; min-width: 0; }
.notif-content strong { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text); margin-bottom: 0.15rem; }
.notif-content span { font-size: 0.72rem; color: var(--text-3); display: block; }
.notif-dot-badge { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-top: 4px; flex-shrink: 0; }
.notif-item:not(.unread) .notif-dot-badge { opacity: 0; }

/* ============================================
   CUSTOMER DETAIL MODAL
   ============================================ */
.customer-profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.customer-avatar-lg {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700; color: #0d0d0d;
  flex-shrink: 0;
}

.customer-profile-info h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.customer-profile-info span { font-size: 0.8rem; color: var(--text-2); }

.customer-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.customer-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.customer-stat .cs-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'Cormorant Garamond', serif;
  display: block;
  margin-bottom: 0.25rem;
}

.customer-stat .cs-label {
  font-size: 0.7rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.customer-orders-table { width: 100%; }
.customer-orders-table th, .customer-orders-table td {
  padding: 0.6rem 0.5rem;
  font-size: 0.78rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.customer-orders-table th { color: var(--text-3); font-weight: 500; }

/* ============================================
   SIDEBAR TOGGLE (mobile)
   ============================================ */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  width: 40px; height: 40px;
  background: var(--sb-bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle svg {
  width: 20px; height: 20px;
  stroke: white;
  fill: none;
  stroke-width: 1.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
  .bottom-row { grid-template-columns: 1fr; }
  .small-chart { max-width: 100%; }
  .settings-grid { grid-template-columns: 1fr; }
  .analytics-kpis { grid-template-columns: repeat(2, 1fr); }
  .collections-admin-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); width: 260px; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .topbar { padding: 0 1.25rem 0 4rem; }
  .search-box { display: none; }
  .page { padding: 1.25rem; }
  .modal-form-grid { grid-template-columns: 1fr; }
  .order-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .analytics-kpis { grid-template-columns: 1fr; }
  .collections-admin-grid { grid-template-columns: 1fr; }
  .page-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-filters { flex-wrap: wrap; }
}

/* ============================================
   ADMIN POLISH PASS
   ============================================ */

/* Global focus ring for admin */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Form inputs — consistent focus state */
.form-input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.2);
}

/* Primary buttons — consistent min height and hover lift */
.btn-primary {
  min-height: 42px;
  font-weight: 600;
  letter-spacing: 0.06em;
  transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -10px rgba(0,0,0,0.25);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost-dark {
  min-height: 42px;
  font-weight: 600;
  transition: background 0.25s, border-color 0.2s, transform 0.2s;
}
.btn-ghost-dark:hover {
  transform: translateY(-1px);
}

/* Period toggle buttons (6M / 1Y / All) */
.period-btn {
  padding: 0.45rem 0.85rem;
  min-height: 32px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.period-btn:hover:not(.active) { color: var(--text); }

/* Table action buttons */
.table-action {
  min-width: 32px;
  min-height: 32px;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.table-action:hover { transform: scale(1.1); }

/* Modal save button consistency */
#product-modal .modal-footer .btn-primary,
#product-modal .modal-footer .btn-ghost-dark {
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  font-size: 0.78rem;
}

/* KPI card hover */
.kpi-card,
.card {
  transition: transform 0.25s, box-shadow 0.25s;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -12px rgba(0,0,0,0.12);
}

/* Nav items tighter hover */
.nav-item {
  transition: background 0.2s, color 0.2s, padding-left 0.2s;
}
.nav-item:hover:not(.active) {
  padding-left: calc(1.5rem + 4px);
}

/* Toggle row — larger tap target */
.toggle-row {
  padding: 0.65rem 0;
  min-height: 44px;
}
.toggle {
  cursor: pointer;
}

/* Content editor — consistent spacing on save buttons */
.content-save {
  min-height: 44px;
  margin-top: 1rem;
}

/* Image picker hover state */
.img-picker:hover:not(.has-image) {
  border-color: var(--gold);
  background: var(--gold-light);
}

/* Search inputs — better focus */
.table-search input:focus {
  outline: none;
  border-bottom-color: var(--gold);
  color: var(--text);
}

/* Modal close hover — reduced rotation */
.modal-close:hover {
  transform: rotate(90deg) scale(1.1);
}

/* Scrollbar styling for admin */
.pm-body::-webkit-scrollbar,
.modal-body::-webkit-scrollbar { width: 6px; }
.pm-body::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track { background: transparent; }
.pm-body::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }
.pm-body::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.35); }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile admin tap targets */
@media (max-width: 768px) {
  .btn-primary,
  .btn-ghost-dark {
    min-height: 44px;
    padding: 0.75rem 1.25rem;
  }
  .data-table td,
  .data-table th {
    padding: 0.75rem 0.875rem;
    font-size: 0.78rem;
  }
  .nav-item {
    min-height: 44px;
  }
}
