:root {
  --paper: #f6f1e8;
  --panel: #fffdf8;
  --ink: #182629;
  --muted: #66787d;
  --line: rgba(24, 38, 41, 0.13);
  --blue: #2d83a0;
  --blue-deep: #103d55;
  --danger: #ad3434;
  --shadow: 0 22px 60px rgba(16, 61, 85, 0.12);
  --sans: "Avenir Next", "Segoe UI", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  color: #fffdf8;
  background: var(--blue-deep);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

button:hover,
button:focus-visible {
  background: var(--blue);
  transform: translateY(-1px);
}

.ghost-button {
  color: var(--blue-deep);
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid var(--line);
}

.danger-button {
  color: #fffdf8;
  background: var(--danger);
}

.login-view {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(16, 61, 85, 0.82), rgba(45, 131, 160, 0.46)),
    url("https://images.unsplash.com/photo-1414235077428-338989a2e8c0?auto=format&fit=crop&w=1600&q=76")
      center / cover;
}

.login-card {
  width: min(440px, 100%);
  padding: clamp(24px, 5vw, 38px);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--blue-deep);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1;
}

.login-card h1 {
  max-width: 100%;
  font-size: clamp(2.35rem, 7vw, 3.25rem);
  overflow-wrap: break-word;
  text-wrap: balance;
}

.login-copy,
.help-text,
.form-message {
  color: var(--muted);
}

.login-form,
.editor-form,
fieldset {
  display: grid;
  gap: 16px;
}

.login-form {
  margin: 28px 0 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--blue-deep);
  font-size: 0.82rem;
  font-weight: 900;
}

.label-row {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.info-dot {
  width: 19px;
  min-width: 19px;
  height: 19px;
  min-height: 19px;
  padding: 0;
  border: 1px solid rgba(45, 131, 160, 0.35);
  color: var(--blue-deep);
  background: rgba(255, 253, 248, 0.94);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  text-transform: lowercase;
}

.info-dot:hover,
.info-dot:focus-visible {
  color: #fffdf8;
  background: var(--blue);
  transform: none;
}

.info-popover {
  position: fixed;
  z-index: 40;
  max-width: min(280px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid rgba(45, 131, 160, 0.22);
  border-radius: 7px;
  color: var(--ink);
  background: #fffdf8;
  box-shadow: 0 16px 36px rgba(16, 61, 85, 0.16);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fffdf8;
  font-weight: 500;
}

textarea {
  resize: vertical;
}

.admin-view {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 34px);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-lockup img {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 14px 34px rgba(16, 61, 85, 0.13);
}

.brand-lockup h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.status-badge {
  display: inline-grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid rgba(45, 131, 160, 0.28);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--blue-deep);
  background: rgba(255, 253, 248, 0.76);
  font-size: 0.78rem;
  font-weight: 900;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
}

.tabs button {
  color: var(--blue-deep);
  background: transparent;
}

.tabs button.is-active {
  color: #fffdf8;
  background: var(--blue-deep);
}

.panel {
  display: none;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow);
}

.panel.is-active {
  display: block;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.panel-heading h2 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.dish-admin-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 28px);
}

.dish-list-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.filters {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(246, 241, 232, 0.72);
}

.mobile-dish-picker {
  display: none;
}

.admin-dish-list {
  display: grid;
  gap: 15px;
}

.dish-list-group {
  display: grid;
  gap: 7px;
}

.dish-list-group h3 {
  margin: 0;
  color: var(--blue-deep);
  font-size: 0.88rem;
  font-weight: 900;
}

.dish-list-items {
  display: grid;
  gap: 8px;
  padding-left: 10px;
  border-left: 2px solid rgba(45, 131, 160, 0.24);
}

.dish-list-item {
  display: grid;
  justify-content: stretch;
  align-items: start;
  gap: 4px;
  width: 100%;
  min-height: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  color: var(--ink);
  background: #fffdf8;
  text-align: left;
}

.dish-list-item.is-active {
  border-color: rgba(45, 131, 160, 0.48);
  background: rgba(220, 233, 233, 0.5);
}

.dish-list-item span {
  color: var(--muted);
  font-size: 0.78rem;
}

.dish-list-item strong {
  font-size: 0.92rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

fieldset {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

legend {
  padding: 0 8px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

legend .info-dot {
  margin-left: 7px;
  vertical-align: middle;
}

.field-block {
  display: grid;
  gap: 7px;
  color: var(--blue-deep);
  font-size: 0.82rem;
  font-weight: 900;
}

.allergen-selector {
  position: relative;
}

.allergen-toggle {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fffdf8;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  white-space: normal;
}

.allergen-toggle:hover,
.allergen-toggle:focus-visible {
  color: var(--ink);
  background: #fffdf8;
  transform: none;
}

.allergen-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 16px 34px rgba(16, 61, 85, 0.14);
}

.allergen-option {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.84rem;
  cursor: pointer;
}

.allergen-option:hover {
  background: rgba(220, 233, 233, 0.55);
}

.allergen-option input {
  width: auto;
}

.allergen-option strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.5fr);
  gap: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-label input {
  width: auto;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.action-with-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.form-actions button:not(.info-dot),
.panel-heading .action-with-help > button,
.admin-actions button,
.tabs button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.82rem;
}

.form-actions .action-with-help {
  flex: 0 0 auto;
}

.form-message {
  min-height: 20px;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.form-message.is-error {
  color: var(--danger);
}

.form-message.is-success {
  color: var(--blue-deep);
}

.form-message.is-pending {
  color: var(--blue);
}

.help-text {
  margin: -8px 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .admin-header,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-actions {
    justify-content: flex-start;
  }

  .dish-admin-layout,
  .form-grid,
  .image-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .mobile-dish-picker {
    display: grid;
  }

  .admin-dish-list {
    display: none;
  }
}

@media (max-width: 560px) {
  .admin-view {
    padding: 12px;
  }

  .panel,
  .login-card {
    border-radius: 6px;
  }

  .brand-lockup img {
    width: 52px;
    height: 52px;
  }

  .form-actions button:not(.info-dot) {
    min-height: 40px;
  }
}
