:root {
  --a-forest: #002925;
  --a-forest-dark: #001B18;
  --a-green: #45B848;
  --a-lime: #8AC63F;
  --a-bg: #F3F6F4;
  --a-white: #FFFFFF;
  --a-text: #1F2937;
  --a-muted: #6B7280;
  --a-border: #E2E8F0;
  --a-danger: #DC2626;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--a-bg);
  color: var(--a-text);
  font-size: 14.5px;
}
h1, h2, h3, h4 { font-family: 'Mulish', sans-serif; margin-top: 0; color: #111827; }
a { text-decoration: none; color: inherit; }

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 264px;
  background: var(--a-forest);
  color: #E5E7EB;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-brand strong { font-family: 'Mulish', sans-serif; font-size: 18px; color: #fff; }
.sidebar-brand span { color: var(--a-lime); }
.sidebar-group { padding: 14px 16px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: #9CA3AF; font-weight: 700; }
.sidebar-nav { list-style: none; padding: 0 10px 24px; margin: 0; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  color: #D1D5DB;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all .18s ease;
}
.sidebar-nav a i { width: 18px; text-align: center; opacity: 0.85; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav a.active { background: var(--a-green); color: #fff; font-weight: 600; }

.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
  background: var(--a-white);
  border-bottom: 1px solid var(--a-border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-content { padding: 26px 28px 48px; }

.card {
  background: var(--a-white);
  border: 1px solid var(--a-border);
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  margin-bottom: 22px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F1F5F9;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--a-white);
  border: 1px solid var(--a-border);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform .18s ease;
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--a-green); }
.stat-num { font-family: 'Mulish', sans-serif; font-size: 28px; font-weight: 800; color: var(--a-forest); line-height: 1.1; }
.stat-label { font-size: 12.5px; color: var(--a-muted); font-weight: 600; margin-top: 4px; }
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #EAF7EA;
  color: var(--a-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .18s ease;
}
.btn-primary { background: var(--a-green); color: #fff; }
.btn-primary:hover { background: #389E3B; color: #fff; }
.btn-dark { background: var(--a-forest); color: #fff; }
.btn-outline { background: #fff; border-color: #CBD5E1; color: #334155; }
.btn-outline:hover { border-color: var(--a-green); color: var(--a-green); }
.btn-danger { background: #FEE2E2; color: var(--a-danger); border-color: #FECACA; }
.btn-danger:hover { background: var(--a-danger); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }

.table-wrap { overflow-x: auto; }
table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th {
  text-align: left;
  padding: 11px 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--a-muted);
  border-bottom: 2px solid #E5E7EB;
  background: #F8FAFC;
}
table.admin-table td {
  padding: 12px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}
.thumb-sm { width: 54px; height: 40px; object-fit: cover; border-radius: 5px; border: 1px solid #E5E7EB; background: #F8FAFC; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; }
.badge-green { background: #DCFCE7; color: #166534; }
.badge-gray { background: #F1F5F9; color: #475569; }
.badge-amber { background: #FEF3C7; color: #92400E; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: #1E293B; }
.input, select.input, textarea.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
}
.input:focus { outline: none; border-color: var(--a-green); box-shadow: 0 0 0 3px rgba(69,184,72,0.16); }
textarea.code-input { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

.image-field-box {
  border: 1.5px dashed #CBD5E1;
  border-radius: 8px;
  padding: 14px;
  background: #FAFCFA;
}
.image-preview-row { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.image-preview-box {
  width: 110px;
  height: 82px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.image-preview-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.remove-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #B91C1C;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 500; }
.alert-success { background: #DCFCE7; color: #14532D; border: 1px solid #86EFAC; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.media-card {
  background: #fff;
  border: 1px solid var(--a-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.media-card-img {
  height: 145px;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-bottom: 1px solid #F1F5F9;
}
.media-card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }

@media (max-width: 960px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: relative; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}
