:root {
  --ink: #24302e;
  --muted: #7a8480;
  --line: #e9e7e1;
  --canvas: #f7f5f0;
  --paper: #fffefa;
  --green: #1f6d58;
  --green-soft: #e8f1eb;
  --coral: #c86f53;
  --gold: #be8e43;
  --shadow: 0 18px 50px rgba(36, 48, 46, .08);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; }
.topbar { height: 74px; border-bottom: 1px solid var(--line); background: rgba(255,254,250,.9); display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(18px, 5vw, 80px); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); }
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--green); color: white; display: grid; place-items: center; font-size: 20px; box-shadow: 0 5px 14px rgba(31,109,88,.22); }
.brand strong { font-size: 17px; letter-spacing: 0; display: block; }
.brand small { color: var(--muted); font-size: 11px; display: block; margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.room-session-label { color: var(--ink); font-size: 12px; font-weight: 700; padding: 9px 2px; white-space: nowrap; }
.link-btn, .icon-btn { border: 0; background: transparent; color: var(--muted); padding: 9px 10px; border-radius: 8px; }
.link-btn:hover, .icon-btn:hover { color: var(--ink); background: #f0eee8; }
.password-btn { color: var(--green); font-weight: 700; }
.order-btn { color: var(--gold); font-weight: 700; }
.cart-btn { border: 0; background: var(--ink); color: #fff; padding: 11px 15px; border-radius: 9px; display: inline-flex; gap: 9px; align-items: center; font-weight: 600; }
.cart-count { min-width: 20px; height: 20px; border-radius: 50%; background: var(--coral); display: grid; place-items: center; font-size: 11px; }
.main { width: min(1220px, calc(100% - 36px)); margin: 0 auto; padding: 38px 0 70px; }
.intro { display: grid; grid-template-columns: 1.15fr .85fr; gap: 26px; align-items: end; margin-bottom: 30px; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 700; letter-spacing: .12em; margin: 0 0 12px; }
h1 { font-size: clamp(34px, 5vw, 59px); letter-spacing: -.04em; line-height: 1.05; margin: 0; max-width: 640px; }
.intro-copy { margin: 17px 0 0; color: var(--muted); line-height: 1.8; max-width: 590px; font-size: 14px; }
.service-note { justify-self: end; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); background: var(--paper); padding: 13px 15px; border-radius: 10px; font-size: 12px; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #4b9b72; box-shadow: 0 0 0 4px #e8f3ec; }
.period-nav { border-bottom: 1px solid var(--line); display: flex; gap: 26px; overflow-x: auto; margin-bottom: 25px; }
.period-tab { border: 0; background: transparent; color: var(--muted); padding: 0 0 13px; font-weight: 600; white-space: nowrap; position: relative; }
.period-tab.active { color: var(--green); }
.period-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--green); }
.market-category-nav { display: flex; flex-wrap: wrap; gap: 7px; margin: -7px 0 18px; }
.market-category-tab { border: 1px solid #deddd7; border-radius: 999px; background: #fff; color: var(--muted); padding: 6px 12px; font-size: 11px; white-space: nowrap; }
.market-category-tab.active { border-color: var(--green); background: var(--green); color: #fff; }
.admin-market-category-nav { margin: -2px 0 14px; }
.menu-search-row { display: flex; align-items: center; gap: 8px; margin: -2px 0 12px; }
.menu-search-row label { color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.menu-search-row input { width: min(280px, 100%); border: 1px solid #deddd7; border-radius: 6px; padding: 7px 9px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.menu-search-row input:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,109,88,.1); }
.menu-search-row span { color: var(--muted); font-size: 11px; }
.period-meta { color: var(--muted); font-size: 12px; margin-bottom: 21px; }
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.dish { min-height: 200px; background: var(--paper); border: 1px solid #eeece6; border-radius: 9px; padding: 13px; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.dish:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.dish-visual { border-radius: 7px; height: 116px; display: grid; place-items: center; position: relative; overflow: hidden; }
.dish-visual img { width: 100%; height: 100%; object-fit: cover; }
.dish-visual::after { content: ""; position: absolute; width: 105px; height: 105px; border-radius: 50%; border: 1px solid rgba(255,255,255,.5); transform: translate(35px, 34px); }
.dish-emoji { font-size: 52px; filter: drop-shadow(0 8px 8px rgba(50,40,30,.12)); }
.dish-tag { position: absolute; top: 9px; left: 9px; font-size: 10px; color: #735a35; background: rgba(255,250,233,.82); padding: 4px 7px; border-radius: 4px; }
.dish-info { padding: 13px 2px 3px; flex: 1; display: flex; flex-direction: column; }
.dish-name { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
.dish-name button { width: 29px; height: 29px; border-radius: 50%; color: white; background: var(--green); border: 0; font-size: 22px; line-height: 1; flex: 0 0 auto; }
.dish-name button:hover { background: #175744; }
.dish-name button:disabled { background: #c5c9c3; cursor: not-allowed; }
.dish-desc { color: var(--muted); font-size: 12px; margin: 7px 0 12px; }
.dish-detail { margin: -4px 0 12px; padding-left: 8px; border-left: 2px solid #d8b36a; color: #52615b; font-size: 11px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.dish-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.price { color: var(--coral); font-weight: 800; font-size: 17px; }
.price::before { content: "฿"; font-size: 11px; margin-right: 2px; }
.sold-out { color: #9d9f99; font-size: 12px; }
.stock-hint { color: #7b847e; font-size: 11px; }
.sold-badge { position: absolute; right: 9px; top: 9px; background: rgba(45, 51, 47, .78); color: #fff; padding: 4px 7px; border-radius: 4px; font-size: 10px; }
.is-sold-out { opacity: .78; }
.empty { grid-column: 1/-1; border: 1px dashed #d8d6cf; border-radius: 9px; text-align: center; color: var(--muted); padding: 40px; }
.admin-shell .main { padding-top: 30px; }
.admin-login { width: min(420px, 100%); margin: 70px auto 40px; background: var(--paper); border: 1px solid #eeece6; border-radius: 10px; padding: 25px; box-shadow: var(--shadow); }
.admin-login h1 { font-size: 34px; margin-bottom: 12px; }
.admin-login .intro-copy { margin: 0 0 25px; font-size: 13px; }
.admin-login form { display: flex; flex-direction: column; gap: 10px; }
.room-login { width: min(460px, 100%); margin: 70px auto 40px; background: var(--paper); border: 1px solid #eeece6; border-radius: 10px; padding: 25px; box-shadow: var(--shadow); }
.room-login h1 { font-size: 34px; margin-bottom: 12px; }
.room-login .intro-copy { margin: 0 0 25px; font-size: 13px; }
.room-login form { display: flex; flex-direction: column; gap: 12px; }
.room-login-help { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 16px 0 0; }
.security-note { background: var(--green-soft); border: 1px solid #dbe9de; border-radius: 7px; color: var(--green); padding: 10px 11px; font-size: 11px; line-height: 1.5; margin-bottom: 15px; }
.login-error { color: #b05545; font-size: 12px; margin: 2px 0 0; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 28px; }
.admin-head h1 { font-size: 38px; }
.admin-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.solid-btn, .outline-btn { border-radius: 8px; padding: 10px 15px; font-weight: 600; border: 1px solid var(--green); }
.solid-btn { background: var(--green); color: #fff; }
.outline-btn { background: transparent; color: var(--green); }
.solid-btn:hover { background: #175744; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 25px; }
.stat { min-width: 0; background: var(--paper); border: 1px solid #eeece6; border-radius: 8px; padding: 17px; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { min-width: 0; font-size: 27px; font-weight: 800; margin: 8px 0 3px; overflow-wrap: anywhere; }
.stat-hint { color: var(--green); font-size: 11px; }
.admin-tabs { display: flex; gap: 23px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.admin-tab { border: 0; background: transparent; color: var(--muted); padding: 10px 0; font-weight: 600; position: relative; }
.admin-tab.active { color: var(--ink); }
.admin-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); }
.stats-panel { display: flex; flex-direction: column; gap: 15px; }
.stats-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 15px; flex-wrap: wrap; }
.quick-ranges { display: flex; gap: 7px; }
.range-btn { border: 1px solid #deddd7; background: var(--paper); border-radius: 7px; padding: 8px 12px; color: var(--muted); font-size: 12px; }
.range-btn:hover { color: var(--green); border-color: var(--green); }
.range-btn.active { color: #fff; border-color: var(--green); background: var(--green); }
.timezone-note { display: block; color: var(--muted); font-size: 10px; margin-top: 7px; }
.date-range { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.date-range label { display: flex; align-items: center; gap: 5px; }
.date-range input { border: 1px solid #deddd7; border-radius: 6px; padding: 8px; color: var(--ink); background: #fff; }
.date-range .solid-btn { padding: 8px 13px; }
.stats-period-filter, .order-period-filter { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.stats-period-filter select, .order-period-filter select { min-width: 126px; border: 1px solid #deddd7; border-radius: 6px; padding: 8px 28px 8px 9px; color: var(--ink); background: #fff; }
.stats-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 0; }
.stats-range-value { font-size: 15px; letter-spacing: 0; white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.3; }
.stats-columns { display: grid; grid-template-columns: 1.15fr .85fr; gap: 15px; }
.stats-block { border: 1px solid #eeece6; border-radius: 8px; background: var(--paper); padding: 17px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 17px; }
.block-head h2 { font-size: 15px; margin: 0; }
.block-head span { color: var(--muted); font-size: 11px; }
.daily-bars { display: flex; flex-direction: column; gap: 10px; }
.daily-row { display: grid; grid-template-columns: 42px 1fr 25px 58px; align-items: center; gap: 8px; font-size: 11px; }
.daily-date, .daily-row small { color: var(--muted); }
.daily-row strong { text-align: right; }
.daily-row small { text-align: right; }
.daily-track { height: 8px; border-radius: 99px; background: #edf0ed; overflow: hidden; }
.daily-track span { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: var(--green); }
.period-stats { display: flex; flex-direction: column; gap: 13px; }
.period-stat-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; border-bottom: 1px solid #f0eee9; padding-bottom: 11px; font-size: 12px; }
.period-stat-row.active { color: var(--green); font-weight: 700; }
.period-stat-row:last-child { border-bottom: 0; padding-bottom: 0; }
.period-stat-row span { color: var(--muted); }
.period-stat-row em { color: var(--coral); font-style: normal; }
.table-wrap { overflow: auto; border: 1px solid #eeece6; border-radius: 8px; background: var(--paper); }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { text-align: left; padding: 14px 15px; border-bottom: 1px solid #f0eee9; font-size: 12px; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: #fbfaf7; }
tr:last-child td { border-bottom: 0; }
.order-id { font-weight: 700; color: var(--green); }
.order-note-cell { min-width: 160px; max-width: 280px; }
th.order-note-cell { white-space: normal; }
td.order-note-cell { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; vertical-align: top; }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 11px; }
.status.pending, .status.preparing { color: #9b6c22; background: #fbf1dc; }
.status.paid, .status.delivered { color: #23704f; background: #e6f2e9; }
.status.failed, .status.cancelled { color: #a84f43; background: #fbe9e6; }
.status.refunded { color: #356398; background: #e8eef7; }
.status.delivering { color: #356398; background: #e8eef7; }
.status.pickup { color: #656c69; background: #edf0ed; }
.status.dine_in { color: #7c5e2c; background: #f6eedf; }
.service-pill { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: 11px; }
.service-pill.delivery { color: #356398; background: #e8eef7; }
.service-pill.dine-in { color: #7c5e2c; background: #f6eedf; }
.row-select { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff; color: var(--ink); font-size: 12px; }
.menu-admin-groups { display: flex; flex-direction: column; gap: 22px; }
.menu-admin-group { min-width: 0; }
.menu-admin-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.menu-admin-group-head h2 { margin: 0; color: var(--ink); font-size: 17px; }
.menu-admin-group-head span, .menu-admin-group-head > strong { color: var(--muted); font-size: 11px; }
.menu-admin-empty { border: 1px dashed #d8d6cf; border-radius: 8px; color: var(--muted); padding: 24px; text-align: center; font-size: 12px; }
.menu-admin { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.menu-admin-card { background: var(--paper); border: 1px solid #eeece6; border-radius: 8px; padding: 14px; display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.mini-visual { width: 50px; height: 50px; border-radius: 7px; display: grid; place-items: center; font-size: 27px; flex: 0 0 auto; }
.mini-visual img { width: 100%; height: 100%; border-radius: 7px; object-fit: cover; }
.menu-admin-content { min-width: 0; flex: 1; }
.menu-admin-content strong { display: block; font-size: 13px; }
.menu-admin-content small { display: block; color: var(--muted); margin-top: 4px; }
.stock-control { display: flex; align-items: center; gap: 7px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.stock-control input { width: 65px; border: 1px solid #deddd7; border-radius: 5px; padding: 4px 6px; color: var(--ink); }
.stock-control span { color: var(--green); }
.stock-control input:invalid, .stock-control input[value="0"] + span { color: var(--coral); }
.cost-control { display: flex; align-items: center; gap: 5px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.cost-control input { width: 70px; border: 1px solid #deddd7; border-radius: 5px; padding: 4px 6px; color: var(--ink); }
.price-control { display: flex; align-items: center; gap: 5px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.price-control input { width: 70px; border: 1px solid #deddd7; border-radius: 5px; padding: 4px 6px; color: var(--ink); }
.market-category-editor { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.market-category-editor select { min-width: 86px; border: 1px solid #deddd7; border-radius: 5px; padding: 4px 6px; background: #fff; color: var(--ink); font-size: 11px; }
.menu-admin-actions { display: flex; gap: 3px; }
.dish-detail-editor { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid #f0eee9; padding-top: 10px; }
.dish-detail-editor > label { color: var(--muted); font-size: 11px; font-weight: 700; }
.dish-detail-editor > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 7px; }
.dish-detail-editor textarea { width: 100%; min-height: 58px; resize: vertical; border: 1px solid #deddd7; border-radius: 6px; padding: 7px 8px; background: #fff; color: var(--ink); font: inherit; font-size: 11px; line-height: 1.45; }
.dish-detail-editor textarea:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,109,88,.1); }
.danger { color: #b05545; }
.order-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 90px;
}

#print-sheet {
  display: none;
}

@media print {
  @page {
    size: auto;
    margin: 12mm;
  }

  body.printing-order > *:not(#print-sheet) {
    display: none !important;
  }

  body.printing-order {
    background: #fff;
    color: #111;
  }

  body.printing-order #print-sheet {
    display: block !important;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #111;
  }

  #print-sheet h1 {
    font-size: 24px;
    letter-spacing: 0;
    margin: 0 0 5px;
  }

  #print-sheet h2 {
    font-size: 16px;
    margin: 0 0 16px;
    font-weight: 600;
  }

  .print-board-range {
    margin: 0 0 14px;
    color: #555;
    font-size: 11px;
  }

  .print-board-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    min-width: 0;
  }

  .print-board-table th,
  .print-board-table td {
    padding: 7px 6px;
    border: 1px solid #999;
    color: #111;
    font-size: 9px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: top;
  }

  .print-board-table th {
    background: #f2f2f2;
    font-weight: 700;
  }

  .print-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px 18px;
    padding: 12px 0;
    border-top: 1px solid #111;
    border-bottom: 1px solid #111;
    font-size: 12px;
  }

  .print-items {
    margin-top: 16px;
    border-bottom: 1px solid #111;
  }

  .print-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #ddd;
  }

  .print-item:last-child {
    border-bottom: 0;
  }

  .print-total {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 0;
    font-size: 15px;
    font-weight: 700;
  }

  .print-note {
    margin-top: 8px;
    padding: 10px;
    border: 1px solid #999;
    font-size: 12px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  #print-sheet footer {
    margin-top: 24px;
    color: #555;
    font-size: 10px;
  }
}
.modal-backdrop { position: fixed; inset: 0; background: rgba(26,34,31,.42); display: grid; place-items: center; padding: 17px; z-index: 50; }
.modal { width: min(520px, 100%); max-height: min(780px, calc(100vh - 34px)); overflow: auto; background: var(--paper); border-radius: 12px; box-shadow: 0 25px 70px rgba(0,0,0,.2); }
.modal-head { padding: 20px 21px 14px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-close { border: 0; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; }
.modal-body { padding: 18px 21px 21px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1/-1; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea { border: 1px solid #dddcd5; border-radius: 7px; padding: 10px 11px; background: #fff; color: var(--ink); outline: 0; }
.field textarea { min-height: 72px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,109,88,.1); }
.image-preview { min-height: 78px; border: 1px dashed #d8d6cf; border-radius: 7px; color: var(--muted); display: grid; place-items: center; font-size: 11px; margin-top: 8px; overflow: hidden; }
.image-preview img { max-width: 100%; height: 120px; object-fit: cover; display: block; }
.toggle-line { display: flex; align-items: center; justify-content: space-between; border: 1px solid #e6e3dc; border-radius: 7px; padding: 11px; }
.switch { width: 39px; height: 22px; border-radius: 20px; border: 0; background: #d4d6d0; padding: 2px; transition: background .2s; }
.switch span { width: 18px; height: 18px; background: white; border-radius: 50%; display: block; transition: transform .2s; }
.switch.on { background: var(--green); }
.switch.on span { transform: translateX(17px); }
.cart-list { display: flex; flex-direction: column; gap: 11px; margin-bottom: 17px; }
.cart-row { display: flex; align-items: center; gap: 10px; }
.cart-row-emoji { width: 36px; height: 36px; border-radius: 6px; background: #eee9df; display: grid; place-items: center; font-size: 19px; }
.cart-row-main { flex: 1; min-width: 0; }
.cart-row-main strong { display: block; font-size: 13px; }
.cart-row-main small { color: var(--muted); }
.qty { display: flex; gap: 7px; align-items: center; }
.qty button { border: 1px solid #dad8d1; background: #fff; width: 23px; height: 23px; border-radius: 50%; color: var(--ink); }
.cart-remove { border: 0; background: transparent; color: var(--coral); padding: 6px 2px; font-size: 11px; white-space: nowrap; }
.cart-remove:hover { color: #a84f43; text-decoration: underline; }
.cart-total { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid var(--line); font-weight: 700; }
.cart-total strong { color: var(--coral); font-size: 21px; }
.cart-total strong::before { content: "฿"; font-size: 12px; }
.period-order-note { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--gold); background: #fbf1dc; color: #7c5e2c; font-size: 12px; line-height: 1.5; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 12px 0 10px; }
.pay-methods.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pay-methods.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pay-methods.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pay-methods.one { grid-template-columns: minmax(0, 1fr); }
.service-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.service-option { border: 1px solid #deddd7; background: #fff; border-radius: 8px; padding: 12px; display: flex; gap: 8px; align-items: center; text-align: left; color: var(--ink); }
.service-option.selected { border-color: var(--green); background: var(--green-soft); }
.service-icon { width: 25px; height: 25px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; color: #fff; font-weight: 700; background: var(--green); }
.service-icon.dine { background: var(--gold); }
.service-option small { color: var(--muted); display: block; font-size: 10px; margin-top: 2px; }
.pay-option { border: 1px solid #deddd7; background: #fff; border-radius: 8px; padding: 12px; display: flex; gap: 8px; align-items: center; }
.pay-option.selected { border-color: var(--green); background: var(--green-soft); }
.pay-option:disabled { opacity: .5; cursor: not-allowed; }
.pay-icon { width: 25px; height: 25px; border-radius: 6px; display: grid; place-items: center; font-size: 14px; color: #fff; font-weight: 700; }
.pay-icon.thb { background: #8755a7; }
.pay-icon.room { background: var(--green); }
.pay-option small { color: var(--muted); display: block; font-size: 10px; }
.exchange-note { color: var(--muted); font-size: 11px; }
.qr-amount { font-size: 28px; font-weight: 800; color: var(--coral); margin: 7px 0; }
.payment-method-small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.outline-btn.compact { padding: 6px 9px; font-size: 11px; white-space: nowrap; }
.payment-settings { display: grid; grid-template-columns: .7fr 1.3fr; gap: 28px; align-items: start; background: var(--paper); border: 1px solid #eeece6; border-radius: 8px; padding: 24px; }
.settings-copy h2 { margin: 0 0 10px; font-size: 23px; }
.settings-copy p:last-child { color: var(--muted); font-size: 12px; line-height: 1.7; }
.settings-form { display: flex; flex-direction: column; gap: 18px; }
.settings-form .field > small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.payment-qr-preview { min-height: 190px; border: 1px dashed #d8d6cf; border-radius: 7px; display: grid; place-items: center; color: var(--muted); font-size: 12px; background: #fff; overflow: hidden; }
.payment-qr-preview img { width: min(240px, 100%); max-height: 280px; object-fit: contain; }
.recharge-codes { border-top: 1px solid #eeece6; padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.recharge-code-single { border: 1px solid #eeece6; border-radius: 7px; padding: 8px; background: #fff; text-align: center; }
.recharge-code-single img { display: block; width: min(240px, 100%); max-height: 220px; margin: 0 auto; object-fit: contain; }
.recharge-btn { color: var(--coral); font-weight: 700; }
.recharge-balance { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 15px; }
.recharge-balance span { color: var(--muted); font-size: 12px; }
.recharge-balance strong { color: var(--coral); font-size: 22px; }
.recharge-only-label { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--ink); }
.recharge-customer-qr { min-height: 230px; display: grid; place-items: center; border: 1px solid #eeece6; border-radius: 8px; background: #fff; padding: 12px; }
.recharge-customer-qr img { width: min(230px, 100%); max-height: 280px; object-fit: contain; }
.recharge-customer-empty { min-height: 180px; display: grid; place-items: center; text-align: center; color: var(--muted); background: #faf9f6; border: 1px dashed #d8d6cf; border-radius: 8px; padding: 20px; font-size: 12px; }
.recharge-rate { color: var(--muted); font-size: 11px; text-align: center; margin: 10px 0 14px; }
.recharge-warning { border-left: 3px solid var(--coral); background: #fff4ef; padding: 12px 13px; display: flex; flex-direction: column; gap: 5px; color: #864937; font-size: 12px; line-height: 1.5; }
.recharge-warning span { color: var(--muted); font-size: 11px; }
.customer-orders-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; color: var(--muted); font-size: 11px; }
.customer-orders-toolbar .outline-btn:disabled { opacity: .55; cursor: wait; }
.customer-order-list { display: flex; flex-direction: column; gap: 11px; }
.customer-order-card { border: 1px solid #e6e3dc; border-radius: 8px; padding: 14px; background: #fff; min-width: 0; }
.customer-order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.customer-order-head > div { min-width: 0; }
.customer-order-head > div > strong { display: block; color: var(--green); font-size: 12px; overflow-wrap: anywhere; }
.customer-order-head time { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.customer-order-total { color: var(--coral); font-size: 18px; white-space: nowrap; }
.customer-order-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0; color: var(--muted); font-size: 11px; }
.customer-order-items { border-top: 1px solid #f0eee9; border-bottom: 1px solid #f0eee9; padding: 9px 0; display: flex; flex-direction: column; gap: 7px; }
.customer-order-items > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.customer-order-items span { min-width: 0; overflow-wrap: anywhere; }
.customer-order-items strong { white-space: nowrap; }
.customer-order-note { margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.customer-order-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.cancel-request-state { margin-top: 10px; border-left: 3px solid var(--gold); padding: 9px 10px; background: #fbf1dc; color: #7c5e2c; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.cancel-request-state.approved { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.cancel-request-state.rejected { border-color: var(--coral); background: #fbe9e6; color: #a84f43; }
.cancel-order-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 13px; margin-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.cancel-order-summary span { min-width: 0; overflow-wrap: anywhere; }
.cancel-order-summary strong { color: var(--coral); font-size: 20px; white-space: nowrap; }
.cancel-warning { margin-bottom: 15px; border-left: 3px solid var(--gold); background: #fbf1dc; color: #7c5e2c; padding: 10px 11px; font-size: 11px; line-height: 1.55; }
.cancel-back-btn { width: 100%; margin-top: 9px; }
.cancel-review { min-width: 190px; max-width: 250px; white-space: normal; }
.cancel-review > span { display: block; color: #7c5e2c; font-size: 11px; line-height: 1.4; margin-bottom: 7px; overflow-wrap: anywhere; }
.cancel-review > div { display: flex; flex-wrap: wrap; gap: 5px; }
.cancel-review-result { font-size: 11px; font-weight: 700; }
.cancel-review-result.approved { color: var(--green); }
.cancel-review-result.rejected { color: var(--coral); }
.customer-orders-empty, .customer-orders-loading { min-height: 180px; border: 1px dashed #d8d6cf; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; text-align: center; color: var(--muted); padding: 24px; font-size: 12px; }
.customer-orders-empty strong { color: var(--ink); font-size: 15px; }
.room-account-note { color: var(--muted); font-size: 11px; line-height: 1.45; }
.rooms-panel { display: flex; flex-direction: column; gap: 17px; }
.rooms-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 17px; }
.rooms-toolbar h2 { margin: 0 0 7px; font-size: 23px; }
.rooms-toolbar p:last-child { color: var(--muted); font-size: 12px; margin: 0; }
.room-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.orders-panel { display: flex; flex-direction: column; gap: 12px; }
.print-panel { display: grid; gap: 22px; }
.print-stat-grid { margin: 0; }
.print-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.print-config { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px 20px; padding: 16px 0; border-top: 1px solid #eeece6; border-bottom: 1px solid #eeece6; }
.switch-field { display: inline-flex; align-items: center; gap: 9px; min-height: 38px; font-size: 12px; color: var(--ink); }
.switch-field input { width: 17px; height: 17px; accent-color: var(--coral); }
.print-name-field { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.print-name-field input { min-width: 180px; padding: 9px 10px; border: 1px solid #d8d6cf; border-radius: 5px; background: #fff; color: var(--ink); }
.status.cancelled { color: #8b5e34; background: #f4eadc; }
.order-filter-toolbar { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 2px 0 4px; }
.order-filter-heading { display: flex; flex-direction: column; gap: 4px; min-width: 165px; }
.order-filter-heading strong { color: var(--ink); font-size: 13px; }
.order-filter-heading span { color: var(--muted); font-size: 10px; }
.order-board-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.order-date-range { margin-left: auto; }
.room-search-row, .order-search-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.room-search-field, .order-search-field { width: min(380px, 100%); display: flex; flex-direction: column; gap: 6px; position: relative; }
.room-search-field > span, .order-search-field > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.room-search-field input, .order-search-field input { width: 100%; height: 42px; border: 1px solid #d8d6cf; border-radius: 7px; padding: 9px 40px 9px 12px; background: #fff; color: var(--ink); outline: 0; }
.room-search-field input:focus, .order-search-field input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,109,88,.1); }
.room-search-clear, .order-search-clear { position: absolute; right: 5px; bottom: 5px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); font-size: 21px; line-height: 1; cursor: pointer; }
.room-search-count, .order-search-count { color: var(--muted); font-size: 11px; padding-bottom: 11px; white-space: nowrap; }
.room-search-empty { grid-column: 1 / -1; }
.room-account-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.room-account-card { background: var(--paper); border: 1px solid #eeece6; border-radius: 8px; padding: 16px; min-width: 0; }
.room-account-card[hidden], .room-search-empty[hidden], [data-order-row][hidden], #order-search-empty[hidden] { display: none; }
.room-account-card.inactive { opacity: .65; }
.room-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.room-label { color: var(--muted); font-size: 10px; }
.room-card-head h3 { margin: 2px 0 0; font-size: 22px; }
.room-balance { color: var(--coral); font-size: 28px; font-weight: 800; margin-top: 17px; }
.room-available { color: var(--green); font-size: 12px; margin-top: 3px; }
.room-link { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.room-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.room-card-actions .compact { font-size: 10px; padding: 6px 8px; }
.transactions-block { background: var(--paper); border: 1px solid #eeece6; border-radius: 8px; padding: 17px; }
.transaction-type { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: 10px; background: #edf0ed; color: var(--muted); }
.transaction-type.topup { color: #23704f; background: #e6f2e9; }
.transaction-type.consume { color: #9b6c22; background: #fbf1dc; }
.transaction-type.refund, .transaction-type.order_refund { color: #356398; background: #e8eef7; }
.transaction-type.checkout { color: #7c5e2c; background: #f6eedf; }
.amount-positive { color: var(--green); font-weight: 700; }
.amount-negative { color: var(--coral); font-weight: 700; }
.checkout-copy { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 17px; }
.checkout-copy strong { color: var(--coral); font-size: 18px; }
.submit-btn { width: 100%; border: 0; background: var(--green); color: #fff; border-radius: 8px; padding: 13px; font-weight: 700; margin-top: 17px; }
.submit-btn:disabled { opacity: .5; cursor: not-allowed; }
.qr-wrap { text-align: center; padding: 9px 0 4px; }
.qr-box { width: 190px; height: 190px; margin: 0 auto 15px; background: #fff; border: 1px solid #ece9e2; border-radius: 9px; padding: 9px; display: grid; place-items: center; }
.qr-box img { width: 170px; height: 170px; object-fit: contain; }
.qr-fallback { width: 170px; height: 170px; display: grid; grid-template-columns: repeat(15, 1fr); gap: 2px; padding: 5px; background: #fff; }
.qr-fallback i { background: #1c2522; display: block; }
.qr-fallback i:nth-child(3n), .qr-fallback i:nth-child(7n) { background: transparent; }
.qr-title { font-weight: 700; margin-bottom: 6px; }
.qr-sub { color: var(--muted); font-size: 12px; line-height: 1.6; }
.pay-status { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 15px 0 0; color: var(--gold); font-size: 12px; }
.pay-status .pulse { width: 7px; height: 7px; background: var(--gold); border-radius: 50%; box-shadow: 0 0 0 4px #fbf1dc; }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translateX(-50%); background: #26302d; color: #fff; border-radius: 7px; padding: 11px 16px; font-size: 12px; z-index: 90; box-shadow: var(--shadow); }
.share-panel { margin-top: 34px; background: #edf3ee; border: 1px solid #dbe9de; border-radius: 9px; padding: 15px 17px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.share-panel strong { font-size: 13px; display: block; }
.share-panel p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.share-url { color: var(--green); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footer { text-align: center; padding: 20px; color: #a4aaa5; font-size: 11px; }
@media (max-width: 860px) { .intro { grid-template-columns: 1fr; } .service-note { justify-self: start; } .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .menu-admin, .room-account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats-columns, .payment-settings { grid-template-columns: 1fr; } .pay-methods.three, .pay-methods.four { grid-template-columns: 1fr; } .order-date-range { margin-left: 0; } }
@media (max-width: 560px) {
  .menu-search-row { flex-wrap: wrap; }
  .menu-search-row input { flex: 1 1 180px; }
  .topbar { height: 64px; padding: 0 16px; }
  .brand { min-width: 0; }
  .brand strong { white-space: nowrap; }
  .brand small { display: none; }
  .top-actions { gap: 4px; }
  .room-session-label { padding: 8px 2px; font-size: 11px; }
  .link-btn { padding: 8px 4px; font-size: 12px; }
  .cart-btn { padding: 10px 11px; }
  .customer-topbar { height: auto; min-height: 106px; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .customer-topbar .brand { width: 100%; }
  .customer-topbar .top-actions { width: 100%; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
  .customer-topbar .room-session-label,
  .customer-topbar .link-btn,
  .customer-topbar .cart-btn { width: 100%; min-width: 0; justify-content: center; padding: 8px 2px; font-size: 11px; white-space: nowrap; }
  .customer-topbar .cart-btn { gap: 2px; font-size: 10px; }
  .customer-topbar .cart-count { min-width: 18px; width: 18px; height: 18px; }
  .main { width: min(100% - 28px, 1220px); padding-top: 27px; }
  h1 { font-size: 38px; }
  .intro-copy { font-size: 13px; }
  .menu-grid { gap: 9px; }
  .dish { min-height: 186px; padding: 9px; }
  .dish-visual { height: 100px; }
  .dish-emoji { font-size: 44px; }
  .dish-name { font-size: 13px; }
  .dish-desc { font-size: 11px; margin-bottom: 8px; }
  .dish-detail { font-size: 10px; margin-bottom: 9px; }
  .dish-detail-editor > div { grid-template-columns: 1fr; }
  .dish-detail-editor .outline-btn { width: 100%; }
  .price { font-size: 15px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-head { align-items: flex-start; flex-direction: column; }
  .admin-head h1 { font-size: 32px; }
  .admin-actions { width: 100%; justify-content: flex-start; }
  .admin-tabs { gap: 20px; overflow-x: auto; }
  .admin-tab { flex: 0 0 auto; white-space: nowrap; }
  .menu-admin { grid-template-columns: 1fr; }
  .room-account-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .order-note-cell { min-width: 120px; max-width: 160px; }
  .share-panel { align-items: flex-start; flex-direction: column; }
  .stats-toolbar, .date-range, .order-filter-toolbar, .room-search-row, .order-search-row { align-items: stretch; flex-direction: column; }
  .order-board-actions { margin-left: 0; }
  .room-search-count, .order-search-count { padding-bottom: 0; }
  .quick-ranges { width: 100%; }
  .range-btn { flex: 1; }
  .date-range .solid-btn { width: 100%; }
  .stats-range-value { font-size: 12px; }
}
