:root {
  --bg-main: #0e1013;
  --bg-surface: #16181d;
  --bg-card: #1d2127;
  --bg-card-hover: #242931;
  --gold-primary: #e9ac76;
  --gold-light: #f3be8d;
  --gold-dark: #b87438;
  --gold-glow: rgba(233, 172, 118, 0.25);
  --text-main: #fdfbf7;
  --text-muted: #9ba1a6;
  --text-dim: #656b73;
  --line: #2d323b;
  --line-light: #3e4450;
  --danger: #e74c3c;
  --danger-bg: rgba(231, 76, 60, 0.15);
  --success: #2ecc71;
  --success-bg: rgba(46, 204, 113, 0.15);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, .serif {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--gold-primary);
  font-weight: 600;
}

/* Login Container */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 30%, rgba(233, 172, 118, 0.08) 0%, var(--bg-main) 70%);
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: fadeIn 0.4s ease-out;
}

.auth-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  display: block;
}

.auth-title {
  font-size: 32px;
  color: var(--text-main);
  margin-bottom: 6px;
}

.auth-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-main);
  font-family: 'Jost', sans-serif;
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Jost', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold-primary);
  color: #121417;
  box-shadow: 0 4px 14px var(--gold-glow);
}

.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--line-light);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 6px;
}

/* Navigation & Header */
.admin-navbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.navbar-brand img {
  width: 36px;
  height: 36px;
}

.navbar-brand span {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
}

.navbar-badge {
  background: rgba(233, 172, 118, 0.15);
  color: var(--gold-primary);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover {
  color: var(--gold-primary);
}

/* Admin Layout */
.admin-layout {
  display: flex;
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
  gap: 32px;
}

.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  text-align: left;
  width: 100%;
}

.sidebar-tab:hover {
  background: var(--bg-surface);
  color: var(--text-main);
}

.sidebar-tab.active {
  background: var(--bg-card);
  color: var(--gold-primary);
  border: 1px solid var(--line);
  font-weight: 600;
}

.sidebar-tab svg {
  width: 18px;
  height: 18px;
}

.admin-content {
  flex: 1;
  min-width: 0;
}

/* Stats / Dashboard Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-title {
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  color: var(--gold-light);
  font-family: 'Cormorant Garamond', serif;
}

/* Header Sections */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  font-size: 28px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Filter / Search Bar */
.filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
}

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

.category-select {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
}

/* Product Table & Cards */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.product-item {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}

.product-item:hover {
  border-color: var(--gold-primary);
  transform: translateY(-2px);
}

.product-item.inactive {
  opacity: 0.65;
}

.product-thumb {
  width: 100%;
  height: 200px;
  background: #191c22;
  position: relative;
  overflow: hidden;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-badge-photos {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 12px;
}

.product-details {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.product-cat {
  font-size: 11px;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.product-name {
  font-size: 20px;
  line-height: 1.2;
}

.product-price {
  font-size: 14px;
  color: var(--text-muted);
}

.product-swatches {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.product-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Status switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--line-light);
  transition: .3s;
  border-radius: 22px;
}

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

input:checked + .slider {
  background-color: var(--gold-primary);
}

input:checked + .slider:before {
  transform: translateX(18px);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: var(--shadow);
  position: relative;
}

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

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-main);
}

/* Upload dropzone & previews */
.dropzone {
  border: 2px dashed var(--line-light);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg-card);
  margin-bottom: 12px;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--gold-primary);
  background: rgba(233, 172, 118, 0.05);
}

.dropzone svg {
  width: 32px;
  height: 32px;
  color: var(--gold-primary);
  margin-bottom: 8px;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.img-preview-card {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
}

.img-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
}

/* Color Pills Selector */
.color-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  user-select: none;
  transition: all 0.2s;
}

.color-chip.active {
  border-color: var(--gold-primary);
  color: var(--text-main);
  background: rgba(233, 172, 118, 0.12);
}

.color-chip-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Category Table */
.category-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.category-table th, .category-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.category-table th {
  background: var(--bg-card);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-color: var(--success);
}

.toast.error {
  border-color: var(--danger);
}

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

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

@media (max-width: 860px) {
  .admin-layout {
    flex-direction: column;
    padding: 16px;
  }
  .admin-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .sidebar-tab {
    white-space: nowrap;
  }
  .admin-navbar {
    padding: 12px 16px;
  }
}
