/* ============================================================
   ORION PHARMA — PRODUCT DASHBOARD STYLES
   Premium Dark Glassmorphism Design System
   ============================================================ */

/* ---- Variables ---- */
:root {
  --bg:           #F1F5F9;
  --bg-surface:   #E2E8F0;
  --bg-card:      rgba(255, 255, 255, 0.72);
  --bg-input:     #ffffff;
  --border:       rgba(15, 23, 42, 0.07);
  --border-hover: rgba(15, 23, 42, 0.14);

  --primary:      #5A0874;
  --primary-dim:  rgba(90, 8, 116, 0.07);
  --primary-glow: rgba(90, 8, 116, 0.2);
  --accent:       #DD0566;
  --accent-soft:  #DD0566;

  --success:      #10b981;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --danger-dim:   rgba(239, 68, 68, 0.08);

  --text:         #0F172A;
  --text-muted:   #475569;
  --text-subtle:  #64748b;

  --sidebar-w:    260px;
  --topbar-h:     72px;
  --radius:       12px;
  --radius-lg:    20px;
  --radius-xl:    28px;

  --transition:   0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow:       0 4px 20px rgba(15, 23, 42, 0.05);
  --shadow-lg:    0 10px 30px rgba(15, 23, 42, 0.09);
  --blur:         24px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Global background blobs */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 700px 500px at 10% 20%, rgba(90, 8, 116, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 600px 400px at 90% 80%, rgba(221, 5, 102, 0.05) 0%, transparent 70%);
  z-index: 0;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent-soft));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px var(--primary-glow);
  flex-shrink: 0;
}
.logo-mark .material-symbols-outlined { font-size: 22px; color: #fff; }

.logo-text { display: flex; flex-direction: column; }
.brand { font-weight: 700; font-size: 15px; color: var(--text); letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--text-muted); letter-spacing: 0.03em; }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}
.nav-item:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text);
}
.nav-item.active {
  background: var(--primary-dim);
  color: var(--primary);
  box-shadow: 0 0 0 1px rgba(90,8,116,0.15);
}
.nav-item .material-symbols-outlined { font-size: 20px; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.mobile-menu-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text); padding: 6px;
}

.page-title h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.page-title p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  transition: all var(--transition);
}
.search-box:focus-within {
  border-color: rgba(90,8,116,0.5);
  background: rgba(90,8,116,0.04);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.search-box .material-symbols-outlined { font-size: 18px; color: var(--text-muted); }
.search-box input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 14px; font-family: inherit;
  width: 220px;
}
.search-box input::placeholder { color: var(--text-subtle); }

/* ============================================================
   BUTTONS
   ============================================================ */
button, .btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  padding: 9px 18px;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--primary-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(15,23,42,0.04);
  color: var(--text);
  padding: 9px 18px;
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(15,23,42,0.08);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: none;
  color: var(--text-muted);
  padding: 9px 14px;
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); background: rgba(15,23,42,0.04); }

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  padding: 9px 18px;
  border: 1px solid rgba(239,68,68,0.15);
}
.btn-danger:hover { background: rgba(239,68,68,0.12); }

.btn-icon {
  background: rgba(15,23,42,0.03);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px;
  border-radius: 8px;
}
.btn-icon:hover { color: var(--text); background: rgba(15,23,42,0.08); }
.btn-icon .material-symbols-outlined { font-size: 18px; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: 28px;
  flex: 1;
}
.section.hidden { display: none; }
.section.active { display: block; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}
.pill:hover { background: rgba(15, 23, 42, 0.06); color: var(--text); }
.pill.active {
  background: var(--primary-dim);
  border-color: rgba(90, 8, 116, 0.3);
  color: var(--primary);
}

.view-toggle { display: flex; gap: 4px; }
.view-btn {
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}
.view-btn:hover { color: var(--text); background: rgba(15, 23, 42, 0.06); }
.view-btn.active { background: var(--primary-dim); border-color: rgba(90, 8, 116, 0.3); color: var(--primary); }
.view-btn .material-symbols-outlined { font-size: 18px; display: block; }

.results-bar {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ============================================================
   PRODUCT CARDS — GRID VIEW
   ============================================================ */
.product-container.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}
.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(90,8,116,0.12));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(90,8,116,0.2);
  box-shadow: 0 10px 24px rgba(15,23,42,0.06), 0 0 0 1px rgba(90,8,116,0.1);
}

.card-image {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: rgba(15,23,42,0.02);
  position: relative;
}
.card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover .card-image img { transform: scale(1.05); }

.card-image-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px;
  background: linear-gradient(135deg, rgba(90,8,116,0.05), rgba(221,5,102,0.02));
}
.card-image-placeholder .material-symbols-outlined {
  font-size: 48px;
  color: var(--primary);
  opacity: 0.5;
}
.card-image-placeholder span:last-child {
  font-size: 11px; color: var(--text-subtle); letter-spacing: 0.08em; text-transform: uppercase;
}

.card-badge {
  position: absolute;
  top: 10px; left: 10px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}

.card-actions-overlay {
  position: absolute;
  top: 10px; right: 10px;
  display: flex; gap: 6px;
  opacity: 0;
  transition: opacity var(--transition);
}
.product-card:hover .card-actions-overlay { opacity: 1; }

.card-body {
  padding: 16px;
}
.card-category {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 5px;
}
.card-name {
  font-size: 15px; font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 6px;
}
.card-composition {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2; /* standard unprefixed property for forward compatibility */
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.card-admin {
  font-size: 11px;
  color: var(--text-subtle);
  display: flex; align-items: center; gap: 4px;
}
.card-admin .material-symbols-outlined { font-size: 14px; }

/* ============================================================
   PRODUCT LIST VIEW
   ============================================================ */
.product-container.list-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-row {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 64px 1fr 180px 100px;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  transition: all var(--transition);
  cursor: pointer;
}
.product-row:hover {
  border-color: rgba(90,8,116,0.25);
  background: rgba(255, 255, 255, 0.95);
}

.row-img {
  width: 56px; height: 42px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
}
.row-img img { width: 100%; height: 100%; object-fit: cover; }
.row-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-dim);
}
.row-img-placeholder .material-symbols-outlined { font-size: 20px; color: var(--accent); }

.row-name { font-weight: 600; font-size: 14px; color: var(--text); }
.row-composition { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.row-category { font-size: 12px; color: var(--text-muted); }
.row-admin { font-size: 12px; color: var(--text-subtle); }

.row-actions {
  display: flex; gap: 6px;
  justify-content: flex-end;
}

/* Category badge colors */
.cat-fertility  { background: rgba(16,185,129,0.12); color: #047857; }
.cat-hormonal   { background: rgba(245,158,11,0.12); color: #b45309; }
.cat-hcg        { background: rgba(59,130,246,0.12); color: #1d4ed8; }
.cat-anticoagulant { background: rgba(239,68,68,0.12); color: #b91c1c; }
.cat-oncology   { background: rgba(147,51,234,0.12); color: #701a75; }
.cat-specialty  { background: rgba(20,184,166,0.12); color: #0f766e; }

/* Verification badge */
.badge-verified   { background: rgba(16,185,129,0.1); color: #047857; border: 1px solid rgba(16,185,129,0.25); }
.badge-pending    { background: rgba(245,158,11,0.1); color: #b45309; border: 1px solid rgba(245,158,11,0.25); }
.badge-unverified { background: rgba(239,68,68,0.1); color: #b91c1c; border: 1px solid rgba(239,68,68,0.25); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state .material-symbols-outlined { font-size: 64px; color: var(--text-subtle); margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; }

/* ============================================================
   FORM STYLES
   ============================================================ */
.form-wrapper {
  max-width: 860px;
  margin: 0 auto;
}

.form-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px 32px 24px;
  border-bottom: 1px solid var(--border);
}
.form-header h2 { font-size: 22px; font-weight: 700; color: var(--text); }
.form-header p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.form-section {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
}
.form-section:last-of-type { border-bottom: none; }

.form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.form-section-title .material-symbols-outlined { font-size: 16px; }

.form-grid { display: grid; gap: 16px; }
.form-grid.two-col { grid-template-columns: 1fr 1fr; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.req { color: var(--danger); }

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all var(--transition);
  width: 100%;
}
.form-group select option { background: #ffffff; color: var(--text); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: rgba(90,8,116,0.6);
  background: rgba(90,8,116,0.04);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-subtle); }

.field-hint { font-size: 11px; color: var(--text-subtle); }

.char-count { font-size: 11px; color: var(--text-subtle); text-align: right; }

/* Image upload */
.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.image-upload-area:hover {
  border-color: rgba(90,8,116,0.5);
  background: var(--primary-dim);
}
.upload-icon { font-size: 40px; color: var(--text-subtle); margin-bottom: 12px; display: block; }
.upload-label { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.upload-hint { font-size: 12px; color: var(--text-muted); }

#image-preview {
  max-height: 200px;
  max-width: 100%;
  border-radius: var(--radius);
  object-fit: contain;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 32px 24px;
  border-top: 1px solid var(--border);
}

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

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 0% 100%, color-mix(in srgb, var(--accent) 8%, transparent), transparent);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon .material-symbols-outlined { font-size: 24px; color: var(--accent); }

.stat-number { font-size: 30px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.chart-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.chart-card h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 20px; }

.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-item { display: flex; align-items: center; gap: 12px; }
.bar-label { font-size: 12px; color: var(--text-muted); width: 90px; flex-shrink: 0; }
.bar-track {
  flex: 1;
  height: 8px;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 100px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.bar-count { font-size: 12px; font-weight: 600; color: var(--text-muted); width: 30px; text-align: right; }

.activity-list { display: flex; flex-direction: column; gap: 12px; }
.activity-empty { text-align: center; color: var(--text-subtle); font-size: 13px; padding: 20px; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--border);
}
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 6px; flex-shrink: 0;
}
.activity-text { font-size: 13px; color: var(--text); }
.activity-time { font-size: 11px; color: var(--text-subtle); margin-top: 2px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-container {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 740px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  padding: 6px;
  cursor: pointer;
  transition: all var(--transition);
  z-index: 10;
  font-family: 'Inter', sans-serif;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.1); }
.modal-close .material-symbols-outlined { font-size: 18px; display: block; }

.modal-body { padding: 28px; }

.modal-product-header {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  align-items: flex-start;
}
.modal-product-image {
  width: 160px;
  height: 120px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}
.modal-product-image img { width: 100%; height: 100%; object-fit: cover; }
.modal-product-image-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-dim);
}
.modal-product-image-placeholder .material-symbols-outlined { font-size: 40px; color: var(--accent); }

.modal-product-meta { flex: 1; }
.modal-product-category {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-soft); margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.modal-product-name {
  font-size: 22px; font-weight: 800;
  color: var(--text); line-height: 1.2;
  margin-bottom: 8px;
}
.modal-product-composition {
  font-size: 14px; color: var(--text-muted);
  margin-bottom: 12px;
}
.modal-product-desc {
  font-size: 13px; color: var(--text-subtle);
  line-height: 1.7;
}

.modal-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
.spec-item {
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.spec-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-subtle); margin-bottom: 4px;
}
.spec-value { font-size: 13px; font-weight: 500; color: var(--text); }

.modal-seo {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.modal-seo h4 {
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent-soft); margin-bottom: 12px;
}
.seo-item { margin-bottom: 10px; }
.seo-label { font-size: 11px; color: var(--text-subtle); margin-bottom: 3px; }
.seo-value { font-size: 13px; color: var(--text-muted); word-break: break-all; }

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 16px 28px 24px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  min-width: 280px;
  max-width: 380px;
}
.toast.success  { border-left: 3px solid var(--success); }
.toast.danger   { border-left: 3px solid var(--danger); }
.toast.warning  { border-left: 3px solid var(--warning); }
.toast.info     { border-left: 3px solid var(--primary); }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}
.toast.hiding { animation: toastOut 0.3s ease forwards; }

/* ============================================================
   CONFIRM DIALOG
   ============================================================ */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
  z-index: 400;
  display: flex; align-items: center; justify-content: center;
}
.confirm-overlay.hidden { display: none; }

.confirm-box {
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}
.confirm-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--danger-dim);
  border: 1px solid rgba(239,68,68,0.3);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.confirm-icon .material-symbols-outlined { font-size: 28px; color: var(--danger); }
.confirm-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.confirm-box p { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* ============================================================
   UTILITY
   ============================================================ */
.hidden { display: none !important; }
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.3); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .charts-row { grid-template-columns: 1fr; }
  .product-container.grid-view { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .product-row {
    grid-template-columns: 56px 1fr 120px 100px;
  }
  .product-row .row-admin,
  .product-row .row-verification { display: none; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: flex; }
  .form-grid.two-col { grid-template-columns: 1fr; }
  .modal-specs { grid-template-columns: 1fr; }
  .modal-product-header { flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 16px; }
  .form-section { padding: 16px 20px; }
  .form-header, .form-actions { padding: 16px 20px; }

  /* Responsive button styles - hide text labels */
  .btn-text { display: none; }
  .topbar-right .btn-primary,
  .topbar-right .btn-secondary {
    padding: 8px 10px;
    border-radius: 8px;
    min-height: 38px;
  }

  /* Two-row layout for topbar on mobile */
  .topbar {
    height: auto !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 12px 16px !important;
    gap: 10px !important;
  }
  .topbar-left {
    width: 100% !important;
    justify-content: flex-start !important;
    gap: 12px !important;
  }
  .topbar-right {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr auto auto !important;
    gap: 8px !important;
    align-items: center !important;
  }
  .search-box {
    width: 100% !important;
    padding: 6px 12px !important;
  }
  .search-box input {
    width: 100% !important;
  }
  .page-title p {
    display: none !important;
  }
  .page-title h1 {
    font-size: 18px !important;
  }
}

@media (max-width: 580px) {
  .product-row {
    grid-template-columns: 48px 1fr auto;
    gap: 10px;
    padding: 10px 12px;
  }
  .product-row .row-category { display: none; }
  .product-row .row-actions { margin-left: auto; }
}

@media (max-width: 480px) {
  .filter-pills { gap: 4px; }
  .pill { padding: 5px 10px; font-size: 12px; }
  .stats-grid { grid-template-columns: 1fr; }
  
  /* Compact cards for grid view */
  .product-container.grid-view { grid-template-columns: 1fr 1fr; gap: 10px; }
  .product-card { border-radius: 12px; }
  .card-body { padding: 10px; }
  .card-name { font-size: 13px; margin-bottom: 4px; }
  .card-composition { font-size: 11px; margin-bottom: 8px; }
  .card-category { font-size: 9px; margin-bottom: 2px; }

  /* Compact modals */
  .modal-overlay { padding: 10px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px 16px; }
  .modal-product-header { gap: 12px; }
  .modal-product-image { width: 100%; height: 180px; }
}

/* ============================================================
   MULTI IMAGE GALLERY UPLOADER & DRAG-AND-DROP
   ============================================================ */
.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.gallery-item {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 4/3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  transition: transform var(--transition), border-color var(--transition), opacity var(--transition);
}

.gallery-item:active {
  cursor: grabbing;
}

.gallery-item.dragging {
  opacity: 0.4;
  border: 2px dashed var(--primary);
  transform: scale(0.95);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.gallery-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 6px rgba(90,8,116,0.4);
  z-index: 5;
}

.gallery-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 5;
}
.gallery-item:hover .gallery-delete-btn {
  opacity: 1;
}
.gallery-delete-btn:hover {
  transform: scale(1.1);
  background: rgb(239, 68, 68);
}
.gallery-delete-btn .material-symbols-outlined {
  font-size: 14px;
}

.gallery-drag-indicator {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity var(--transition);
  z-index: 4;
}
.gallery-item:hover .gallery-drag-indicator {
  opacity: 0.9;
}
.gallery-drag-indicator .material-symbols-outlined {
  font-size: 14px;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrapper {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.login-wrapper.hidden {
  display: none !important;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(90, 8, 116, 0.4), transparent);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-mark {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.login-logo-mark .material-symbols-outlined {
  font-size: 26px;
  color: #fff;
}

.login-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.login-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-error-msg {
  background: var(--danger-dim);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  margin-top: 10px;
  text-align: center;
}

/* Fix sidebar alignment with flex layout */
#dashboard-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

#dashboard-wrapper.hidden {
  display: none !important;
}

/* Ensure nav-logout aligns at the bottom of the sidebar navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  height: calc(100% - 100px);
}
