:root {
  --ink: #211D17;
  --ink-soft: #5B564C;
  --bg: #F4F2EA;
  --panel: #FFFFFF;
  --line: #E4E0D3;
  --brand: #212B22;
  --brand-ink: #F4F2EA;
  --accent: #DE9A2E;
  --accent-ink: #241804;

  --available: #2F8F52;    --available-bg: #E4F4E9;
  --occupied: #C94B3F;     --occupied-bg: #FBE8E5;
  --reserved: #C98A22;     --reserved-bg: #FBF0D9;
  --cleaning: #8B877C;     --cleaning-bg: #EDEBE3;
  --merged: #7B58AE;       --merged-bg: #EEE7F8;
  --maintenance: #57534A;  --maintenance-bg: #E2E0D6;

  --queued: #9C7A2E;   --queued-bg: #F6EFDD;
  --cooking: #C1541F;  --cooking-bg: #FBE6DA;
  --ready: #2F8F52;    --ready-bg: #E4F4E9;
  --served: #3A4C9E;   --served-bg: #E4E7F4;
  --void: #8A5555;     --void-bg: #F1E4E4;

  --font-display: 'Fraunces', serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(33, 29, 23, 0.04);
  --shadow-active: 0 6px 24px rgba(33, 29, 23, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ===== APP SHELL ===== */
.app-shell {
  max-width: 1240px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.03);
}

/* ===== HEADER BAR ===== */
header.topbar {
  background: var(--brand);
  color: var(--brand-ink);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  box-sizing: border-box;
}

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

.brand .wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 650;
  font-size: 24px;
  letter-spacing: 0.3px;
  color: #fff;
}

.brand .outlet {
  font-size: 13px;
  color: #C9C6BC;
  font-weight: 500;
  border-left: 1px solid rgba(255,255,255,0.2);
  padding-left: 12px;
}

.status-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #E9C77C;
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 600;
}

.conn-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 600;
  background: rgba(47, 143, 82, 0.15);
  border: 1px solid var(--available);
  color: #8ce4a7;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.conn-pill.offline {
  background: rgba(201, 75, 63, 0.15);
  border-color: var(--occupied);
  color: #fca59d;
}

nav.screens {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.18);
  padding: 4px;
  border-radius: 100px;
}

nav.screens button {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  color: #C9C6BC;
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}

nav.screens button.active {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 2px 8px rgba(222, 154, 46, 0.25);
}

nav.screens button:not(.active):hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* ===== MAIN MAIN ===== */
main {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fade .22s ease-out;
}

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

h1.page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  margin: 0 0 6px;
}

p.page-sub {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ===== TABLE MAP ===== */
.area-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.area-tabs button {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}

.area-tabs button.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  box-shadow: 0 3px 10px rgba(33, 29, 23, 0.15);
}

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.legend .item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 700;
}

.legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

#activeOrdersList {
  height: calc(100vh - 180px);
  max-height: 660px;
  overflow-y: auto;
  padding-right: 4px;
}

#activeOrdersList::-webkit-scrollbar {
  width: 4px;
}

#activeOrdersList::-webkit-scrollbar-track {
  background: transparent;
}

#activeOrdersList::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.table-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px 16px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 125px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.table-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-active);
}

.table-card .code {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
}

.table-card .cap {
  font-size: 12px;
  font-weight: 650;
  opacity: 0.7;
  margin-top: 2px;
}

.table-card .status-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-top: auto;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 4px;
}

.table-card.st-available { border-color: rgba(47, 143, 82, 0.2); }
.table-card.st-available .status-label { background: var(--available-bg); color: var(--available); }

.table-card.st-occupied { border-color: rgba(201, 75, 63, 0.2); }
.table-card.st-occupied .status-label { background: var(--occupied-bg); color: var(--occupied); }

.table-card.st-reserved { border-color: rgba(201, 138, 34, 0.2); }
.table-card.st-reserved .status-label { background: var(--reserved-bg); color: var(--reserved); }

.table-card.st-cleaning { border-color: rgba(139, 135, 124, 0.2); }
.table-card.st-cleaning .status-label { background: var(--cleaning-bg); color: var(--cleaning); }

.table-card.st-merged { border-color: rgba(123, 88, 174, 0.2); }
.table-card.st-merged .status-label { background: var(--merged-bg); color: var(--merged); }

.table-card.st-maintenance { border-color: rgba(87, 83, 74, 0.2); opacity: 0.6; cursor: not-allowed; }
.table-card.st-maintenance .status-label { background: var(--maintenance-bg); color: var(--maintenance); }

/* ===== ORDER TAKING ===== */
.ot-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.cat-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.cat-tabs button {
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 3px 10px rgba(222, 154, 46, 0.25);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.menu-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.menu-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-active);
  border-color: var(--accent);
}

.menu-card .icon {
  width: 100%;
  height: 54px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.menu-card .name {
  font-weight: 800;
  font-size: 14px;
  line-height: 1.3;
}

.menu-card .price {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.modifier-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.chip {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.cart-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  max-height: 660px;
}

#cartList {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 12px;
  padding-right: 4px;
}

#cartList::-webkit-scrollbar {
  width: 4px;
}

#cartList::-webkit-scrollbar-track {
  background: transparent;
}

#cartList::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.shortcut-btn {
  flex: 1;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 14px;
  cursor: not-allowed;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.shortcut-btn.danger {
  cursor: pointer;
  opacity: 1;
  border-color: rgba(220, 53, 69, 0.2);
  background: rgba(220, 53, 69, 0.05);
  color: #dc3545;
}

.shortcut-btn.danger:hover {
  background: #dc3545;
  color: white;
  border-color: #dc3545;
}

.cart-panel h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  border-bottom: 2px solid var(--bg);
  padding-bottom: 10px;
}

.cart-empty {
  color: var(--ink-soft);
  font-size: 13.5px;
  padding: 30px 0;
  text-align: center;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.cart-item .ci-name {
  font-weight: 700;
  font-size: 14px;
}

.cart-item .ci-mod {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.qty-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.qty-ctrl button {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-weight: 800;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-ctrl span {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  min-width: 18px;
  text-align: center;
}

.ci-price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  padding-top: 16px;
  font-weight: 800;
  font-size: 16px;
  border-top: 2px solid var(--bg);
  margin-top: 14px;
}

.cart-total .val {
  font-family: var(--font-mono);
}

.primary-btn {
  width: 100%;
  margin-top: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(222, 154, 46, 0.2);
}

.primary-btn:hover:not(:disabled) {
  background: #c88823;
  box-shadow: 0 6px 16px rgba(222, 154, 46, 0.3);
}

.primary-btn:disabled {
  background: var(--line);
  color: var(--ink-soft);
  cursor: not-allowed;
  box-shadow: none;
}

.ghost-btn {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ghost-btn:hover {
  background: var(--bg);
  border-color: var(--ink-soft);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 12px;
  background: none;
  border: none;
  padding: 0;
}

.back-link:hover {
  color: var(--ink);
}

/* ===== BILL DETAIL ===== */
.bill-header {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: var(--shadow);
}

.bill-header .big-code {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-draft { background: var(--maintenance-bg); color: var(--maintenance); }
.badge-waiting, .badge-queued, .badge-confirmed { background: var(--queued-bg); color: var(--queued); }
.badge-cooking { background: var(--cooking-bg); color: var(--cooking); }
.badge-ready { background: var(--ready-bg); color: var(--ready); }
.badge-served { background: var(--served-bg); color: var(--served); }
#bdItems {
  height: calc(100vh - 180px);
  max-height: 660px;
  overflow-y: auto;
  padding-right: 4px;
}

#bdItems::-webkit-scrollbar {
  width: 4px;
}

#bdItems::-webkit-scrollbar-track {
  background: transparent;
}

#bdItems::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.item-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.item-row .meta {
  font-weight: 800;
  font-size: 15px;
}

.item-row .mod {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 3px;
}

.item-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.small-btn {
  background: var(--ink);
  color: var(--bg);
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.small-btn:hover {
  background: #3c352a;
}

.small-btn.danger {
  background: transparent;
  color: var(--occupied);
  border: 1.5px solid var(--occupied-bg);
}

.small-btn.danger:hover {
  background: var(--occupied-bg);
}

.bill-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ===== PAYMENT ===== */
.pay-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

.method-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.method-card .m-name {
  font-weight: 800;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.method-card input {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  width: 160px;
  text-align: right;
  background: var(--bg);
  color: var(--ink);
}

.summary-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 210px);
  max-height: 570px;
}

.summary-body::-webkit-scrollbar {
  width: 4px;
}

.summary-body::-webkit-scrollbar-track {
  background: transparent;
}

.summary-body::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 8px 0;
  color: var(--ink-soft);
}

.summary-row.total {
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  border-top: 2px solid var(--bg);
  margin-top: 10px;
  padding-top: 14px;
}

.summary-row .v {
  font-family: var(--font-mono);
  font-weight: 700;
}

.summary-row.remain {
  font-weight: 800;
  border-top: 1px dashed var(--line);
  margin-top: 6px;
  padding-top: 8px;
}

.summary-row.remain.zero {
  color: var(--available);
}

.summary-row.remain.pos {
  color: var(--occupied);
}

/* ===== KDS (KITCHEN DISPLAY SYSTEM) ===== */
.kds-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.kds-tabs button {
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}

.kds-tabs button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
  box-shadow: 0 3px 10px rgba(33, 29, 23, 0.15);
}

.kds-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  height: calc(100vh - 180px);
  max-height: 660px;
}

.kds-col {
  background: #EDEAE0;
  border-radius: var(--radius);
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.kds-col > div {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.kds-col > div::-webkit-scrollbar {
  width: 4px;
}

.kds-col > div::-webkit-scrollbar-track {
  background: transparent;
}

.kds-col > div::-webkit-scrollbar-thumb {
  background: rgba(33, 29, 23, 0.15);
  border-radius: 4px;
}

.kds-col h4 {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: var(--ink-soft);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding-bottom: 8px;
}

.kds-card {
  background: var(--panel);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-left: 4.5px solid var(--queued);
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.kds-col.col-cooking .kds-card { border-left-color: var(--cooking); }
.kds-col.col-ready .kds-card { border-left-color: var(--ready); }

.kds-card .k-table {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  color: var(--ink-soft);
}

.kds-card .k-name {
  font-weight: 800;
  font-size: 15px;
  margin: 4px 0;
}

.kds-card .k-mod {
  font-size: 12px;
  color: var(--ink-soft);
}

.kds-card .k-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  border-top: 1px solid var(--bg);
  padding-top: 8px;
}

.k-timer {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  font-weight: 600;
}

.k-timer.alert {
  color: var(--occupied);
  font-weight: 700;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

.kds-empty {
  color: var(--ink-soft);
  font-size: 13px;
  text-align: center;
  padding: 40px 0;
  font-style: italic;
}

/* ===== MODAL & OVERLAY ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(33, 29, 23, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease-out;
}

.modal-container {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  animation: scaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 10px;
}

.modal-desc {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-bottom: 16px;
  line-height: 1.4;
}

.modal-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 18px;
  background: var(--bg);
  color: var(--ink);
}

.merge-select-list {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
  background: var(--bg);
}

.split-items-list {
  max-height: 250px;
  overflow-y: auto;
  margin: 15px 0;
  padding: 0 5px;
}

.merge-target-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s ease;
  color: var(--ink);
}

.merge-target-item:last-child {
  border-bottom: none;
}

.merge-target-item:hover {
  background: var(--line);
}

.merge-target-item.selected {
  background: var(--queued-bg);
  color: var(--queued);
}

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

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 13.5px;
  opacity: 0;
  transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== RESPONSIVENESS ===== */
@media (max-width: 900px) {
  .ot-layout, .pay-layout {
    grid-template-columns: 1fr;
  }
  .kds-board {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .kds-col {
    min-height: 250px;
  }
  nav.screens {
    overflow-x: auto;
  }
}

@media (max-height: 800px) {
  .cart-panel {
    height: calc(100vh - 140px);
    max-height: 520px;
  }
  .summary-panel {
    height: calc(100vh - 220px);
    max-height: 430px;
  }
  #bdItems {
    height: calc(100vh - 190px);
    max-height: 480px;
  }
  #activeOrdersList {
    height: calc(100vh - 190px);
    max-height: 480px;
  }
  .kds-board {
    height: calc(100vh - 190px);
    max-height: 480px;
  }
}
