.admin-body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(229,181,34,0.12), transparent 26%),
    linear-gradient(180deg, #edf4ed 0, #f7f5ed 420px);
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 100;
  color: white;
  background: rgba(9, 32, 20, 0.96);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}
.admin-header-shell {
  width: var(--page);
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.admin-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.admin-brand img { height: 47px; width: auto; padding: 5px 9px; border-radius: 10px; background: white; }
.admin-brand-copy strong { display: block; font-size: 1rem; }
.admin-brand-copy span { display: block; color: rgba(255,255,255,0.62); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; }
.admin-header-actions { display: flex; align-items: center; gap: 8px; }
.admin-header-actions a,
.admin-header-actions button {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  color: white;
  background: rgba(255,255,255,0.08);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 850;
}
.admin-header-actions a:hover,
.admin-header-actions button:hover { background: rgba(255,255,255,0.16); }
.admin-header-actions .admin-gold { color: var(--green-950); border-color: var(--gold-400); background: var(--gold-400); }
.admin-inline-form { display: inline; }

.admin-main { width: var(--page); margin: 0 auto; padding: 42px 0 90px; }
.admin-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.admin-title-row h1 { margin: 0; color: var(--green-950); font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1; letter-spacing: -0.055em; }
.admin-title-row p { margin: 10px 0 0; color: var(--muted); }
.admin-updated { flex: 0 0 auto; padding: 10px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-size: 0.77rem; font-weight: 800; }

.flash {
  margin: 20px 0 0;
  padding: 15px 17px;
  border-radius: 15px;
  font-weight: 800;
}
.flash.success { color: #125b30; border: 1px solid #b8e2c5; background: #e8f7ec; }
.flash.error { color: #8c2525; border: 1px solid #efc3c3; background: #fff0f0; }
.flash.warning { color: #6a4c00; border: 1px solid #ead17b; background: #fff6d4; }

.stats-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { padding: 19px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,0.88); box-shadow: var(--shadow-sm); }
.stat-card span { display: block; color: var(--muted); font-size: 0.7rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.stat-card strong { display: block; margin-top: 5px; color: var(--green-950); font-size: 1.85rem; letter-spacing: -0.04em; }

.admin-grid { margin-top: 24px; display: grid; grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr); gap: 20px; align-items: start; }
.admin-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--shadow-sm); }
.admin-panel-header { padding: 21px 23px; border-bottom: 1px solid var(--line); background: #f8faf7; }
.admin-panel-header h2 { margin: 0; color: var(--green-950); font-size: 1.35rem; letter-spacing: -0.03em; }
.admin-panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 0.83rem; }
.admin-panel-body { padding: 23px; }

.admin-form { display: grid; gap: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field label { display: block; margin-bottom: 6px; color: var(--green-900); font-size: 0.76rem; font-weight: 900; }
.form-field .hint { display: block; margin-top: 5px; color: var(--muted); font-size: 0.72rem; }
.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form input[type="password"],
.admin-form input[type="file"],
.admin-form textarea,
.admin-form select,
.admin-search {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cbd8ce;
  border-radius: 12px;
  color: var(--ink);
  background: white;
  outline: none;
}
.admin-form textarea { min-height: 92px; resize: vertical; }
.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus,
.admin-search:focus { border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(38,116,67,0.12); }
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-card { min-height: 48px; padding: 10px 12px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; }
.check-card input { width: 18px; height: 18px; accent-color: var(--green-700); }
.check-card span { font-size: 0.82rem; font-weight: 850; }
.fixed-price {
  padding: 13px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #efd47c;
  border-radius: 13px;
  color: #5b4500;
  background: var(--gold-100);
  font-size: 0.82rem;
  font-weight: 850;
}
.fixed-price strong { font-size: 1.15rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 3px; }
.admin-submit,
.admin-secondary,
.admin-danger {
  min-height: 44px;
  padding: 10px 15px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}
.admin-submit { border: 0; color: white; background: var(--green-700); }
.admin-submit:hover { background: var(--green-950); }
.admin-secondary { border: 1px solid var(--green-700); color: var(--green-900); background: white; }
.admin-secondary:hover { background: var(--green-50); }
.admin-danger { border: 1px solid #e3b2b2; color: #9a2d2d; background: #fff6f6; }
.admin-danger:hover { background: #ffe7e7; }

.current-image { padding: 10px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; background: #f8faf7; }
.current-image img { width: 68px; height: 68px; border-radius: 12px; object-fit: cover; }
.current-image-copy strong { display: block; font-size: 0.82rem; }
.current-image-copy label { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; color: #972d2d; font-size: 0.74rem; font-weight: 850; }
.image-preview { display: none; width: 100%; max-height: 220px; object-fit: contain; border: 1px dashed var(--line); border-radius: 14px; background: #f8faf7; }
.image-preview.visible { display: block; }

.table-panel { margin-top: 22px; }
.table-toolbar { padding: 14px 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: #f8faf7; }
.search-wrap { position: relative; flex: 1; max-width: 480px; }
.search-wrap svg { position: absolute; left: 13px; top: 50%; width: 19px; height: 19px; color: #738078; transform: translateY(-50%); pointer-events: none; }
.admin-search { padding-left: 40px; }
.table-count { color: var(--muted); font-size: 0.78rem; font-weight: 850; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 880px; }
.admin-table th { padding: 12px 14px; color: #56635a; background: #f3f7f2; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.67rem; font-weight: 950; letter-spacing: 0.08em; text-transform: uppercase; }
.admin-table td { padding: 13px 14px; border-bottom: 1px solid #e9eeea; vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #fbfdfb; }
.admin-plant { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.admin-thumb { flex: 0 0 auto; width: 48px; height: 48px; overflow: hidden; display: grid; place-items: center; border-radius: 12px; color: var(--green-700); background: var(--green-100); }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-thumb svg { width: 23px; height: 23px; }
.admin-plant strong { display: block; color: var(--green-950); }
.admin-plant span { display: block; color: var(--green-700); font-size: 0.68rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.07em; }
.admin-description { max-width: 270px; color: var(--muted); font-size: 0.82rem; }
.visibility-pill { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 0.69rem; font-weight: 900; }
.visibility-pill.active { color: #146234; background: #e5f7ea; }
.visibility-pill.hidden { color: #6d7370; background: #ecefed; }
.featured-star { color: #b38500; font-weight: 950; }
.admin-actions { display: flex; align-items: center; gap: 6px; }
.admin-actions a,
.admin-actions button { padding: 7px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 900; text-decoration: none; white-space: nowrap; }
.admin-actions a { color: var(--green-900); border: 1px solid #b9d2bf; background: #f4faf5; }
.admin-actions button { color: #9a2d2d; border: 1px solid #e4bbbb; background: #fff7f7; }
.admin-row[hidden] { display: none; }
.admin-empty { padding: 45px 20px; text-align: center; color: var(--muted); }
.admin-empty h3 { margin: 0; color: var(--green-950); }
.admin-empty p { margin: 7px 0 0; }

.settings-panel { margin-top: 22px; }
.settings-panel details { border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow-sm); }
.settings-panel summary { padding: 18px 21px; cursor: pointer; color: var(--green-950); font-weight: 900; }
.settings-panel details[open] summary { border-bottom: 1px solid var(--line); }
.settings-content { padding: 21px; }
.settings-content .admin-form { max-width: 680px; }

.auth-page { min-height: 100vh; padding: 28px 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--green-950), var(--green-700)); }
.auth-card { width: min(520px, 100%); overflow: hidden; border: 1px solid rgba(255,255,255,0.2); border-radius: 28px; background: white; box-shadow: 0 28px 90px rgba(0,0,0,0.28); }
.auth-logo { min-height: 145px; padding: 25px; display: grid; place-items: center; background: #f8faf7; border-bottom: 1px solid var(--line); }
.auth-logo img { max-height: 100px; width: auto; }
.auth-body { padding: 29px; }
.auth-body .auth-kicker { margin: 0; color: var(--green-700); font-size: 0.72rem; font-weight: 950; text-transform: uppercase; letter-spacing: 0.12em; }
.auth-body h1 { margin: 7px 0 0; color: var(--green-950); font-size: 2rem; line-height: 1; letter-spacing: -0.04em; }
.auth-body > p { margin: 12px 0 0; color: var(--muted); }
.auth-body .admin-form { margin-top: 22px; }
.auth-note { margin-top: 17px; padding: 13px; border-radius: 13px; color: #5c4700; background: var(--gold-100); font-size: 0.78rem; }
.auth-footer { margin-top: 18px; text-align: center; }
.auth-footer a { color: var(--green-700); font-size: 0.8rem; font-weight: 850; }

.storage-error { width: min(720px, calc(100% - 32px)); margin: 70px auto; padding: 25px; border: 1px solid #efc0c0; border-radius: 20px; color: #7f2020; background: white; box-shadow: var(--shadow-lg); }
.storage-error h1 { margin: 0; }
.storage-error code { display: block; margin-top: 13px; padding: 12px; overflow-wrap: anywhere; border-radius: 10px; background: #fff1f1; }

@media (max-width: 980px) {
  .admin-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-panel:first-child { order: 0; }
}

@media (max-width: 760px) {
  .admin-header-shell { min-height: 68px; }
  .admin-brand-copy span { display: none; }
  .admin-header-actions .hide-mobile { display: none; }
  .admin-header-actions a,
  .admin-header-actions button { padding: 8px 10px; font-size: 0.72rem; }
  .admin-main { padding-top: 28px; }
  .admin-title-row { display: block; }
  .admin-updated { display: inline-block; margin-top: 14px; }
  .form-row, .checkbox-grid { grid-template-columns: 1fr; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .search-wrap { max-width: none; }
  .admin-table-wrap { overflow: visible; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; min-width: 0; }
  .admin-table thead { display: none; }
  .admin-table tbody { padding: 12px; display: grid; gap: 12px; }
  .admin-table tr { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: white; }
  .admin-table td { padding: 10px 13px; display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 10px; align-items: center; }
  .admin-table td::before { content: attr(data-label); color: #66736a; font-size: 0.64rem; font-weight: 950; letter-spacing: 0.07em; text-transform: uppercase; }
  .admin-table td:first-child { display: block; padding: 14px; }
  .admin-table td:first-child::before { display: none; }
  .admin-description { max-width: none; }
  .admin-actions { justify-content: flex-start; }
}

@media (max-width: 520px) {
  .admin-brand img { height: 40px; }
  .admin-brand-copy strong { font-size: 0.86rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 15px; }
  .stat-card strong { font-size: 1.5rem; }
  .admin-panel-body, .auth-body { padding: 20px; }
  .form-actions { display: grid; grid-template-columns: 1fr; }
  .admin-submit, .admin-secondary, .admin-danger { width: 100%; text-align: center; }
}

/* --- v1.1: classes replacing former inline styles --- */
.appointment-notice-flush { margin-top: 0; }
.admin-note { margin-top: 15px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #f8faf7; }
.admin-note strong { display: block; color: var(--green-950); }
.admin-note p { margin: 7px 0 0; color: var(--muted); font-size: 0.84rem; }

/* --- v1.2: multi-photo tiles in the edit form --- */
.current-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.current-image-tile { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #f8faf7; cursor: pointer; }
.current-image-tile img { display: block; width: 100%; height: 92px; object-fit: cover; }
.current-image-tile span { display: flex; align-items: center; gap: 6px; padding: 8px 10px; color: #972d2d; font-size: 0.74rem; font-weight: 850; }
.current-image-tile input { width: 15px; height: 15px; accent-color: #b03030; }

/* --- v1.3: gallery manager --- */
.gallery-panel { margin-top: 22px; }
.gallery-upload-form { max-width: 560px; }
.gallery-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.gallery-tile { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #f8faf7; }
.gallery-tile img { display: block; width: 100%; height: 118px; object-fit: cover; }
.gallery-tile-badge { position: absolute; top: 7px; left: 7px; padding: 3px 8px; border-radius: 999px; color: white; background: rgba(9, 32, 20, 0.82); font-size: 0.64rem; font-weight: 950; letter-spacing: 0.04em; }
.gallery-tile-name { padding: 7px 9px 0; color: var(--muted); font-size: 0.68rem; font-weight: 800; overflow-wrap: anywhere; }
.gallery-tile-actions { display: flex; gap: 5px; padding: 7px 9px 9px; }
.gallery-tile-actions form { display: inline; }
.gallery-tile-actions button { min-height: 30px; min-width: 32px; padding: 4px 8px; border: 1px solid #b9d2bf; border-radius: 8px; color: var(--green-900); background: #f4faf5; font-size: 0.72rem; font-weight: 900; cursor: pointer; }
.gallery-tile-actions button:hover { background: #e8f4ea; }
.gallery-tile-actions button:disabled { opacity: 0.4; cursor: default; }
.gallery-tile-actions .tile-delete { margin-left: auto; border-color: #e4bbbb; color: #9a2d2d; background: #fff7f7; }
.gallery-tile-actions .tile-delete:hover { background: #ffe9e9; }
@media (max-width: 520px) { .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }

/* --- v1.4: months checkbox grid --- */
.months-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.month-check { min-height: 40px; padding: 7px 6px; justify-content: center; }
.month-check span { font-size: 0.7rem; }
@media (max-width: 760px) { .months-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px) { .months-grid { grid-template-columns: repeat(3, 1fr); } }
