/* ========== Reset & Base ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
  color: #1e293b;
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(168, 85, 247, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.container { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
svg { display: inline-block; vertical-align: middle; }

/* ========== Container ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ========== Navigation ========== */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 18px 28px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.04),
    0 1px 3px rgba(0, 0, 0, 0.02);
  position: sticky;
  top: 20px;
  z-index: 50;
  transition: all 0.3s ease;
}
.nav:hover {
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.04);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  color: #1e293b;
  transition: transform 0.2s ease;
  white-space: nowrap;
}
.nav-brand:hover {
  transform: translateX(2px);
}
.nav-brand svg {
  color: #a855f7;
  filter: drop-shadow(0 2px 4px rgba(168, 85, 247, 0.2));
  flex-shrink: 0;
}

/* ========== Page Header ========== */
.page-header {
  margin-bottom: 32px;
}
.page-title {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}
.page-desc {
  color: #64748b;
  font-size: 15px;
}

/* ========== Cards ========== */
.card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.05),
    0 1px 2px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
  max-width: 100%;
}
.card-image-slider {
  width: 100%;
  height: 200px;
  min-height: 200px;
  max-height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f4ff 0%, #e8f0fe 100%);
  position: relative;
  border-radius: 16px 16px 0 0;
}
.slider-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 200px;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
  display: block;
}
.card:hover .slider-image {
  transform: scale(1.05);
}
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2;
}
.slider-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}
.slider-prev {
  left: 12px;
}
.slider-next {
  right: 12px;
}
.card-image-slider:hover .slider-btn {
  opacity: 1;
}
.slider-indicators {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card-image-slider:hover .slider-indicators {
  opacity: 1;
}
.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.3s ease;
}
.slider-dot:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.2);
}
.slider-dot.active {
  background: white;
  width: 24px;
  border-radius: 4px;
}
.card > .title,
.card > .muted,
.card > div:not(.card-image-slider):not(.card-actions) {
  padding: 0 24px;
}
.card:has(.card-image-slider) > .title {
  padding-top: 20px;
}
.card:not(:has(.card-image-slider)) > .title {
  padding-top: 24px;
}
.card:not(:has(.card-actions)) > div:last-of-type {
  padding-bottom: 24px;
}
.card:has(.card-actions) > div:last-of-type:not(.card-actions) {
  padding-bottom: 0;
}
.card > .card-actions {
  margin: 0 24px 20px 24px;
  padding: 16px 0 0 0;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #a855f7, #ec4899, #a855f7);
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 
    0 12px 32px rgba(168, 85, 247, 0.15),
    0 4px 12px rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.3);
}
.card:hover::before {
  opacity: 1;
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.card .title {
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 14px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card:has(.card-image-slider) .title::before {
  content: '';
}
.card:not(:has(.card-image-slider)) .title::before {
  content: '📦';
  font-size: 20px;
  opacity: 0.8;
}
.card .muted {
  color: #64748b;
  font-size: 13px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card > div:not(.title):not(.muted):not(.card-actions):not(.card-image-slider) {
  margin: 10px 0;
  padding-left: 24px;
  position: relative;
}
.card > div:not(.title):not(.muted):not(.card-actions):not(.card-image-slider)::before {
  content: '•';
  position: absolute;
  left: 8px;
  color: #a855f7;
  font-weight: 700;
}
.card-actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid #e2e8f0;
}
.btn-edit,
.btn-delete {
  flex: 1;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-edit {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.btn-edit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
.btn-delete {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}
.btn-delete:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* ========== Grid Layout ========== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* ========== Stats ========== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat {
  background: linear-gradient(135deg, #f8f4ff 0%, #fef1f9 100%);
  border: 1px solid #e9d5ff;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
  pointer-events: none;
}
.stat .label {
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat .label::before {
  content: '📊';
  font-size: 16px;
}
.stat .value {
  font-size: 42px;
  font-weight: 800;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  transition: transform 0.3s ease;
}
.stat:hover .value {
  transform: scale(1.05);
}

/* ========== Forms ========== */
.form-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}
.form-section {
  margin-bottom: 32px;
}
.form-section:last-child {
  margin-bottom: 0;
}
.form-section-title {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e9d5ff;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.full {
  grid-column: 1 / -1;
}
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}
.input, .select {
  background: white;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  transition: all 0.2s ease;
  width: 100%;
}
.input:focus, .select:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
  background: #faf9fd;
}
.input::placeholder {
  color: #94a3b8;
}

/* ========== Buttons ========== */
.button {
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-align: center;
  justify-content: center;
}
.button-primary {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}
.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}
.button-secondary {
  background: white;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.button-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

/* ========== Alerts ========== */
.alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}
.alert-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
}
.alert-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
}

/* ========== Help Box ========== */
.help-box {
  margin-top: 24px;
  padding: 16px;
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}
.help-box code {
  background: #f8f4ff;
  padding: 2px 8px;
  border-radius: 4px;
  color: #a855f7;
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

/* ========== Filter Row ========== */
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

/* ========== Footer ========== */
.footer {
  color: #94a3b8;
  font-size: 13px;
  margin-top: 48px;
  text-align: center;
  padding: 20px;
}

/* ========== Filter Compact ========== */
.filter-compact {
  margin-bottom: 24px;
}
.filter-compact-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.search-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 0 18px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.02),
    inset 0 1px 2px rgba(0, 0, 0, 0.01);
}
.search-box:focus-within {
  border-color: #a855f7;
  box-shadow: 
    0 6px 16px rgba(168, 85, 247, 0.12),
    0 0 0 4px rgba(168, 85, 247, 0.08);
  transform: translateY(-1px);
}
.search-box svg {
  color: #94a3b8;
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 12px 12px 8px;
  font-size: 14px;
  color: #1e293b;
  outline: none;
}
.search-input::placeholder {
  color: #94a3b8;
}
.clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  color: #94a3b8;
  transition: color 0.2s;
  cursor: pointer;
}
.clear-btn:hover {
  color: #dc2626;
}
.dimension-buttons {
  display: flex;
  gap: 8px;
}
.dim-btn {
  padding: 11px 22px;
  background: white;
  border: 2px solid #e2e8f0;
  color: #64748b;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.dim-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.1), transparent);
  transition: left 0.5s ease;
}
.dim-btn:hover::before {
  left: 100%;
}
.dim-btn:hover {
  border-color: #a855f7;
  background: #faf9fd;
  color: #a855f7;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.1);
}
.dim-btn.active {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  border-color: transparent;
  color: white;
  box-shadow: 
    0 6px 20px rgba(168, 85, 247, 0.4),
    0 2px 8px rgba(236, 72, 153, 0.2);
  transform: translateY(-2px);
}
.dim-btn.active::before {
  display: none;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 24px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f1f5f9;
}

/* ========== Responsive ========== */
@media (max-width: 968px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
  .stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  body { font-size: 14px; }
  .container { padding: 16px 12px; }
  
  .nav {
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border-radius: 16px;
    position: relative;
    top: 0;
  }
  .nav-brand {
    justify-content: center;
    font-size: 15px;
    gap: 8px;
  }
  .nav-brand svg {
    width: 20px;
    height: 20px;
  }
  .button-primary {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
  }
  
  .grid { 
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .stats { 
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .stat .value {
    font-size: 36px;
  }
  
  .filter-compact {
    margin-bottom: 20px;
  }
  .filter-compact-row {
    flex-direction: column;
    gap: 10px;
  }
  .search-box {
    width: 100%;
    padding: 0 14px;
  }
  .search-input {
    padding: 14px 10px 14px 8px;
    font-size: 15px;
  }
  .dimension-buttons {
    width: 100%;
    justify-content: stretch;
    gap: 6px;
  }
  .dim-btn {
    flex: 1;
    padding: 12px 8px;
    font-size: 13px;
  }
  
  .card {
    border-radius: 14px;
  }
  .card-image-slider {
    height: 180px;
    min-height: 180px;
    max-height: 180px;
    border-radius: 14px 14px 0 0;
  }
  .slider-image {
    max-height: 180px;
  }
  .slider-btn {
    width: 36px;
    height: 36px;
  }
  .slider-prev {
    left: 8px;
  }
  .slider-next {
    right: 8px;
  }
  .card .title {
    font-size: 17px;
  }
  .card .title::before {
    font-size: 18px;
  }
  
  .section-title {
    font-size: 17px;
    margin: 20px 0 14px;
  }
  
  .form-row { 
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .form-section {
    margin-bottom: 24px;
  }
  .form-section-title {
    font-size: 16px;
  }
  
  .page-title { font-size: 24px; }
  
  .form-actions {
    flex-direction: column;
    gap: 10px;
  }
  .form-actions .button {
    width: 100%;
  }
  
  .alert {
    padding: 14px 16px;
    font-size: 14px;
  }
  
  .footer {
    margin-top: 32px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .container { padding: 12px 8px; }
  .nav { padding: 14px 12px; }
  .nav-brand { font-size: 13px; gap: 6px; }
  .nav-brand svg { width: 18px; height: 18px; }
  .card-image-slider {
    height: 160px;
    min-height: 160px;
    max-height: 160px;
  }
  .slider-image {
    max-height: 160px;
  }
  .stat .value { font-size: 32px; }
  .dim-btn { font-size: 12px; padding: 10px 6px; }
}
