:root {
  --brand: #6d1a36;
  --gold: #d8a23a;
  --green: #198754;
  --ink: #111827;
  --muted: #6b7280;
  --surface: #ffffff;
}

body.admin-body {
  margin: 0;
  background: #f3f4f6;
  color: var(--ink);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--brand);
  color: #fff;
  padding: 1.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-brand {
  color: #fff;
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  text-decoration: none;
}

.admin-sidebar nav {
  display: grid;
  gap: .35rem;
}

.admin-sidebar a {
  align-items: center;
  border-radius: .5rem;
  color: rgba(255, 255, 255, .9);
  display: flex;
  gap: .6rem;
  padding: .7rem .75rem;
  text-decoration: none;
}

.admin-sidebar a:hover {
  background: rgba(255, 255, 255, .13);
  color: #fff;
}

.admin-main {
  padding: 1.5rem;
  min-width: 0;
}

.admin-topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.admin-topbar h1 {
  color: var(--brand);
  font-size: 1.7rem;
  font-weight: 800;
  margin: 0;
}

.panel-card {
  background: var(--surface);
  border: 0;
  border-radius: .5rem;
  box-shadow: 0 10px 30px rgba(17, 24, 39, .08);
}

.table-responsive {
  border-radius: .5rem;
}

.summary-card {
  background: #fff;
  border-left: 5px solid var(--brand);
  border-radius: .5rem;
  box-shadow: 0 10px 30px rgba(17, 24, 39, .07);
  padding: 1.15rem;
}

.summary-card strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.summary-card-label {
  font-size: 1.05rem !important;
  line-height: 1.2 !important;
  margin-top: .35rem;
}

.stats-bars {
  align-items: end;
  display: grid;
  gap: .7rem;
  grid-auto-flow: column;
  grid-auto-columns: minmax(42px, 1fr);
  min-height: 230px;
  overflow-x: auto;
  padding-bottom: .35rem;
}

.stats-bar-item {
  align-items: center;
  display: grid;
  gap: .35rem;
  min-width: 42px;
  text-align: center;
}

.stats-bar-value {
  color: var(--brand);
  font-size: .85rem;
  font-weight: 800;
}

.stats-bar-track {
  align-items: end;
  background: #f1f5f9;
  border-radius: .45rem;
  display: flex;
  height: 160px;
  justify-content: center;
  overflow: hidden;
  width: 100%;
}

.stats-bar-track span {
  background: linear-gradient(180deg, var(--gold), var(--brand));
  border-radius: .45rem .45rem 0 0;
  display: block;
  min-height: 8px;
  width: 100%;
}

.stats-list {
  display: grid;
  gap: .9rem;
}

.stats-list-row {
  display: grid;
  gap: .35rem;
}

.stats-progress {
  background: #f1f5f9;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.stats-progress span {
  background: var(--brand);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn {
  min-height: 42px;
}

.business-action-grid {
  display: grid;
  gap: .7rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.business-action-grid .btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 46px;
}

.btn-brand:hover {
  background: #551429;
  border-color: #551429;
  color: #fff;
}

.brand-text {
  color: var(--brand);
}

.future-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.future-card h2 {
  color: var(--brand);
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0;
}

.future-card h3 {
  font-size: .9rem;
  font-weight: 800;
  margin: .9rem 0 .45rem;
  text-transform: uppercase;
}

.future-card ul {
  margin-bottom: 0;
  padding-left: 1.1rem;
}

.future-cost {
  align-items: center;
  color: #166534;
  display: flex;
  font-weight: 700;
  gap: .45rem;
}

.future-files {
  background: #f8fafc;
  border-radius: .5rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88rem;
  margin: 0;
  padding: .75rem;
  word-break: break-word;
}

.menu-table input[type="checkbox"] {
  height: 1.25rem;
  width: 1.25rem;
}

.menu-builder {
  display: grid;
  gap: .85rem;
}

.menu-builder-row {
  align-items: end;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  display: grid;
  gap: .75rem;
  grid-template-columns: 1fr 1.2fr 1.2fr 100px 150px auto;
  padding: .9rem;
}

.menu-checks {
  display: grid;
  gap: .2rem;
  padding-bottom: .2rem;
}

.menu-checks .form-check {
  margin: 0;
  min-height: 0;
}

.admin-editor-form .editor-section {
  border-top: 1px solid #e5e7eb;
  margin-top: 1.4rem;
  padding-top: 1.25rem;
}

.admin-editor-form .editor-section:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.admin-editor-form .editor-section h3 {
  color: var(--brand);
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: .85rem;
}

.admin-preview-img {
  border-radius: .5rem;
  height: 90px;
  max-width: 180px;
  object-fit: cover;
}

.content-editor-list {
  display: grid;
  gap: .9rem;
}

.content-editor-row {
  align-items: start;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  display: flex;
  gap: .9rem;
  padding: .9rem;
}

.content-editor-row > img {
  border-radius: .45rem;
  height: 110px;
  object-fit: cover;
  width: 160px;
}

.content-editor-actions {
  align-items: stretch;
  display: grid;
  gap: .45rem;
  min-width: 110px;
}

.page-media-admin-list {
  display: grid;
  gap: .85rem;
}

.page-media-admin-row {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  display: grid;
  gap: .85rem;
  grid-template-columns: 170px 1fr;
  padding: .85rem;
}

.page-media-preview {
  aspect-ratio: 4 / 3;
  background: #e5e7eb;
  border-radius: .45rem;
  overflow: hidden;
}

.page-media-preview img {
  height: 100%;
  object-fit: cover;
  object-position: var(--crop-x, 50%) var(--crop-y, 50%);
  transform: scale(var(--crop-zoom, 1));
  width: 100%;
}

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    height: auto;
    position: static;
    padding: 1rem;
  }

  .admin-brand {
    margin-bottom: .85rem;
  }

  .admin-sidebar nav {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .25rem;
    scrollbar-width: thin;
  }

  .admin-sidebar a {
    flex: 0 0 auto;
    min-height: 42px;
    white-space: nowrap;
  }

  .admin-main {
    padding: 1rem;
  }

  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: .35rem;
  }

  .admin-topbar h1 {
    font-size: 1.55rem;
  }

  .summary-card strong {
    font-size: 1.7rem;
  }

  .menu-builder-row {
    grid-template-columns: 1fr;
  }

  .content-editor-row {
    flex-direction: column;
  }

  .content-editor-row > img {
    height: 180px;
    width: 100%;
  }

  .content-editor-actions {
    width: 100%;
  }

  .page-media-admin-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .admin-sidebar {
    border-bottom-left-radius: .75rem;
    border-bottom-right-radius: .75rem;
  }

  .admin-main {
    padding: .85rem;
  }

  .panel-card .card-body,
  .summary-card {
    padding: 1rem;
  }

  .business-action-grid {
    grid-template-columns: 1fr;
  }

  .d-flex.flex-wrap.gap-2 .btn {
    flex: 1 1 100%;
  }
}
