:root {
  --color-cream: #fdfbf9;
  --color-sand: #f0ebe5;
  --color-slate: #5c6b7a;
  --color-charcoal: #2d2a26;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--color-cream);
  color: var(--color-charcoal);
  min-height: 100vh;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: white;
  border-bottom: 1px solid rgba(92, 107, 122, 0.2);
}

.admin-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-charcoal);
  text-decoration: none;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-nav a {
  color: var(--color-slate);
  text-decoration: none;
  font-size: 0.9rem;
}

.admin-nav a:hover { color: var(--color-charcoal); }

.admin-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.admin-main h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

/* Login */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-box {
  width: 100%;
  max-width: 380px;
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(45, 41, 38, 0.08);
}

.login-box h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  text-align: center;
  color: var(--color-slate);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.turnstile-field {
  margin: 0.75rem 0 1rem;
}

.turnstile-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--color-charcoal, #2d2926);
}

.turnstile-wrap {
  min-height: 65px;
}

.turnstile-error {
  margin: 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
}

.login-form .form-group { margin-bottom: 1rem; }
.login-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.login-form input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}
.login-form input:focus {
  outline: none;
  border-color: var(--color-slate);
}
.login-form .btn { width: 100%; margin-top: 0.5rem; }
.error-msg { color: #c00; font-size: 0.9rem; margin-bottom: 0.5rem; }

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.dashboard-card {
  display: block;
  padding: 1.5rem;
  background: white;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(92, 107, 122, 0.15);
  transition: box-shadow 0.2s, transform 0.2s;
}

.dashboard-card:hover {
  box-shadow: 0 8px 24px rgba(45, 41, 38, 0.1);
  transform: translateY(-2px);
}

.dashboard-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.dashboard-card p {
  font-size: 0.9rem;
  color: var(--color-slate);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-hint { display: block; font-size: 0.8rem; color: var(--color-slate); margin-top: 0.35rem; }
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-slate);
}
.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.order-modal-actions {
  flex-wrap: wrap;
  align-items: center;
}
.order-modal-actions select,
.order-modal-actions input[type="text"] {
  flex: 1 1 140px;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.admin-hint {
  color: var(--color-slate);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.empty-msg {
  color: var(--color-slate);
  padding: 2rem;
  text-align: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--color-charcoal);
  color: white;
  border-color: var(--color-charcoal);
}
.btn-primary:hover {
  background: #1a1816;
}
.btn-outline {
  background: transparent;
  color: var(--color-charcoal);
  border-color: var(--color-charcoal);
}
.btn-outline:hover {
  background: var(--color-charcoal);
  color: white;
}
.btn-danger {
  background: #c0392b;
  color: white;
  border-color: #c0392b;
}
.btn-danger:hover { background: #a93226; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }

/* Data list */
.data-list { margin-top: 1.5rem; }
.data-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(92, 107, 122, 0.1);
}
.data-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--color-sand);
}
.data-info { flex: 1; min-width: 0; }
.data-info strong { display: block; margin-bottom: 0.25rem; }
.data-info p, .data-meta { font-size: 0.9rem; color: var(--color-slate); }
.data-actions { display: flex; gap: 0.5rem; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}
.modal-content {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content.modal-lg { max-width: 640px; }
.modal-content h2 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
}

/* Settings */
.settings-form { margin-top: 1rem; }
.settings-section {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(92, 107, 122, 0.1);
}
.settings-section h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--color-slate);
}
.success-msg {
  background: #d4edda;
  color: #155724;
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* Image field (upload + URL + library) */
.image-field {
  margin-top: 0.5rem;
}
.image-field-preview {
  width: 120px;
  height: 120px;
  background: var(--color-sand);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-field-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-field-placeholder {
  color: var(--color-slate);
  font-size: 0.85rem;
}
.image-field-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.image-field-url {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Media library */
.modal-lg {
  max-width: 640px;
}
.media-library-hint {
  font-size: 0.9rem;
  color: var(--color-slate);
  margin-bottom: 1rem;
}
.media-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
}
.media-library-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color 0.2s;
}
.media-library-item:hover {
  border-color: var(--color-slate);
}
.media-library-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-library-empty {
  color: var(--color-slate);
  padding: 2rem;
  text-align: center;
}

/* Media library page */
.media-page-desc {
  color: var(--color-slate);
  margin-bottom: 1rem;
}
.media-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.media-page-item {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(92, 107, 122, 0.1);
}
.media-page-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.media-page-actions {
  padding: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Slideshow images manager */
.slideshow-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  min-height: 80px;
}
.slideshow-item {
  position: relative;
  width: 120px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  cursor: grab;
  border: 2px solid transparent;
  transition: border-color 0.2s, opacity 0.2s;
}
.slideshow-item:hover {
  border-color: var(--color-slate);
}
.slideshow-item.dragging {
  opacity: 0.5;
}
.slideshow-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slideshow-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slideshow-remove:hover {
  background: #c0392b;
}
.slideshow-add {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.slideshow-empty {
  color: var(--color-slate);
  font-size: 0.9rem;
}

/* Orders */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: capitalize;
}
.status-pending { background: #fff3cd; color: #856404; }
.status-confirmed { background: #cce5ff; color: #004085; }
.status-shipped { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }
.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.order-detail-grid p { font-size: 0.9rem; color: var(--color-slate); }
.order-detail-grid strong { color: var(--color-charcoal); }
.order-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.order-items-table th,
.order-items-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(92, 107, 122, 0.15);
}
.order-items-table th { color: var(--color-slate); font-weight: 500; }
