:root {
  --cms-bg: #0f1c12;
  --cms-panel: #15251a;
  --cms-line: rgba(255,255,255,.08);
}

.cms-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: #f4f7f3; align-items: start; }
/* Held against the top of the viewport so the nav stays reachable on long pages
   like Inquiries. `align-self: start` leaves the track taller than the sidebar,
   which is what gives sticky room to hold; stretching to the row height would
   pin it in place and it would scroll away with the page. */
.cms-side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--cms-bg);
  color: #e7f5ea;
  padding: 24px 16px;
}
.cms-side a { color: #d7eadb; display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.cms-side a:hover, .cms-side a.is-active { background: rgba(34,197,94,.18); color: #fff; }
/* Mirrors the public site's navbar lockup, recoloured for the dark sidebar. The
   `.cms-side a` rules below turn every sidebar link into a padded nav row, which
   the brand has to opt out of. */
.cms-side .cms-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 28px;
  padding: 0;
  border-radius: 0;
  font-weight: inherit;
  text-decoration: none;
}
.cms-side .cms-brand:hover { background: transparent; }
.cms-brand img { height: 40px; width: auto; flex-shrink: 0; }
.cms-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
  font-family: var(--be-font-display);
}
.cms-brand__name { font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: #fff; }
/* "Energreen" is nested inside the name, so it picks this up alongside the
   tagline and the two read as one green wordmark, exactly as on the site. */
.cms-brand__text span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: #4ade80;
}
.cms-main { padding: 28px 32px; }
.cms-card { background: #fff; border: 1px solid #e6ebef; border-radius: 16px; padding: 20px; box-shadow: 0 10px 30px rgba(15,28,18,.04); }
.cms-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 24px; }
.cms-stat { background: #fff; border-radius: 16px; padding: 18px; border: 1px solid #e6ebef; }
.cms-stat strong { display: block; font-size: 28px; color: #16a34a; }
.cms-table { width: 100%; border-collapse: collapse; }
.cms-table th, .cms-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eef2ee; font-size: 14px; vertical-align: top; }
.cms-login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0f1c12, #166534); }
.cms-login .cms-card { width: min(420px, 92vw); }
.cms-login h1 { font-size: 1.5rem; margin-bottom: 8px; }
.cms-actions { display: flex; gap: 8px; flex-wrap: nowrap; flex-shrink: 0; align-items: center; }
.cms-error { color: #b91c1c; margin: 8px 0; }
.cms-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #eef2ee; }

.cms-btn-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #dc2626;
  background: #dc2626;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}
.cms-btn-delete:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

.cms-upload { display: grid; gap: 8px; }
.cms-upload__label { font-size: 13px; font-weight: 700; color: #334155; }
.cms-upload__drop {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  transition: border-color .15s ease, background .15s ease;
}
.cms-upload__drop.is-dragging { border-color: #16a34a; background: #f0fdf4; }
.cms-upload__drop.is-busy { opacity: .7; }
.cms-upload__input { display: none; }
.cms-upload__hint { font-size: 12.5px; color: #64748b; }
.cms-upload__preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid #e6ebef;
  border-radius: 12px;
  background: #fff;
}
.cms-upload__preview img {
  width: 84px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: #f1f5f9;
  flex-shrink: 0;
}
.cms-upload__file,
.cms-upload__missing {
  display: grid;
  place-items: center;
  width: 84px;
  height: 56px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.cms-upload__missing { background: #fee2e2; color: #b91c1c; font-size: 20px; }
.cms-upload__meta { flex: 1; min-width: 0; }
.cms-upload__meta code {
  display: block;
  font-size: 12.5px;
  color: #475569;
  overflow-wrap: anywhere;
}
.cms-upload__error { margin: 6px 0 0; font-size: 12.5px; color: #b91c1c; line-height: 1.45; }

.cms-toasts {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 32px));
}
.cms-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .22);
  animation: cms-toast-in .22s ease-out;
}
.cms-toast--success { background: #14532d; }
.cms-toast--error { background: #7f1d1d; }
.cms-toast__dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}
.cms-toast--error .cms-toast__dot { background: #fca5a5; }
@keyframes cms-toast-in {
  from { opacity: 0; transform: translateY(-8px) translateX(8px); }
  to { opacity: 1; transform: none; }
}

/* Site buttons assume dark hero backgrounds — .be-btn-ghost is white on white
   here, so the CMS repaints them for its light panels. */
.cms-shell .be-btn { padding: 9px 18px; font-size: 14px; }
.cms-shell .be-btn-ghost {
  background: #fff;
  color: #334155;
  border-color: #d6dee6;
  backdrop-filter: none;
}
.cms-shell .be-btn-ghost:hover { background: #f1f5f9; color: #0f172a; }
.cms-shell .be-btn-danger {
  background: #fff;
  color: #b91c1c;
  border-color: #f0c6c6;
}
.cms-shell .be-btn-danger:hover { background: #fee2e2; color: #991b1b; border-color: #e0a3a3; }
.cms-side .be-btn-ghost { background: rgba(255,255,255,.10); color: #fff; border-color: rgba(255,255,255,.22); }
.cms-side .be-btn-ghost:hover { background: rgba(255,255,255,.18); color: #fff; }
