:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2933;
  background: #f5f7fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

button,
.top-actions a {
  border: 1px solid #b7c2d0;
  background: #fff;
  color: #172b4d;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: none;
}

main button,
.menu-row button {
  border-color: #93a4b8;
  background: linear-gradient(#ffffff, #f3f6fb);
  color: #172b4d;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

main button:hover,
.menu-row button:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

main button:active,
.menu-row button:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.16);
}

button:hover,
.top-actions a:hover {
  background: #edf2f7;
}

.topbar {
  min-height: 72px;
  padding: 16px 20px;
  background: #162131;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar > div {
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.eyebrow {
  margin: 0 0 2px;
  color: #b7c2d0;
  font-size: 13px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  max-width: 920px;
  margin: 0 auto;
  align-items: start;
}

.layout:not(.is-editor-open) {
  grid-template-columns: minmax(0, 1fr);
  max-width: 920px;
}

.layout.is-editor-open {
  max-width: 920px;
}

.list-pane,
.editor-pane {
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 16px;
}

.editor-pane.is-collapsed {
  display: none;
}

.editor-pane {
  margin: 0;
}

.layout.is-editor-open .menu-list-head,
.layout.is-editor-open .menu-list-status,
.layout.is-editor-open .menu-list-help,
.layout.is-editor-open .menu-list-categories,
.layout.is-editor-open .menu-list {
  display: none;
}

.pane-head,
.item-name-row,
.options-head,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quick-add-btn {
  white-space: nowrap;
}

.item-name-row {
  align-items: stretch;
}

.item-name-row input {
  min-width: 0;
}

.item-name-row button {
  white-space: nowrap;
}

h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

.status {
  min-height: 24px;
  margin-bottom: 12px;
  color: #52606d;
}

.status.error {
  color: #b42318;
}

.list-help,
.option-help,
.form-help {
  margin: -4px 0 12px;
  color: #66788a;
  font-size: 13px;
  line-height: 1.45;
}

.entry-guide {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #c8d5e1;
  border-radius: 8px;
  background: #f8fbff;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

.entry-guide strong {
  color: #172b4d;
  font-size: 14px;
}

.option-help {
  margin: 0 0 14px;
}

.form-help {
  margin: -2px 0 10px;
}

.menu-list {
  display: grid;
  gap: 16px;
  max-height: none;
  min-height: 340px;
  overflow-y: visible;
  padding-right: 4px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.category-card {
  display: grid;
  gap: 10px;
  border: 1px solid #c8d5e1;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
  overflow: visible;
}

.menu-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
}

.category-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 0;
  padding: 4px 2px;
  background: transparent;
}

.category-items {
  display: grid;
  gap: 10px;
  padding: 0 2px 2px;
}

.category-title {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: #172b4d;
  font-weight: 800;
  font-size: 16px;
}

.category-title small {
  color: #66788a;
  font-size: 12px;
  font-weight: 600;
}

.menu-row.is-dragging {
  opacity: 0.55;
}

.menu-row.is-drop-target,
.category-row.is-drop-target {
  border-color: #2563eb;
  background: #eff6ff;
}

.menu-row.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
}

.menu-row.is-hidden {
  opacity: 0.55;
}

.menu-select {
  min-width: 0;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.menu-row .menu-select {
  border: 0;
  background: transparent;
  box-shadow: none;
  font-weight: inherit;
}

.menu-thumb {
  width: 84px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #edf2f7;
  color: #64748b;
  font-size: 12px;
}

.menu-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-info {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.menu-row-side {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.drag-handle {
  min-width: 34px;
  min-height: 34px;
  padding: 5px 8px;
  cursor: grab;
  line-height: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.row-move-buttons {
  display: flex;
  gap: 4px;
}

.row-move-btn {
  min-width: 31px;
  min-height: 31px;
  padding: 4px 7px;
  line-height: 1;
}

.row-move-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.menu-main,
.menu-select {
  min-width: 0;
}

.menu-name {
  font-weight: 700;
  font-size: 16px;
}

.menu-meta {
  margin-top: 3px;
  color: #172b4d;
  font-size: 15px;
  font-weight: 800;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  background: #edf2f7;
  color: #52606d;
  font-size: 12px;
  white-space: nowrap;
}

.badge.soldout {
  background: #fee4e2;
  color: #b42318;
}

.row-delete-btn {
  color: #b42318;
  border-color: #f4b4ad;
  background: linear-gradient(#fffafa, #fff0f0);
  padding: 6px 9px;
}

.row-hard-delete-btn,
.category-delete-btn {
  min-width: 54px;
  min-height: 32px;
  padding: 4px 10px;
  border-color: #dc2626;
  background: linear-gradient(#dc2626, #b91c1c);
  color: #fff;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.row-edit-btn {
  min-height: 32px;
  padding: 5px 12px;
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 800;
  white-space: nowrap;
}

.row-edit-btn:hover {
  background: #eff6ff;
}

.hidden {
  display: none !important;
}

.row-hard-delete-btn:hover,
.category-delete-btn:hover {
  background: linear-gradient(#b91c1c, #991b1b);
}

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

label,
.wide-label {
  display: grid;
  gap: 6px;
  color: #334e68;
  font-size: 14px;
}

label:focus-within,
.wide-label:focus-within {
  color: #172b4d;
}

.hint {
  color: #7b8794;
  font-size: 12px;
  line-height: 1.35;
}

.hint a {
  color: #1d4ed8;
}

.image-field {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.wide-label .image-field {
  grid-column: 1 / -1;
}

.image-preview {
  display: grid;
  place-items: center;
  width: 112px;
  aspect-ratio: 4 / 3;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #f8fafc;
  color: #7b8794;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-controls {
  display: grid;
  gap: 8px;
  min-width: 0;
}

input[type="file"] {
  width: 100%;
  max-width: 100%;
  color: #334e68;
  font: inherit;
}

.visually-hidden-file {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

.custom-file-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.custom-file-button {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid #0f766e;
  border-radius: 6px;
  background: #ffffff;
  color: #0f766e;
  font-weight: 850;
  padding: 7px 12px;
}

.custom-file-name {
  min-width: 0;
  color: #52606d;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input[type="text"],
input[type="number"],
input:not([type]),
textarea {
  width: 100%;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  padding: 9px 10px;
}

input[type="text"]:focus,
input[type="number"]:focus,
input:not([type]):focus,
textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  outline: none;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

input[readonly] {
  background: #f1f5f9;
  color: #66788a;
  cursor: not-allowed;
}

.wide-label {
  margin-top: 12px;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 14px 0 18px;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.options-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 18px;
}

.option-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px 72px;
  gap: 8px;
}

.option-row button {
  padding: 8px;
}

.option-delete-btn {
  border-color: #f4b4ad;
  background: linear-gradient(#fffafa, #fff0f0);
  color: #b42318;
  font-weight: 700;
  white-space: nowrap;
}

.option-delete-btn:hover {
  background: #fee4e2;
}

#createBtn,
#updateBtn {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.22);
}

#createBtn:hover,
#updateBtn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

#updateBtn {
  background: #0f766e;
  border-color: #0f766e;
  box-shadow: 0 2px 4px rgba(15, 118, 110, 0.2);
}

#updateBtn:hover {
  background: #0d5f59;
  border-color: #0d5f59;
}

#deleteBtn {
  color: #b42318;
  border-color: #f4b4ad;
  background: linear-gradient(#fffafa, #fff0f0);
}

.secondary-action,
#addOptionBtn,
#clearBtn {
  border-color: #2563eb;
  color: #1d4ed8;
}

#deleteBtn:disabled,
#updateBtn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 640px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .form-grid,
  .option-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
  }

  .top-actions {
    align-items: center;
    flex-direction: row;
    justify-content: flex-end;
    gap: 5px;
  }

  .list-pane,
  .editor-pane {
    padding: 12px;
  }

  .pane-head,
  .item-name-row,
  .options-head,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .pane-head button,
  .options-head button,
  .form-actions button,
  .top-actions button,
  .top-actions a {
    width: auto;
    text-align: center;
  }

  .top-actions .app-nav a,
  .top-actions > button {
    min-height: 28px !important;
    padding: 4px 7px !important;
    font-size: 12px !important;
  }

  .pane-head,
  .options-head {
    align-items: center;
    flex-direction: row;
  }

  .options-head {
    margin-bottom: 8px;
  }

  .pane-head button,
  .item-name-row button,
  .options-head button {
    width: auto;
    min-height: 32px;
    padding: 5px 9px;
    font-size: 13px;
  }

  .item-name-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .option-delete-btn {
    justify-self: end;
    min-height: 32px;
    padding: 5px 12px;
    font-size: 13px;
  }

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

  .form-actions button {
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .menu-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .category-row {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 7px;
    padding: 9px 8px;
  }

  .category-title {
    gap: 6px;
    font-size: 15px;
  }

  .category-items {
    gap: 7px;
    padding: 8px;
  }

  .menu-list {
    max-height: none;
    min-height: 0;
  }

  .menu-row-side {
    grid-column: 1 / -1;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 6px;
  }

  .drag-handle {
    min-width: 30px;
    min-height: 30px;
    padding: 4px 7px;
    font-size: 13px;
  }

  .row-move-buttons {
    order: 2;
  }

  .row-move-btn {
    min-width: 30px;
    min-height: 30px;
    padding: 4px 7px;
    font-size: 12px;
  }

  .badges {
    justify-content: flex-start;
  }

  .menu-name {
    font-size: 14px;
  }

  .menu-meta {
    font-size: 12px;
  }

  .badge {
    padding: 2px 6px;
    font-size: 11px;
  }

  .row-delete-btn {
    min-height: 30px;
    padding: 4px 7px;
    font-size: 12px;
  }

  .row-hard-delete-btn,
  .category-delete-btn {
    min-width: 52px;
    min-height: 30px;
    padding: 4px 8px;
    font-size: 12px;
  }

  label,
  .wide-label {
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
  }

  input[type="text"],
  input[type="number"],
  input:not([type]),
  textarea {
    min-height: 46px;
    padding: 11px 12px;
    font-size: 16px;
    line-height: 1.35;
  }

  .hint,
  .list-help,
  .option-help,
  .form-help {
    font-size: 12.5px;
    line-height: 1.55;
  }

  .checks {
    display: grid;
    gap: 10px;
    margin: 16px 0 20px;
  }

  .checks label {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #f8fbff;
    font-size: 14px;
  }

  .checks input {
    width: 20px;
    height: 20px;
  }

  .image-field {
    grid-template-columns: 1fr;
  }

  .image-preview {
    width: 100%;
    max-width: 220px;
  }

  .options-list {
    gap: 10px;
  }

  .option-row {
    padding: 10px;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #f8fbff;
  }

  .form-actions {
    margin: 4px 0 0;
  }

  #createBtn,
  #updateBtn {
    min-height: 42px;
    font-size: 14px;
  }
}

/* Prominent in-page title now that the shared header shows the store name. */
.menu-list-head h2 {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.1;
  letter-spacing: 0;
}

@media (max-width: 640px) {
  .menu-list-head h2 {
    font-size: 28px;
  }
}

/* Phone-like menu management layout */
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 26%, rgba(154, 185, 232, 0.22) 0 18%, transparent 34%),
    radial-gradient(circle at 88% 30%, rgba(154, 185, 232, 0.18) 0 20%, transparent 35%),
    linear-gradient(180deg, #ffffff 0%, #f4f8fd 100%);
}

.layout,
.layout:not(.is-editor-open),
.layout.is-editor-open {
  max-width: 560px;
  padding: 22px 14px 34px;
}

.list-pane {
  position: relative;
  overflow: hidden;
  border: 8px solid #172b4d;
  border-radius: 30px;
  background: #ffffff;
  box-shadow: 0 24px 56px rgba(23, 43, 77, 0.18);
  padding: 20px 16px 18px;
}

.list-pane::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 112px;
  height: 22px;
  border-radius: 0 0 18px 18px;
  background: #172b4d;
  transform: translateX(-50%);
  pointer-events: none;
}

.pane-head {
  position: relative;
  min-height: 48px;
  align-items: center;
  flex-direction: row;
  justify-content: center;
  padding: 18px 0 4px;
}

.pane-head h2 {
  margin: 0;
  color: #0f2a5f;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
}

.quick-add-btn {
  position: absolute;
  right: 0;
  bottom: 4px;
  min-height: 34px;
  border-color: #2aa79f;
  border-radius: 8px;
  background: #ffffff;
  color: #13847d;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(42, 167, 159, 0.13);
}

.status {
  min-height: 0;
  margin: 4px 0 8px;
  color: #64748b;
  font-size: 13px;
}

.list-help {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 14px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, #eef6ff, #f6fbff);
  color: #334e68;
  font-size: 13px;
  font-weight: 700;
}

.list-help::before {
  content: "i";
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #2aa79f;
  color: #ffffff;
  font-weight: 900;
}

.menu-list {
  gap: 12px;
  min-height: 0;
  padding: 0 2px 78px;
}

.category-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.category-row {
  margin: 0 0 10px;
  padding: 4px 0;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.category-title {
  color: #0f2a5f;
  font-size: 15px;
}

.category-title span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 18px;
  border-radius: 9px;
  background: linear-gradient(135deg, #28b7a8, #168d86);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(37, 167, 159, 0.18);
}

.category-title small {
  color: #7890a8;
  font-weight: 800;
}

.category-items {
  gap: 10px;
  padding: 0;
}

.menu-row {
  position: relative;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid #dbe6f2;
  border-radius: 16px;
  padding: 10px 10px 10px 8px;
  background: #ffffff;
  box-shadow: 0 7px 18px rgba(23, 43, 77, 0.08);
  cursor: pointer;
}

.menu-row.is-selected {
  border-color: #2aa79f;
  background: #f4fffd;
}

.menu-select {
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
}

.menu-thumb {
  width: 86px;
  border-radius: 14px;
  background: #eef3f8;
  box-shadow: inset 0 0 0 1px rgba(23, 43, 77, 0.05);
}

.menu-info {
  gap: 5px;
}

.menu-name {
  color: #0f2a5f;
  font-size: 17px;
  font-weight: 900;
}

.menu-meta {
  color: #0f2a5f;
  font-size: 18px;
  font-weight: 900;
}

.menu-row-side {
  grid-column: 2 / 3;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 8px;
}

.badges {
  justify-content: start;
}

.badge {
  border-radius: 999px;
  padding: 5px 10px;
  background: #edf2f7;
  color: #52606d;
  font-size: 12px;
  font-weight: 900;
}

.badge.active {
  background: #dff8f2;
  color: #13847d;
}

.badge.soldout {
  background: #ffe7ee;
  color: #c0264c;
}

.drag-handle,
.row-move-btn,
.row-delete-btn,
.row-hard-delete-btn,
.category-delete-btn {
  min-width: 28px;
  min-height: 28px;
  padding: 3px 7px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: none;
}

.row-move-buttons {
  gap: 3px;
}

.row-edit-btn {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-color: #c8d5e1;
  border-radius: 12px;
  background: #ffffff;
  color: #0f2a5f;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 3px 9px rgba(23, 43, 77, 0.08);
}

.row-delete-btn,
.row-hard-delete-btn,
.category-delete-btn {
  opacity: 0.78;
}

.layout.is-editor-open .list-pane {
  padding: 18px 16px 16px;
}

.editor-pane {
  border: 0;
  background: #ffffff;
  padding: 0;
}

.entry-guide {
  position: relative;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 6px;
  margin: 10px 0 20px;
  padding: 18px 0 8px;
  border: 0;
  background: transparent;
  text-align: center;
}

.entry-guide strong {
  grid-column: 2;
  color: #0f2a5f;
  font-size: 20px;
  font-weight: 900;
}

.entry-guide span {
  grid-column: 1 / -1;
  display: inline-flex;
  justify-self: end;
  align-items: center;
  gap: 4px;
  color: #168d86;
  font-size: 12px;
  font-weight: 800;
}

.entry-guide span::before {
  content: "?";
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid #2aa79f;
  border-radius: 999px;
  font-size: 11px;
}

.editor-back-btn {
  grid-column: 1;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0f2a5f;
  font-size: 38px;
  line-height: 1;
  box-shadow: none;
}

.form-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.form-grid .wide-label {
  grid-column: 1 / -1;
}

label,
.wide-label {
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #0f2a5f;
  font-size: 14px;
  font-weight: 900;
}

label .hint,
.wide-label .hint {
  grid-column: 2;
  font-weight: 600;
}

input[type="text"],
input[type="number"],
input:not([type]) {
  min-height: 44px;
  border-color: #d2deea;
  border-radius: 10px;
  color: #0f2a5f;
  font-weight: 800;
}

.wide-label {
  margin-top: 12px;
}

.checks {
  display: grid;
  gap: 0;
  margin: 18px 0;
  border-top: 1px solid #e2eaf3;
  border-bottom: 1px solid #e2eaf3;
}

.checks label {
  min-height: 52px;
  grid-template-columns: 108px 1fr;
  border-bottom: 1px solid #edf2f7;
}

.checks label:last-child {
  border-bottom: 0;
}

.checks input {
  justify-self: end;
  width: 34px;
  height: 22px;
  accent-color: #2aa79f;
}

.options-head {
  margin: 0 0 10px;
}

.options-head h2 {
  color: #0f2a5f;
  font-size: 16px;
  font-weight: 900;
}

#addOptionBtn {
  border-color: #2aa79f;
  color: #168d86;
}

.option-row {
  grid-template-columns: minmax(0, 1fr) 92px 44px;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #edf2f7;
}

.option-delete-btn {
  min-width: 38px;
  padding: 8px;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.form-actions button {
  width: 100%;
  min-height: 52px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 900;
}

#clearBtn {
  order: 1;
  border: 0;
  background: #eef3fb;
  color: #0f2a5f;
}

#createBtn,
#updateBtn {
  order: 2;
  border-color: #1fa79e;
  background: linear-gradient(135deg, #28b7a8, #168d86);
  color: #ffffff;
}

@media (max-width: 520px) {
  .topbar {
    padding: 12px 14px;
  }

  .topbar h1 {
    font-size: 19px;
  }

  .layout,
  .layout:not(.is-editor-open),
  .layout.is-editor-open {
    padding: 10px 8px 24px;
  }

  .list-pane {
    border-width: 5px;
    border-radius: 24px;
    padding: 18px 10px 12px;
  }

  .pane-head {
    padding-top: 14px;
  }

  .pane-head h2 {
    font-size: 18px;
  }

  .quick-add-btn {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .menu-select {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
  }

  .menu-thumb {
    width: 76px;
  }

  .menu-name {
    font-size: 15px;
  }

  .menu-meta {
    font-size: 16px;
  }

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

  .menu-row-side .row-delete-btn,
  .menu-row-side .row-hard-delete-btn {
    display: none;
  }

  label,
  .wide-label,
  .checks label {
    grid-template-columns: 90px minmax(0, 1fr);
  }
}

/* Match the customer order screen layout for menu management. */
:root {
  --admin-bg: #f4f7fb;
  --admin-panel: #ffffff;
  --admin-line: #d7dee9;
  --admin-ink: #182230;
  --admin-sub: #5f6f82;
  --admin-accent: #0f8f7a;
  --admin-navy: #142033;
  --admin-shadow: 0 12px 28px rgba(18, 32, 51, 0.12);
}

body {
  color: var(--admin-ink);
  background:
    radial-gradient(circle at 12% 28%, rgba(47, 111, 237, 0.10) 0 140px, transparent 141px),
    radial-gradient(circle at 88% 40%, rgba(47, 111, 237, 0.10) 0 170px, transparent 171px),
    linear-gradient(180deg, #f8fbff 0, var(--admin-bg) 260px);
}

.topbar {
  width: 100%;
  min-height: 64px;
  margin: 0 auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  color: #ffffff;
  background: linear-gradient(120deg, #111b2c 0%, #17253a 58%, #15352f 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 28px rgba(18, 32, 51, 0.16);
}

.topbar h1 {
  font-size: 1.05rem;
  font-weight: 850;
}

.eyebrow {
  color: #b7c2d0;
  font-size: 11px;
}

.top-actions {
  justify-content: flex-end;
}

.layout,
.layout:not(.is-editor-open),
.layout.is-editor-open {
  width: min(460px, 100%);
  max-width: 460px;
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  padding: 0;
  background: #ffffff;
}

.list-pane {
  overflow: visible;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  background: #ffffff;
}

.list-pane::before {
  content: none;
}

.pane-head {
  min-height: 58px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  justify-content: normal;
  border-bottom: 0;
}

.pane-head h2 {
  justify-self: start;
  color: var(--admin-navy);
  font-size: 1.05rem;
  font-weight: 900;
}

.quick-add-btn {
  position: static;
  min-height: 34px;
  border: 1px solid var(--admin-accent);
  border-radius: 999px;
  background: #ffffff;
  color: var(--admin-accent);
  padding: 6px 12px;
  font-size: 0.86rem;
  box-shadow: none;
}

.menu-list-status {
  margin: 0 14px 6px;
}

.list-help {
  margin: 0 14px 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: #f4f8ff;
  color: #526174;
  font-size: 0.82rem;
  line-height: 1.45;
}

.list-help::before {
  width: 20px;
  height: 20px;
  background: var(--admin-accent);
}

.menu-list-categories {
  display: flex;
  flex-wrap: nowrap;
  gap: 24px;
  min-width: max-content;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 14px 8px;
  border-bottom: 1px solid var(--admin-line);
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.menu-list-categories button {
  flex: 0 0 auto;
  position: relative;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #31466b;
  padding: 8px 0;
  font-size: 0.96rem;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: none;
}

.category-tab-item {
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: auto minmax(0, auto) auto;
  align-items: center;
  gap: 4px;
  position: relative;
}

.category-tab-button {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-tab-move {
  width: 28px;
  min-width: 28px;
  min-height: 28px !important;
  border: 1px solid #c6d8fb !important;
  border-radius: 999px !important;
  background: #edf4ff !important;
  color: #1f4ea3 !important;
  padding: 0 !important;
  font-size: 18px !important;
  line-height: 1 !important;
}

.category-tab-move:disabled {
  opacity: 0.32;
}

.category-tab-item.is-dragging {
  opacity: 0.5;
}

.category-tab-item.is-drop-target .category-tab-button {
  color: var(--admin-accent);
}

.category-tab-item.is-drop-target::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 10px;
  bottom: 2px;
  width: 3px;
  border-radius: 99px;
  background: var(--admin-accent);
}

.category-tab-item.selected .category-tab-button {
  color: var(--admin-accent);
}

.category-tab-item.selected .category-tab-button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -9px;
  height: 4px;
  border-radius: 99px;
  background: var(--admin-accent);
}

.menu-list {
  display: grid;
  gap: 10px;
  padding: 12px 14px 28px;
}

.category-card {
  display: grid;
  gap: 10px;
}

.category-row {
  margin: 0;
  padding: 8px 10px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  border: 1px solid #dce5f1;
  border-radius: 12px;
  background: #f8fbff;
}

.category-title span {
  min-height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--admin-navy);
  box-shadow: none;
}

.category-title small {
  color: var(--admin-sub);
}

.category-items {
  display: grid;
  gap: 10px;
}

.menu-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px 10px;
  min-height: 108px;
  padding: 10px;
  border: 1px solid var(--admin-line);
  border-radius: 12px;
  background: var(--admin-panel);
  box-shadow: none;
}

.menu-row > .drag-handle {
  display: none;
}

.menu-row:hover {
  border-color: #aebbd0;
  box-shadow: 0 10px 22px rgba(18, 32, 51, 0.12);
}

.menu-select {
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
}

.menu-thumb {
  width: 88px;
  height: 72px;
  aspect-ratio: auto;
  border-radius: 8px;
  background: #e9edf3;
}

  .menu-info {
  align-content: center;
}

.menu-name {
  color: var(--admin-ink);
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.menu-description {
  color: var(--admin-sub);
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.menu-meta {
  margin-top: 6px;
  color: var(--admin-navy);
  font-size: 1.05rem;
  font-weight: 900;
}

.menu-row-side {
  grid-column: 1;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
}

.badges {
  justify-content: start;
}

.badge {
  padding: 4px 8px;
  font-size: 0.74rem;
}

.drag-handle {
  align-self: center;
  min-width: 30px;
  min-height: 30px;
  border: 0;
  background: #eef4ff;
  color: #31466b;
}

.row-move-btn {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid #c6d8fb;
  border-radius: 999px;
  background: #edf4ff;
  color: #1f4ea3;
  font-size: 1rem;
  font-weight: 900;
}

.row-edit-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #47c1b3, #168f83);
  color: #ffffff;
  font-size: 18px;
}

.row-delete-btn,
.row-hard-delete-btn,
.category-delete-btn {
  min-height: 30px;
  border-radius: 999px;
  font-size: 0.76rem;
}

.row-hard-delete-btn,
.category-delete-btn {
  background: #fff4f4;
  border-color: #f0b1b1;
  color: #b4232a;
}

.layout.is-editor-open .list-pane {
  padding: 0;
}

.editor-pane {
  padding: 0 14px 18px;
}

.entry-guide {
  min-height: 58px;
  margin: 0 -14px 14px;
  padding: 0 14px;
  border-bottom: 1px solid #edf2f8;
}

@media (min-width: 641px) {
  .topbar {
    min-height: 72px;
    padding: 16px 20px;
  }

  .layout,
  .layout:not(.is-editor-open),
  .layout.is-editor-open {
    width: min(920px, 100%);
    max-width: 920px;
    min-height: auto;
    padding: 14px;
    background: transparent;
  }

  .list-pane,
  .editor-pane {
    border: 1px solid var(--admin-line);
    border-radius: 8px;
    box-shadow: var(--admin-shadow);
    background: #ffffff;
  }

  .list-pane {
    padding: 0 0 12px;
  }

  .editor-pane {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 18px 20px;
  }

  .menu-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px 14px 18px;
  }

  .category-card {
    align-content: start;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 58px;
  }

  .pane-head {
    min-height: 54px;
  }

  .menu-list-categories {
    flex-wrap: nowrap;
    gap: 20px;
    min-width: max-content;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .menu-list {
    padding: 10px;
  }

  .menu-row {
    min-height: 92px;
    padding: 9px;
  }

  .menu-select {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 10px;
  }

  .menu-thumb {
    width: 80px;
    height: 68px;
  }

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

  .menu-row-side .row-delete-btn,
  .menu-row-side .row-hard-delete-btn {
    display: none;
  }
}

@media (max-width: 640px) {
  .menu-row-side .row-delete-btn,
  .menu-row-side .row-hard-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

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

  .row-delete-btn,
  .row-hard-delete-btn {
    min-height: 32px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
  }
}

/* Category management controls */
.menu-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.menu-list-head {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  padding-top: 12px;
  min-height: 66px;
}

.menu-list-head h2 {
  grid-column: 2;
  justify-self: center;
  text-align: center;
  align-self: center;
  padding-top: 4px;
}

.menu-list-head .menu-head-actions {
  grid-column: 3;
  justify-self: end;
}

.category-add-btn {
  min-height: 34px;
  border: 1px solid #c6d8fb;
  border-radius: 999px;
  background: #edf4ff;
  color: #1f4ea3;
  padding: 6px 12px;
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.category-tab-item {
  grid-template-columns: auto minmax(0, auto) auto auto;
}

.category-tab-delete {
  width: 28px;
  min-width: 28px;
  min-height: 28px !important;
  border: 1px solid #f0b1b1 !important;
  border-radius: 999px !important;
  background: #fff4f4 !important;
  color: #b4232a !important;
  padding: 0 !important;
  font-size: 18px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
}

@media (max-width: 640px) {
  .pane-head {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
  }

  .menu-list-head h2,
  .menu-list-head .menu-head-actions {
    grid-column: auto;
  }

  .menu-list-head h2 {
    padding-top: 6px;
  }

  .menu-head-actions {
    justify-content: stretch;
  }

  .menu-head-actions button {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* Keep long category lists scrollable instead of stretching the page. */
.menu-list-categories {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.category-tab-item {
  flex: 0 0 auto;
  white-space: nowrap;
}

.category-tab-button {
  min-width: max-content;
}

@media (max-width: 640px) {
  .menu-list-categories {
    min-width: 0;
    max-width: 100%;
    padding-bottom: 10px;
  }
}
