/* =========================================================
   Variables & Reset
   ========================================================= */
:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #dbeafe;
  --success:       #16a34a;
  --danger:        #dc2626;
  --warning:       #d97706;
  --info:          #0891b2;

  --bg:            #f8fafc;
  --bg-card:       #ffffff;
  --bg-admin:      #1e293b;
  --bg-admin-side: #0f172a;

  --text:          #1e293b;
  --text-muted:    #64748b;
  --text-light:    #94a3b8;
  --border:        #e2e8f0;
  --border-focus:  #93c5fd;

  --radius:        0.75rem;
  --radius-sm:     0.375rem;
  --radius-lg:     1rem;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:        0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:     0 20px 40px rgba(0,0,0,.12);

  --transition:    0.2s ease;
  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a  { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =========================================================
   Navbar
   ========================================================= */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
}

.navbar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.navbar-brand:hover { text-decoration: none; }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.navbar-nav a {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

/* =========================================================
   Flash messages
   ========================================================= */
.flash-container {
  max-width: 1200px;
  margin: 1rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.alert {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease;
}

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

.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #f0f9ff; color: #075985; border: 1px solid #bae6fd; }

.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0.5;
  transition: opacity var(--transition);
  line-height: 1;
}
.alert-close:hover { opacity: 1; }

/* =========================================================
   Main layout
   ========================================================= */
main { flex: 1; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* =========================================================
   Hero section
   ========================================================= */
.hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: white;
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.85;
  max-width: 520px;
  margin: 0 auto 2rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
}

.hero-stat-label {
  font-size: 0.85rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =========================================================
   Filter bar
   ========================================================= */
.filter-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 64px;
  z-index: 90;
}

.filter-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 0.25rem;
}

.filter-btn {
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  border: 1.5px solid var(--border);
  background: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* =========================================================
   Items grid
   ========================================================= */
.items-section { padding: 2rem 0 3rem; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.items-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.items-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .items-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .items-grid { grid-template-columns: repeat(3, 1fr); }
}

/* =========================================================
   Item card
   ========================================================= */
.item-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.item-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.item-card.vendu { opacity: 0.65; }

.item-card-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #f1f5f9;
  position: relative;
}

.item-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.item-card:hover .item-card-img img {
  transform: scale(1.04);
}

.item-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.85rem;
  gap: 0.5rem;
}

.item-card-img-placeholder svg {
  width: 2.5rem;
  height: 2.5rem;
  opacity: 0.4;
}

.item-card-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }

.item-card-body {
  padding: 1.1rem 1.25rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.item-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.item-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

.item-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

.item-price-free {
  color: var(--success);
}

.item-link-icon {
  color: var(--text-muted);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* =========================================================
   Empty state
   ========================================================= */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state svg {
  width: 4rem;
  height: 4rem;
  opacity: 0.25;
  margin: 0 auto 1.25rem;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

/* =========================================================
   Item detail page
   ========================================================= */
.breadcrumb {
  padding: 1.25rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { opacity: 0.5; }

.item-detail {
  padding: 1.5rem 0 3rem;
}

.item-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .item-detail-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

@media (min-width: 1024px) {
  .item-detail-grid { grid-template-columns: 3fr 2fr; }
}

/* Gallery */
.gallery {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gallery-main {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  background: #f1f5f9;
  cursor: pointer;
  position: relative;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-main:hover img { transform: scale(1.02); }

.gallery-main-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  gap: 0.75rem;
}

.gallery-main-placeholder svg {
  width: 3rem;
  height: 3rem;
  opacity: 0.3;
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gallery-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition), opacity var(--transition);
  flex-shrink: 0;
}

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

.gallery-thumb.active { border-color: var(--primary); }
.gallery-thumb:hover { opacity: 0.85; }

/* Item info panel */
.item-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.item-info-header { display: flex; flex-direction: column; gap: 0.5rem; }

.item-detail-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.item-detail-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.item-detail-price.free { color: var(--success); }

.item-description {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.75;
  white-space: pre-wrap;
  border: 1px solid var(--border);
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.contact-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.contact-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}
.btn-success:hover {
  background: #15803d;
  border-color: #15803d;
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-outline-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: #e2e8f0;
  color: var(--text);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

.btn-full { width: 100%; }

/* =========================================================
   Lightbox
   ========================================================= */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox.open { display: flex; }

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,.15);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.lightbox-nav:hover { background: rgba(255,255,255,.3); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* =========================================================
   Footer
   ========================================================= */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

.footer-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-contact h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.footer-contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-contact-links a {
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.footer-contact-links a:hover { color: var(--primary); }

.footer-bottom {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 1rem 1.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =========================================================
   Forms
   ========================================================= */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.form-label .required { color: var(--danger); margin-left: 0.15rem; }

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-control.is-invalid { border-color: var(--danger); }

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

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* File upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: #fafbfc;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-zone input[type="file"] {
  display: none;
}

.upload-zone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.upload-zone p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.upload-zone small {
  font-size: 0.78rem;
  color: var(--text-light);
}

/* Image previews in form */
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.image-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

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

.image-preview-item .remove-img {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: rgba(220,38,38,.85);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* =========================================================
   Login page
   ========================================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
}

.login-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .logo-icon {
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
  color: white;
}

.login-logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.login-logo p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.login-form { display: flex; flex-direction: column; gap: 1.25rem; }

/* =========================================================
   Admin layout
   ========================================================= */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 240px;
  background: var(--bg-admin-side);
  color: white;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform var(--transition);
}

.admin-sidebar-header {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  text-decoration: none;
}

.admin-sidebar-brand .brand-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.admin-nav {
  padding: 1rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  list-style: none;
  overflow-y: auto;
}

.admin-nav-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,.35);
  padding: 0.75rem 0.5rem 0.35rem;
  font-weight: 600;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.65);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
}

.admin-nav a:hover {
  background: rgba(255,255,255,.08);
  color: white;
  text-decoration: none;
}

.admin-nav a.active {
  background: var(--primary);
  color: white;
}

.admin-nav-icon { width: 1.1rem; text-align: center; flex-shrink: 0; }

.admin-sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

.admin-sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.55);
  font-size: 0.875rem;
  transition: all var(--transition);
  text-decoration: none;
}

.admin-sidebar-footer a:hover {
  background: rgba(255,255,255,.08);
  color: white;
  text-decoration: none;
}

.admin-main {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
}

.admin-content {
  flex: 1;
  padding: 2rem;
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: var(--shadow-sm);
}

.stat-card-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat-card-value.primary { color: var(--primary); }
.stat-card-value.success { color: var(--success); }
.stat-card-value.danger  { color: var(--danger); }

/* Admin panel card */
.panel {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.panel-body { padding: 1.5rem; }

/* Admin table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  background: #f8fafc;
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table tr:hover td { background: #fafbfc; }

.admin-table-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
  background: #f1f5f9;
}

.admin-table-img-placeholder {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 1.2rem;
  border: 1px solid var(--border);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Admin form page */
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .admin-form-grid { grid-template-columns: 2fr 1fr; align-items: start; }
}

.form-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.form-card-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: #f8fafc;
}

.form-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Existing images in edit form */
.existing-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
}

.existing-img-item {
  position: relative;
  aspect-ratio: 1;
}

.existing-img-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.existing-img-del {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: rgba(220,38,38,.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.existing-img-del:hover { background: var(--danger); }

/* =========================================================
   Error pages
   ========================================================= */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 3rem 1.5rem;
}

.error-page-inner { max-width: 480px; }

.error-code {
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 900;
  color: var(--primary);
  opacity: 0.15;
  line-height: 1;
  margin-bottom: -1rem;
}

.error-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.error-text {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* =========================================================
   Responsive tweaks
   ========================================================= */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
  .admin-topbar {
    padding: 0 1rem;
  }
  .admin-content {
    padding: 1.25rem;
  }
  .admin-table-responsive {
    overflow-x: auto;
  }
  .hero { padding: 2.5rem 0 2rem; }
}

@media (max-width: 480px) {
  .navbar-inner { padding: 0 1rem; }
  .container { padding: 0 1rem; }
  .hero p { font-size: 0.95rem; }
}

/* Hamburger button */
.admin-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text);
  padding: 0.25rem;
}

@media (max-width: 768px) {
  .admin-menu-toggle { display: flex; align-items: center; }
  .admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 199;
  }
  .admin-sidebar-overlay.open { display: block; }
}

/* Utilities */
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.justify-between { justify-content: space-between; }
.fw-bold { font-weight: 700; }
