:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef3f7;
  --line: #d8e0e7;
  --line-strong: #bcc8d2;
  --text: #17212b;
  --muted: #667482;
  --accent: #116b5f;
  --accent-dark: #0c4c44;
  --accent-soft: #dcefeb;
  --warn: #a84e17;
  --danger: #a43a3a;
  --shadow: 0 12px 30px rgba(23, 33, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 14px;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}

label,
.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 22px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel-title h2,
.confirm-dialog h2,
.empty-state h2,
.empty-state p {
  margin: 0;
}

.brand h1 {
  font-size: 22px;
  line-height: 1.2;
}

.brand p,
.eyebrow {
  color: var(--muted);
  font-size: 13px;
}

.login-form,
.session-panel,
.selection-panel {
  display: grid;
  gap: 12px;
}

.selection-panel {
  min-height: 0;
  flex: 1;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-title h2,
.confirm-dialog h2 {
  font-size: 17px;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.ghost:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.reserve {
  width: 100%;
}

.content-panel {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h2 {
  font-size: 28px;
  line-height: 1.15;
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.status.error {
  color: var(--danger);
  font-weight: 700;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(230px, 1fr));
  gap: 14px;
  align-items: start;
}

.menu-grid.signed-out {
  grid-template-columns: 1fr;
}

.day-column,
.menu-item,
.selection-row,
.quote-box,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.day-column {
  min-width: 0;
  overflow: hidden;
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 12px;
}

.day-header h3 {
  margin: 0;
  font-size: 17px;
}

.day-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.meal-section {
  display: grid;
  gap: 9px;
  padding: 12px;
}

.meal-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.meal-title strong {
  color: var(--text);
  font-size: 15px;
}

.menu-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  min-height: 112px;
  padding: 9px;
}

.menu-image {
  width: 72px;
  height: 72px;
  border-radius: 7px;
  background: var(--surface-soft);
  object-fit: cover;
}

.menu-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.menu-copy h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.menu-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 0 8px;
}

.chip.warn {
  background: #fff1e8;
  color: var(--warn);
}

.item-actions {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 7px;
}

.qty-input {
  min-height: 34px;
  padding: 0 4px;
  text-align: center;
}

.select-btn {
  min-height: 34px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.select-btn.selected {
  background: var(--accent);
  color: #fff;
}

.select-btn.sold-out {
  background: #eceff2;
  color: var(--muted);
}


.quick-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.quick-actions button {
  width: 100%;
  min-height: 36px;
  white-space: normal;
  line-height: 1.25;
}
.selection-list {
  display: grid;
  gap: 8px;
  max-height: 42vh;
  overflow: auto;
  color: var(--muted);
  font-size: 13px;
}

.selection-list.empty {
  min-height: 48px;
  align-content: center;
}

.selection-row {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.selection-row strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.selection-row span {
  font-size: 12px;
}

.empty-state {
  display: grid;
  gap: 10px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.empty-state h2 {
  font-size: 20px;
}

.hidden {
  display: none;
}

.confirm-dialog {
  width: min(640px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.confirm-dialog::backdrop {
  background: rgba(23, 33, 43, 0.42);
}

.dialog-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.icon-btn {
  width: 36px;
  min-height: 36px;
  border-color: var(--line);
  background: #fff;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  padding: 0;
}

.confirm-summary {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.confirm-options {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 10px;
}

.quote-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 13px;
}

.quote-box strong {
  color: var(--text);
}


.reservation-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.reservation-panel.hidden {
  display: none;
}

.reservation-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reservation-toolbar h3 {
  margin: 2px 0 0;
  font-size: 17px;
}

.reservation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.history-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 320px);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.history-day {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.history-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-day-header strong {
  color: var(--text);
  font-size: 14px;
}

.history-entry {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 9px;
}

.history-entry-top {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.history-entry input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.history-entry-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.history-entry-title strong {
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.history-entry-title span,
.history-menu-list {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.history-menu-list {
  display: grid;
  gap: 2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.cancelable {
  background: #fff1e8;
  color: var(--warn);
}

.history-entry-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-entry-actions span {
  color: var(--muted);
  font-size: 12px;
}

.danger {
  border-color: #e2b6b6;
  color: var(--danger);
}

.danger:hover:not(:disabled) {
  border-color: var(--danger);
  background: #fff0f0;
}

.danger-primary {
  background: var(--danger);
}

.danger-primary:hover:not(:disabled) {
  background: #7f2c2c;
}

.danger-note {
  border-color: #e2b6b6;
  background: #fff7f7;
  color: var(--danger);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 290px minmax(0, 1fr);
  }

  .menu-grid {
    grid-template-columns: repeat(2, minmax(250px, 1fr));
  }
}

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

  .side-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content-panel {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status {
    text-align: left;
  }

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

  .confirm-options {
    grid-template-columns: 1fr;
  }
}


