.admin-shell {
  --admin-bg: #fcfaf6;
  --admin-panel: rgba(255, 255, 255, 0.74);
  --admin-panel-strong: rgba(255, 255, 255, 0.9);
  --admin-line: rgba(34, 46, 38, 0.14);
  --admin-line-strong: rgba(34, 46, 38, 0.22);
  --admin-text: #1d2722;
  --admin-muted: #5c665f;
  --admin-accent: #8d6353;
  --admin-accent-soft: rgba(141, 99, 83, 0.12);
  --admin-header-offset: var(--app-shell-header-offset, 72px);
}

.admin-shell__main {
  min-height: 100vh;
  padding-top: var(--admin-header-offset);
  padding-inline: 0;
  padding-bottom: 0;
  color: var(--admin-text);
  background:
    radial-gradient(circle at top left, rgba(141, 99, 83, 0.12), transparent 26%),
    linear-gradient(180deg, #fdfaf5 0%, #fffdf9 44%, #f5efe6 100%);
}

.admin-shell__header {
  background: rgba(252, 250, 246, 0.94);
  border-bottom: 1px solid var(--admin-line);
  backdrop-filter: blur(10px);
}

.admin-shell__header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
}

.admin-shell__brand {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.admin-shell__eyebrow {
  margin: 0;
  color: var(--admin-accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.admin-shell__identity {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-shell__identity-text {
  display: grid;
  gap: 0.05rem;
  text-align: right;
}

.admin-shell__groups {
  line-height: 1.3;
}

.admin-shell__identity .mantine-ActionIcon-root {
  border: 1px solid var(--admin-line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--admin-text);
}

.admin-shell__identity .mantine-ActionIcon-root:hover {
  border-color: rgba(141, 99, 83, 0.32);
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
}

.admin-shell__identity .mantine-Anchor-root {
  color: var(--admin-text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.admin-shell__identity .mantine-Anchor-root:hover {
  color: var(--admin-accent);
}

.admin-shell__body {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
  padding: 1.1rem 1.25rem 2rem;
  align-items: start;
}

.admin-shell__sidebar,
.admin-shell__page {
  min-width: 0;
}

.admin-shell__sidebar {
  position: sticky;
  top: calc(var(--admin-header-offset) + 1rem);
  align-self: start;
}

.admin-shell__sidebar-panel {
  padding: 0.15rem 0;
}

.admin-shell__sidebar-stack .mantine-NavLink-root {
  padding: 0.7rem 0.2rem;
  border-left: 2px solid transparent;
  border-radius: 0;
  color: rgba(29, 39, 34, 0.74);
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.admin-shell__sidebar-stack .mantine-NavLink-root:hover {
  background: transparent;
  border-left-color: rgba(141, 99, 83, 0.28);
  color: var(--admin-text);
}

.admin-shell__sidebar-stack .mantine-NavLink-root[data-active] {
  background: transparent;
  border-left-color: var(--admin-accent);
  color: var(--admin-accent);
}

.admin-shell__sidebar-stack .mantine-NavLink-label {
  font-size: 0.86rem;
  font-weight: 600;
}

.admin-shell__mobile-nav {
  display: none;
}

.admin-shell__mobile-links {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0 0 0.85rem;
  scrollbar-width: none;
}

.admin-shell__mobile-links::-webkit-scrollbar {
  display: none;
}

.admin-shell__mobile-link {
  flex: 0 0 auto;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
  color: rgba(29, 39, 34, 0.7);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    color 0.18s ease,
    border-color 0.18s ease;
}

.admin-shell__mobile-link:hover,
.admin-shell__mobile-link.is-active {
  border-color: rgba(141, 99, 83, 0.45);
  color: var(--admin-text);
}

.admin-page-shell {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.admin-page-shell .mantine-Paper-root {
  border-radius: 10px;
  background: var(--admin-panel);
  box-shadow: none;
}

.admin-page-shell .mantine-Title-root {
  color: var(--admin-text);
  letter-spacing: -0.02em;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-weight: 600;
}

.admin-page-shell .mantine-Text-root {
  color: var(--admin-muted);
}

.admin-page-shell .mantine-Button-root,
.admin-page-shell .mantine-ActionIcon-root {
  border-radius: 10px;
}

.admin-page-shell .mantine-Input-input,
.admin-page-shell .mantine-Textarea-input {
  border-radius: 8px;
  border-color: var(--admin-line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--admin-text);
}

.admin-page-shell .mantine-Input-input::placeholder,
.admin-page-shell .mantine-Textarea-input::placeholder {
  color: rgba(92, 102, 95, 0.74);
}

.admin-public-site__save-bar {
  position: sticky;
  top: calc(var(--admin-header-offset) + 0.9rem);
  z-index: 20;
  background: var(--admin-panel-strong);
  backdrop-filter: blur(8px);
  border: 1px solid var(--admin-line-strong);
}

.admin-public-site__save-indicator {
  text-align: right;
}

.admin-public-site__save-indicator--saved {
  color: #4f6b53;
}

.admin-public-site__save-indicator--dirty {
  color: #9b3d2d;
  font-weight: 600;
}

.admin-page-shell .ag-root-wrapper {
  border: 1px solid var(--admin-line-strong);
  border-radius: 10px;
  overflow: hidden;
}

.admin-page-shell .ag-header {
  background: rgba(244, 237, 228, 0.72);
}

.admin-shell__quick-links {
  gap: 0.8rem;
}

.admin-shell__quick-links .admin-shell__quick-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(29, 39, 34, 0.24);
  color: var(--admin-text);
  font-weight: 600;
  text-decoration: none;
  transition:
    color 0.18s ease,
    border-color 0.18s ease;
}

.admin-shell__quick-links .admin-shell__quick-link:hover {
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}

.admin-shell__hint {
  text-align: center;
  color: var(--admin-muted);
}

@media (max-width: 48em) {
  .admin-shell__header-inner {
    align-items: flex-start;
    padding: 0.85rem 1rem;
  }

  .admin-shell__identity {
    justify-content: space-between;
    width: 100%;
  }

  .admin-shell__identity-text {
    text-align: left;
  }

  .admin-shell__groups {
    display: none;
  }

  .admin-shell__mobile-nav {
    display: block;
    position: sticky;
    top: var(--admin-header-offset);
    z-index: 15;
    padding: 0.75rem 1rem 0;
    background: linear-gradient(
      180deg,
      rgba(252, 250, 246, 0.97) 0%,
      rgba(252, 250, 246, 0.86) 72%,
      rgba(252, 250, 246, 0) 100%
    );
  }

  .admin-shell__body {
    grid-template-columns: 1fr;
    padding: 0.75rem 1rem 2rem;
  }

  .admin-shell__sidebar {
    display: none;
  }

  .admin-page-shell {
    padding-left: 0;
    padding-right: 0;
  }

  .admin-public-site__save-bar {
    top: calc(var(--admin-header-offset) + 3.6rem);
  }
}

[data-mantine-color-scheme="dark"] .admin-shell {
  --admin-bg: #1d2024;
  --admin-panel: rgba(30, 33, 38, 0.78);
  --admin-panel-strong: rgba(30, 33, 38, 0.94);
  --admin-line: rgba(226, 209, 181, 0.16);
  --admin-line-strong: rgba(226, 209, 181, 0.24);
  --admin-text: #ece2d2;
  --admin-muted: rgba(236, 226, 210, 0.78);
  --admin-accent: #d6ad9b;
  --admin-accent-soft: rgba(214, 173, 155, 0.14);
}

[data-mantine-color-scheme="dark"] .admin-shell__main {
  background:
    radial-gradient(circle at top left, rgba(131, 96, 42, 0.2), transparent 26%),
    linear-gradient(180deg, #1f2227 0%, #20242a 48%, #1c1f24 100%);
}

[data-mantine-color-scheme="dark"] .admin-shell__header {
  background: rgba(24, 27, 31, 0.92);
}

[data-mantine-color-scheme="dark"] .admin-shell__identity .mantine-ActionIcon-root {
  background: rgba(36, 40, 46, 0.86);
  color: var(--admin-text);
}

[data-mantine-color-scheme="dark"] .admin-shell__page .mantine-Text-root {
  color: var(--admin-muted);
}

[data-mantine-color-scheme="dark"] .admin-page-shell .mantine-Input-input,
[data-mantine-color-scheme="dark"] .admin-page-shell .mantine-Textarea-input {
  background: rgba(24, 27, 31, 0.9);
  color: var(--admin-text);
}

[data-mantine-color-scheme="dark"] .admin-page-shell .ag-header {
  background: rgba(50, 54, 61, 0.92);
}

[data-mantine-color-scheme="dark"] .admin-public-site__save-indicator--saved {
  color: #8fbe96;
}

[data-mantine-color-scheme="dark"] .admin-public-site__save-indicator--dirty {
  color: #f2a28c;
}

[data-mantine-color-scheme="dark"] .admin-shell__mobile-nav {
  background: linear-gradient(
    180deg,
    rgba(24, 27, 31, 0.97) 0%,
    rgba(24, 27, 31, 0.86) 72%,
    rgba(24, 27, 31, 0) 100%
  );
}
