.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-loading__parent {
  min-height: 2.5rem;
}

.admin-drink-editor__image {
  display: block;
  width: 5rem;
  height: 5rem;
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  object-fit: contain;
}

.admin-drinks__catalog-help {
  margin: 0.4rem 0 1rem;
  color: var(--admin-muted);
  font-size: 0.875rem;
}

.admin-drinks__catalog-help summary {
  cursor: pointer;
  color: var(--admin-text);
  font-weight: 600;
}

.admin-loading [data-dash-is-loading="true"] {
  border-radius: 10px;
}

.admin-loading__parent > div:has(> .dash-spinner) {
  border-radius: 10px;
  background: color-mix(in srgb, var(--admin-panel-strong) 82%, transparent);
  backdrop-filter: blur(1px);
}

.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%
  );
}

/* Interactive and printable seating room plan. */
.seating-layout-modal .mantine-Modal-content {
  max-width: 96vw;
}

.guest-ui-preview-modal .mantine-Modal-content {
  max-width: 96vw;
  max-height: 96vh;
  overflow: auto;
}

.guest-ui-preview__shell {
  min-height: 80vh;
  background: #f5eee3;
}

.guest-ui-preview__header {
  position: sticky;
  z-index: 200;
  top: 0;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid rgba(97, 72, 58, 0.16);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(12px);
}

.guest-ui-preview__public-page {
  min-height: 0;
}

.public-seating-page--preview {
  min-height: 0;
  padding: clamp(1.25rem, 3vw, 2.75rem);
}

.public-seating-page--preview .public-seating-preview {
  width: min(100%, 80rem);
  margin: 0 auto;
}

.seating-layout__canvas {
  overflow: auto;
  padding: 0.25rem;
}

.seating-layout__room {
  position: relative;
  width: 100%;
  min-width: 880px;
  aspect-ratio: 1.414 / 1;
  overflow: hidden;
  border: 1px solid rgba(97, 72, 58, 0.25);
  border-radius: 16px;
  background: #fffdf8;
  box-shadow: inset 0 0 50px rgba(74, 55, 44, 0.04);
  color: #27312c;
  touch-action: none;
}

.seating-layout__print-title {
  position: absolute;
  top: 1.5rem;
  left: 1.75rem;
  color: #654b40;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.seating-layout__table {
  position: absolute;
  z-index: 2;
  width: var(--seating-table-size, 168px);
  height: var(--seating-table-size, 168px);
  transform: translate(-50%, -50%);
  cursor: grab;
  user-select: none;
  transition:
    filter 0.16s ease,
    box-shadow 0.16s ease;
}

.seating-layout__table--round {
  border-radius: 50%;
}

.seating-layout__table--square {
  border-radius: 10px;
}

.seating-layout__table-surface {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  overflow: hidden;
  padding: 0.8rem;
  border: 2px solid #9b7561;
  border-radius: inherit;
  background: linear-gradient(145deg, #fffdfa, #eee1d1);
  box-shadow:
    0 8px 18px rgba(71, 50, 40, 0.12),
    inset 0 0 0 5px rgba(255, 255, 255, 0.5);
  text-align: center;
}

.seating-layout__number {
  flex: 0 0 auto;
  color: #694d40;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
}

.seating-layout__guests {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(0.52rem, 0.72vw, 0.68rem);
  line-height: 1.16;
}

.seating-layout__guest {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seating-layout__table--dense .seating-layout__guests {
  font-size: clamp(0.46rem, 0.62vw, 0.58rem);
  line-height: 1.08;
}

.seating-layout__table--very-dense .seating-layout__guests {
  font-size: clamp(0.4rem, 0.54vw, 0.5rem);
  line-height: 1;
}

.seating-layout__count {
  flex: 0 0 auto;
  color: #766b64;
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
}

.seating-layout__table--dragging {
  z-index: 10;
  cursor: grabbing;
  filter: drop-shadow(0 12px 12px rgba(71, 50, 40, 0.23));
}

.seating-layout__table--saving {
  opacity: 0.72;
}

.seating-layout__table--saved .seating-layout__table-surface {
  border-color: #4f8159;
}

.seating-layout__table--error .seating-layout__table-surface {
  border-color: #b13d32;
}

/* ------------------------------------------------------------------ */
/* Kitchen sheet — headcount per table and the allergies to cook around */
/* ------------------------------------------------------------------ */

.kitchen-sheet {
  color: #2e312f;
  font-size: 14px;
}

.kitchen-sheet__header {
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid #2e312f;
}

.kitchen-sheet__title {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kitchen-sheet__summary {
  margin: 4px 0 0;
  color: #6a6d69;
  font-size: 13px;
}

.kitchen-sheet__table {
  padding: 10px 0;
  border-bottom: 1px solid #ddd8d2;
  break-inside: avoid;
}

.kitchen-sheet__table:last-child {
  border-bottom: 0;
}

.kitchen-sheet__table-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.kitchen-sheet__table-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kitchen-sheet__count {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.kitchen-sheet__table-allergies {
  padding: 1px 7px;
  border-radius: 9px;
  background: #fdf3f2;
  color: #b3261e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Name and waiter to the left, tallies to the right — grouped so the tallies
   stay put whether or not a table has a waiter. */
.kitchen-sheet__table-title,
.kitchen-sheet__table-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.kitchen-sheet__waiter {
  color: #6a6d69;
  font-size: 13px;
  white-space: nowrap;
}

.kitchen-sheet__guests {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.kitchen-sheet__guest {
  display: flex;
  gap: 8px;
  padding: 2px 0 2px 10px;
  border-left: 3px solid transparent;
  font-size: 13px;
}

/* Everyone at the table is listed, so the ones to cook around have to carry
   the eye on their own: a rule down the side, and the note in red beside a
   name set heavier than its neighbours. */
.kitchen-sheet__guest--allergy {
  border-left-color: #b3261e;
  background: #fdf3f2;
}

.kitchen-sheet__who {
  min-width: 12em;
}

.kitchen-sheet__guest--allergy .kitchen-sheet__who {
  font-weight: 700;
}

.kitchen-sheet__what {
  color: #b3261e;
  font-weight: 600;
}

.kitchen-sheet__what::before {
  content: "— ";
}

.kitchen-sheet__none {
  margin: 6px 0 0;
  color: #8a8d88;
  font-size: 13px;
  font-style: italic;
}

@page {
  size: A4 landscape;
  margin: 8mm;
}

/* The sheet is a column of text that can run past one page, so printing it
   copies it into this holder as a direct child of <body>. The room plan's
   `position: fixed` print area cannot be reused here — fixed elements are
   clipped to the first page, which would silently drop later tables. Nor can
   a named `@page` set the orientation; the print script injects that instead.
   Everything else on the page is display:none'd so the sheet paginates on its
   own. */
.kitchen-print-holder {
  display: none;
}

@media print {
  body > *:not(.kitchen-print-holder) {
    display: none !important;
  }

  .kitchen-print-holder {
    display: block !important;
    background: #fff;
  }

  .kitchen-print-holder,
  .kitchen-print-holder * {
    visibility: visible !important;
  }

  .kitchen-sheet__table {
    padding: 7px 0;
  }

  /* Printers are asked not to drop the tint behind an allergy — it is the
     one thing on this sheet that must survive a black-and-white kitchen
     printer, so the side rule carries it if the tint is dropped anyway. */
  .kitchen-sheet__guest--allergy {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .kitchen-sheet__guest {
    break-inside: avoid;
  }
}

@media print {
  body * {
    visibility: hidden !important;
  }

  .seating-layout-print-area,
  .seating-layout-print-area * {
    visibility: visible !important;
  }

  .seating-layout-print-area {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: #fff;
  }

  .seating-layout__room {
    width: 100%;
    min-width: 0;
    height: 100%;
    border: 1px solid #b9afa7;
    border-radius: 0;
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .seating-layout__table {
    width: var(--seating-table-print-size, 34mm);
    height: var(--seating-table-print-size, 34mm);
  }

  .seating-layout__guests {
    font-size: 6.5pt;
  }

  .seating-layout__table--dense .seating-layout__guests {
    font-size: 5.5pt;
  }

  .seating-layout__table--very-dense .seating-layout__guests {
    font-size: 4.5pt;
  }
}
