:root {
  --admin-bg: #f6f8f4;
  --admin-surface: #ffffff;
  --admin-ink: #16251b;
  --admin-muted: #5c6b60;
  --admin-line: #dce6dd;
  --admin-green: #358844;
  --admin-green-deep: #235c2e;
  --admin-green-soft: #e5f1e6;
  --admin-danger: #a3231a;
  --admin-shadow: 0 12px 34px rgba(21, 44, 28, .07);
}

* { box-sizing: border-box; }
html { background: var(--admin-bg); }
body.admin-body { margin: 0; background: var(--admin-bg); color: var(--admin-ink); font-family: "Manrope", sans-serif; font-size: 15px; line-height: 1.6; }
a { color: inherit; }
.admin-topbar { position: sticky; top: 0; z-index: 20; background: #173c24; color: #f8fbf7; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); }
.admin-topbar-inner { display: flex; align-items: center; gap: 24px; max-width: 1400px; min-height: 76px; margin: 0 auto; padding: 12px 28px; }
.admin-brand { display: flex; align-items: center; gap: 10px; min-width: 205px; text-decoration: none; }
.admin-brand-logo { display: grid; place-items: center; width: 44px; height: 44px; background: #fff; border-radius: 8px; }
.admin-brand-logo img { width: 36px; height: 36px; object-fit: contain; }
.admin-brand strong, .admin-brand small { display: block; }
.admin-brand strong { font-size: 16px; letter-spacing: .04em; }
.admin-brand small { margin-top: 1px; color: rgba(248, 251, 247, .65); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.admin-nav { display: flex; align-items: center; justify-content: flex-end; gap: 4px; width: 100%; }
.admin-nav a { position: relative; padding: 9px 11px; border-radius: 6px; color: rgba(248, 251, 247, .72); font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255, 255, 255, .12); color: #fff; }
.admin-nav a.admin-view-site { color: #bde3c1; }
.admin-nav a.admin-logout { margin-left: 8px; background: rgba(255, 255, 255, .1); color: #fff; }
.nav-dot { display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: #9de0a7; vertical-align: middle; }
.admin-menu-button { display: none; margin-left: auto; border: 0; background: transparent; color: #fff; font-size: 22px; }
.admin-main { min-height: calc(100vh - 130px); }
.admin-container { max-width: 1400px; margin: 0 auto; padding: 38px 28px 70px; }
.admin-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.admin-page-heading h1 { margin: 3px 0 0; font-family: "Sora", sans-serif; font-size: clamp(26px, 3vw, 38px); line-height: 1.15; }
.admin-page-heading p { margin: 8px 0 0; color: var(--admin-muted); }
.admin-eyebrow { color: var(--admin-green); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.card { margin-bottom: 22px; padding: 24px; background: var(--admin-surface); border: 1px solid var(--admin-line); border-radius: 12px; box-shadow: var(--admin-shadow); }
.card h2 { margin: 0 0 18px; font-family: "Sora", sans-serif; font-size: 20px; line-height: 1.25; }
.card h3 { margin: 0 0 12px; font-size: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-header h2 { margin: 0; }
.muted { color: var(--admin-muted); }
.small { font-size: 12px; }
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.dash-card { display: block; padding: 22px; background: var(--admin-surface); border: 1px solid var(--admin-line); border-radius: 12px; box-shadow: var(--admin-shadow); text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
.dash-card:hover { transform: translateY(-2px); border-color: #a9c9ad; }
.dash-card .n { font-family: "Sora", sans-serif; font-size: 32px; font-weight: 700; color: var(--admin-green-deep); }
.dash-card .l { margin-top: 4px; color: var(--admin-muted); font-size: 13px; font-weight: 700; }
.dash-card .d { margin-top: 8px; color: var(--admin-muted); font-size: 12px; }
.dash-grid-3 { grid-template-columns: repeat(3, 1fr); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 6px; font-size: 13px; font-weight: 800; text-decoration: none; cursor: pointer; }
.button-primary { background: var(--admin-green); color: #fff; }
.button-primary:hover { background: var(--admin-green-deep); }
.button-secondary { background: var(--admin-green-deep); color: #fff; }
.button-outline { border-color: var(--admin-line); background: #fff; color: var(--admin-ink); }
.button-outline:hover { border-color: var(--admin-green); color: var(--admin-green-deep); }
.button-danger { background: #fff0ef; border-color: #f0c5c1; color: var(--admin-danger); }
.button-small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid #c9d8cb; border-radius: 6px; background: #fff; color: var(--admin-ink); font: inherit; font-size: 14px; outline: none; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--admin-green); box-shadow: 0 0 0 3px rgba(53, 136, 68, .13); }
.field-note { margin: 0; color: var(--admin-muted); font-size: 11px; }
.check-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--admin-muted); font-size: 12px; font-weight: 600; }
.check-line input { width: auto; min-height: auto; }
.image-preview { width: 100%; max-width: 260px; margin-bottom: 10px; overflow: hidden; border: 1px solid var(--admin-line); border-radius: 8px; background: var(--admin-green-soft); }
.image-preview img { display: block; width: 100%; height: 150px; object-fit: cover; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.alert { margin-bottom: 18px; padding: 13px 15px; border: 1px solid; border-radius: 7px; font-size: 13px; }
.alert-success { background: #edf8ef; border-color: #b6ddbb; color: #23612d; }
.alert-error { background: #fff1f0; border-color: #efc3bf; color: var(--admin-danger); }
.alert-info { background: #eef5ff; border-color: #c7d8ef; color: #24517e; }
.item-list { display: grid; gap: 10px; }
.item-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid var(--admin-line); border-radius: 8px; background: #fff; }
.item-row-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.item-row-image { width: 64px; height: 48px; flex: 0 0 auto; overflow: hidden; border-radius: 5px; background: var(--admin-green-soft); }
.item-row-image img { width: 100%; height: 100%; object-fit: cover; }
.item-row-title { font-weight: 800; }
.item-row-meta { margin-top: 2px; color: var(--admin-muted); font-size: 12px; }
.item-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.item-actions form { display: inline-flex; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--admin-line); text-align: left; vertical-align: top; }
th { color: var(--admin-muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: var(--admin-green-soft); color: var(--admin-green-deep); font-size: 11px; font-weight: 800; }
.badge-muted { background: #eef0ed; color: #667067; }
.empty { padding: 30px 10px; color: var(--admin-muted); text-align: center; }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: linear-gradient(135deg, #e7f0e6, #fbfaf6 55%, #dceade); }
.login-card { width: min(100%, 460px); padding: 34px; background: #fff; border: 1px solid var(--admin-line); border-radius: 14px; box-shadow: 0 22px 70px rgba(25, 66, 34, .14); }
.login-card h1 { margin: 18px 0 6px; font-family: "Sora", sans-serif; font-size: 30px; }
.login-card p { margin: 0 0 26px; color: var(--admin-muted); }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand img { width: 48px; height: 48px; object-fit: contain; }
.login-brand strong, .login-brand small { display: block; }
.login-brand small { color: var(--admin-muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.login-back { display: inline-block; margin-top: 22px; color: var(--admin-green-deep); font-size: 13px; font-weight: 700; }
.admin-footer { max-width: 1400px; margin: 0 auto; padding: 0 28px 26px; color: var(--admin-muted); font-size: 11px; }
@media (max-width: 1050px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-nav { position: absolute; top: 76px; right: 14px; left: 14px; display: none; flex-direction: column; align-items: stretch; padding: 10px; background: #173c24; border-radius: 8px; box-shadow: 0 14px 30px rgba(0, 0, 0, .2); }
  .admin-nav.open { display: flex; }
  .admin-menu-button { display: block; }
  .admin-topbar-inner { position: relative; }
  .admin-nav a.admin-logout { margin: 6px 0 0; text-align: center; }
}
@media (max-width: 700px) {
  .admin-topbar-inner, .admin-container { padding-right: 16px; padding-left: 16px; }
  .admin-page-heading { align-items: flex-start; flex-direction: column; }
  .dash-grid, .dash-grid-3, .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .item-row { align-items: flex-start; flex-direction: column; }
  .item-actions { justify-content: flex-start; }
  .card { padding: 18px; }
}
