/* ============================================================
   Shoe Analytics — Main Stylesheet
   ============================================================ */

/* ─── Variables ─────────────────────────────────────────── */
:root {
  --sidebar-bg:      #0f172a;
  --sidebar-hover:   #1e293b;
  --sidebar-active:  #1d4ed8;
  --sidebar-text:    #94a3b8;
  --sidebar-text-active: #f8fafc;
  --sidebar-width:   256px;

  --primary:         #3b82f6;
  --primary-dark:    #1d4ed8;
  --primary-light:   #eff6ff;
  --success:         #10b981;
  --success-light:   #ecfdf5;
  --warning:         #f59e0b;
  --warning-light:   #fffbeb;
  --danger:          #ef4444;
  --danger-light:    #fef2f2;
  --info:            #06b6d4;
  --info-light:      #ecfeff;
  --purple:          #8b5cf6;
  --purple-light:    #f5f3ff;

  --bg:              #f1f5f9;
  --card:            #ffffff;
  --border:          #e2e8f0;
  --text:            #0f172a;
  --text-muted:      #64748b;
  --text-faint:      #94a3b8;

  --radius-sm:  6px;
  --radius:     12px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
  --shadow:     0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);

  --topbar-h:   64px;
  --font:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ─────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  min-width: 0;
  transition: margin-left .3s ease;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width .3s ease;
  overflow: hidden;
}

.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .logo-name,
.sidebar.collapsed .logo-version,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .nav-badge { display: none; }
.sidebar.collapsed .sidebar-logo { justify-content: center; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0.75rem; }

/* Logo */
.sidebar-header {
  padding: 0 1.25rem;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

.logo-name {
  font-size: .95rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
}

.logo-version {
  font-size: .7rem;
  color: var(--sidebar-text);
  margin-top: 1px;
}

.sidebar-logo-text { min-width: 0; }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.nav-group { padding: 0 .75rem .5rem; }

.nav-group-label {
  display: block;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--sidebar-text);
  padding: .5rem .5rem .25rem;
  margin-bottom: .25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-weight: 500;
  font-size: .875rem;
  transition: all .18s ease;
  position: relative;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
  text-decoration: none;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
}

.nav-item.active .nav-icon { color: #fff; opacity: 1; }

.nav-icon { flex-shrink: 0; opacity: .75; }
.nav-label { flex: 1; }

.nav-badge {
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem .75rem;
  border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem;
  border-radius: var(--radius-sm);
}

.sidebar-user-info { min-width: 0; }

.sidebar-username {
  display: block;
  font-weight: 600;
  font-size: .825rem;
  color: #f8fafc;
  truncate: true;
}

.sidebar-role {
  font-size: .7rem;
  color: var(--sidebar-text);
}

/* ─── Top Bar ─────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-left { display: flex; align-items: center; gap: .75rem; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }

.sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: .35rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: color .15s;
}
.sidebar-toggle:hover { color: var(--text); background: var(--border); }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .825rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); text-decoration: none; }
.breadcrumb span:last-child { color: var(--text); font-weight: 500; }

.topbar-badge {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: .3rem .75rem;
  border-radius: 99px;
  border: 1px solid var(--border);
}

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-yellow { background: var(--warning); animation: pulse-dot 2s infinite; }
.dot-green  { background: var(--success); }
.dot-red    { background: var(--danger); animation: pulse-dot 2s infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.user-avatar, .user-avatar-sm {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.user-avatar-sm { width: 30px; height: 30px; font-size: .6rem; }

.user-name { font-weight: 500; font-size: .85rem; }

.topbar-logout {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: .35rem;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
.topbar-logout:hover { color: var(--danger); background: var(--danger-light); text-decoration: none; }

/* ─── Content ────────────────────────────────────────────── */
.content {
  flex: 1;
  padding: 1.75rem 2rem;
}

.page-header { margin-bottom: 1.5rem; }

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card-subtitle { font-size: .78rem; color: var(--text-muted); }

.card-body { padding: 1.25rem; }
.card-body.p-0 { padding: 0; }

.card-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-info { background: var(--info-light); border-color: #a5f3fc; }
.card-dark { background: var(--sidebar-bg); border-color: var(--sidebar-bg); }
.card-dark .card-header { border-color: rgba(255,255,255,.1); }

/* ─── Stats Grid ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-blue   { background: var(--primary-light);  color: var(--primary); }
.stat-icon-green  { background: var(--success-light);  color: var(--success); }
.stat-icon-purple { background: var(--purple-light);   color: var(--purple); }
.stat-icon-red    { background: var(--danger-light);   color: var(--danger); }

.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: .75rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-value-red { color: var(--danger); }

/* ─── Charts Grid ────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1100px) { .charts-grid { grid-template-columns: 1fr; } }

.chart-card canvas { max-height: 300px; }

/* ─── Tables ─────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .825rem;
}

.table thead tr {
  background: #f8fafc;
  border-bottom: 2px solid var(--border);
}

.table th {
  padding: .65rem .9rem;
  text-align: left;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  white-space: nowrap;
  user-select: none;
}

.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }

.sort-arrow { opacity: .4; font-size: .65rem; margin-left: .25rem; }
.sort-arrow.active { opacity: 1; color: var(--primary); }

.table td {
  padding: .7rem .9rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.table tbody tr { transition: background .12s; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fafc; }

.table-row-link { cursor: pointer; }

.table-products th, .table-products td { padding: .45rem .6rem; }
.table-products td { vertical-align: top; }
.table-products td.size-cell { vertical-align: middle; }
.table-products td.text-center:not(.size-cell) { vertical-align: middle; }

/* Column group separators */
.table-products .col-sep-left { border-left: 2px solid #e2e8f0 !important; }

/* Zebra rows */
.table-products tbody tr:nth-child(even) { background: #fafbfc; }
.table-products tbody tr:hover { background: #eff6ff !important; }

/* ─── Heatmap Cells ──────────────────────────────────────── */
.size-col {
  min-width: 40px;
  max-width: 48px;
  padding: .4rem .3rem !important;
  text-align: center;
}

.size-cell {
  min-width: 40px;
  max-width: 48px;
  font-weight: 700;
  font-size: .8rem;
  text-align: center;
  transition: opacity .15s;
}

.heat-0 { background: #fee2e2 !important; color: #b91c1c !important; }
.heat-1 { background: #fed7aa !important; color: #9a3412 !important; }
.heat-2 { background: #fef08a !important; color: #854d0e !important; }
.heat-3 { background: #bbf7d0 !important; color: #166534 !important; }
.heat-4 { background: #22c55e !important; color: #14532d !important; }

/* ─── Product cell ───────────────────────────────────────── */
.prod-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .45rem;
  padding: .2rem 0;
}

.prod-cell img {
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.10);
}

.prod-meta {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .1rem 0;
}

.prod-meta .sku {
  font-size: .75rem;
  background: #f1f5f9;
  color: #475569;
  padding: .15rem .45rem;
  border-radius: 4px;
  font-family: monospace;
  letter-spacing: .03em;
}

.mt-1 { margin-top: .25rem; }

/* ─── Sales month columns ────────────────────────────────── */
.sales-col {
  min-width: 52px;
  font-size: .88rem;
  color: #64748b;
  text-align: center;
}

.sales-col span, .sales-col strong {
  display: inline-block;
  min-width: 28px;
  padding: .2rem .35rem;
  border-radius: 5px;
}

.sales-col span:not(:empty) { background: #f1f5f9; }

.sales-col-current {
  background: #eff6ff !important;
}

.sales-col-current strong {
  background: #3b82f6 !important;
  color: #fff !important;
  border-radius: 6px;
  padding: .2rem .5rem;
  font-size: .85rem;
}

thead .sales-col-current {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
}

/* Stock column emphasis */
.table-products td.text-center strong {
  font-size: .92rem;
  color: var(--text);
}

/* Heatmap Legend */
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.legend-label { font-size: .75rem; color: var(--text-muted); font-weight: 500; }

.heat-legend-item {
  padding: .2rem .6rem;
  border-radius: var(--radius-sm);
  font-size: .72rem;
  font-weight: 600;
}

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success  { background: var(--success-light);  color: #065f46; }
.badge-warning  { background: var(--warning-light);  color: #92400e; }
.badge-danger   { background: var(--danger-light);   color: #991b1b; }
.badge-info     { background: var(--info-light);     color: #155e75; }
.badge-category { background: var(--primary-light);  color: var(--primary-dark); }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .825rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s ease;
  white-space: nowrap;
  font-family: var(--font);
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--bg); color: var(--text); border-color: #cbd5e1; text-decoration: none; }

.btn-sm  { padding: .35rem .75rem; font-size: .78rem; }
.btn-lg  { padding: .75rem 1.5rem; font-size: .95rem; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Filters Bar ────────────────────────────────────────── */
.filters-card { padding: 1rem 1.25rem; }
.filters-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.filter-search { position: relative; flex: 1; min-width: 220px; }
.search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.filter-input, .filter-select {
  height: 38px;
  padding: 0 .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .825rem;
  color: var(--text);
  background: var(--card);
  font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.filter-input:focus, .filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.filter-input-search { padding-left: 2.25rem; width: 100%; }
.filter-select { cursor: pointer; }
.filter-select-sm { width: 110px; }

/* ─── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.pagination-pages { display: flex; gap: .25rem; }

.page-btn {
  min-width: 32px; height: 32px;
  padding: 0 .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: .78rem;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text-muted);
  transition: all .15s;
}
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:hover:not(.active) { background: var(--bg); border-color: #cbd5e1; color: var(--text); }

/* ─── Product Cell ───────────────────────────────────────── */
.product-cell { display: flex; align-items: center; gap: .75rem; }

.product-thumb {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.product-thumb-placeholder {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #4f46e5;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.product-thumb-placeholder-sm {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #4f46e5;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  flex-shrink: 0;
}

.product-name { display: block; font-weight: 600; font-size: .85rem; }
.product-brand { font-size: .72rem; }

.sku {
  background: #f1f5f9;
  color: var(--text-muted);
  padding: .1rem .4rem;
  border-radius: 4px;
  font-size: .72rem;
  font-family: 'Courier New', monospace;
}

/* ─── Rank Badges ────────────────────────────────────────── */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: .72rem;
  font-weight: 700;
  background: var(--border);
  color: var(--text-muted);
}
.rank-1 { background: #fef08a; color: #854d0e; }
.rank-2 { background: #e2e8f0; color: #475569; }
.rank-3 { background: #fed7aa; color: #9a3412; }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  border-left: 4px solid transparent;
}
.alert-success { background: var(--success-light); color: #065f46; border-left-color: var(--success); }
.alert-warning { background: var(--warning-light); color: #92400e; border-left-color: var(--warning); }
.alert-danger  { background: var(--danger-light);  color: #991b1b; border-left-color: var(--danger); }
.alert-info    { background: var(--info-light);    color: #155e75; border-left-color: var(--info); }
.alert-dot     { width: 10px; height: 10px; background: var(--danger); border-radius: 50%; display: inline-block; animation: pulse-dot 1.5s infinite; }

/* ─── Restock ────────────────────────────────────────────── */
.restock-recommendation {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
}

.restock-item {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  background: #dbeafe;
  border-radius: 4px;
  padding: .15rem .4rem;
  font-size: .7rem;
}

.restock-size { font-weight: 600; color: #1e40af; }
.restock-qty  { color: #1e40af; }
.restock-total { font-size: .72rem; font-weight: 700; color: var(--text); margin-left: .25rem; }

/* ─── Drawer ─────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 200;
  backdrop-filter: blur(2px);
}

.product-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 480px;
  background: var(--card);
  z-index: 201;
  box-shadow: -4px 0 30px rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.product-drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title { font-size: 1rem; font-weight: 600; }

.drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: .35rem;
  border-radius: var(--radius-sm);
  display: flex;
  transition: color .15s, background .15s;
}
.drawer-close:hover { color: var(--danger); background: var(--danger-light); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.drawer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem;
  color: var(--text-muted);
}

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Drawer product detail sections */
.drawer-product-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.drawer-product-img {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #4f46e5;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.drawer-product-img-photo {
  width: 72px; height: 72px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.product-thumb-sm {
  width: 32px; height: 32px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-product-info h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: .3rem; }
.drawer-product-info .meta { font-size: .78rem; color: var(--text-muted); display: flex; gap: .5rem; flex-wrap: wrap; }
.drawer-product-info .meta span { display: flex; align-items: center; gap: .25rem; }

.drawer-section { margin-bottom: 1.5rem; }
.drawer-section-title {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

/* Size stock heatmap in drawer */
.drawer-sizes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
}

.drawer-size-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.drawer-size-label { font-size: .7rem; font-weight: 600; color: var(--text-muted); }
.drawer-size-qty   { font-size: 1.1rem; font-weight: 700; }

/* Drawer stats row */
.drawer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.drawer-stat {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: .75rem;
  text-align: center;
}

.drawer-stat-label { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.drawer-stat-value { font-size: 1.25rem; font-weight: 700; color: var(--text); }

/* ─── Forms ──────────────────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }

.settings-form { display: flex; flex-direction: column; gap: 1rem; }

.form-group { display: flex; flex-direction: column; gap: .35rem; }

.form-label { font-size: .825rem; font-weight: 500; color: var(--text); }

.form-input {
  height: 40px;
  padding: 0 .875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .825rem;
  color: var(--text);
  background: var(--card);
  font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  width: 100%;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.form-hint { font-size: .72rem; color: var(--text-muted); }

.input-with-icon { position: relative; }
.input-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}
.form-input-icon { padding-left: 2.5rem; }

.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }

.font-mono { font-family: 'Courier New', monospace; }

/* Help steps */
.help-steps {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  font-size: .85rem;
  color: var(--text-muted);
}
.help-steps li { line-height: 1.5; }
.help-steps strong { color: var(--text); }
.help-steps code {
  background: #f1f5f9;
  padding: .1rem .4rem;
  border-radius: 4px;
  font-size: .78rem;
  font-family: monospace;
}

/* Info table */
.info-table { width: 100%; font-size: .82rem; }
.info-table td { padding: .4rem 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.info-table td:first-child { color: rgba(255,255,255,.5); width: 45%; }
.info-table td:last-child  { color: rgba(255,255,255,.9); font-weight: 500; }

/* ─── Empty State ────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
}
.empty-state h3 { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.empty-state p  { font-size: .875rem; }

/* ─── Login Page ─────────────────────────────────────────── */
.login-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-wrapper { width: 100%; max-width: 440px; }

.login-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-logo-text h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.login-logo-text p {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .1rem;
}

.login-form { display: flex; flex-direction: column; gap: 1rem; }

.login-alert { margin-bottom: .5rem; }

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .72rem;
  color: var(--text-faint);
}

/* ─── Action Suggestions ─────────────────────────────────── */
.action-suggestions { display: flex; gap: .35rem; }

/* ─── Utility ────────────────────────────────────────────── */
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.text-center  { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: .825rem; }
.text-xs      { font-size: .72rem; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-info    { color: var(--info); }
.text-primary { color: var(--primary); }
.font-bold    { font-weight: 700; }
.flex         { display: flex; }
.items-center { align-items: center; }
.gap-2        { gap: .5rem; }

/* ─── Sync Page ──────────────────────────────────────────────────────────── */
.sync-layout { max-width: 800px; }
.sync-card   { }

.sync-info-row {
  display: flex; gap: 2rem; margin-bottom: 1.5rem;
  padding: 1rem; background: var(--bg); border-radius: var(--radius-sm);
}
.sync-info-item  { display: flex; flex-direction: column; gap: .2rem; }
.sync-info-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.sync-info-value { font-size: .95rem; font-weight: 600; }

.sync-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.sync-hint    { }

.sync-log {
  margin-top: 1.5rem;
  background: #0f172a;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.sync-log-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .6rem 1rem;
  background: #1e293b;
  font-size: .78rem; font-weight: 600; color: #94a3b8;
}
.sync-log-lines {
  padding: .75rem 1rem;
  max-height: 280px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
}
.sync-log-line {
  font-size: .78rem; color: #94a3b8; line-height: 1.7;
}
.sync-log-line:last-child { color: #f8fafc; }
.sync-log-pre {
  font-size: .72rem; color: var(--text-muted);
  white-space: pre-wrap; word-break: break-all;
  padding: .5rem; background: #f8fafc;
  border-radius: 4px; margin-top: .5rem;
  max-height: 200px; overflow-y: auto;
}

/* Spinning animation for sync button */
.spin { animation: spin .8s linear infinite; display: inline-block; }
