:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  --ink: #1f2933;
  --muted: #5c6875;
  --line: #d8dee7;
  --paper: #ffffff;
  --surface: #f5f7fa;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #b45309;
  --good: #047857;
  --danger: #b91c1c;
  --shadow: 0 14px 34px rgba(31, 41, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef3f6;
  color: var(--ink);
}

.login-screen {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(5, 39, 67, 0.94), rgba(15, 118, 110, 0.88)),
    var(--login-background, none);
  background-position: center;
  background-size: cover;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-screen[hidden],
.app[hidden] {
  display: none;
}

.login-card {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(3, 24, 43, 0.4);
  max-width: 440px;
  overflow: hidden;
  padding: 28px;
  width: 100%;
}

.login-brand {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}

.login-logo-frame {
  align-items: center;
  background: linear-gradient(145deg, #0f766e, #123c73);
  border-radius: 16px;
  color: white;
  display: flex;
  flex: 0 0 auto;
  font-size: 2rem;
  font-weight: 950;
  height: 68px;
  justify-content: center;
  overflow: hidden;
  width: 68px;
}

.login-logo-frame img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.login-brand p {
  color: #b45309;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  margin: 0 0 4px;
}

.login-brand h1 {
  color: #123c73;
  font-size: 1.7rem;
  line-height: 1.05;
}

.login-brand span {
  color: #526171;
  font-size: 0.78rem;
}

.login-form {
  display: grid;
  gap: 8px;
}

.login-form label {
  color: #334155;
  font-size: 0.78rem;
  font-weight: 800;
  margin-top: 5px;
}

.login-form input {
  border: 1px solid #b9c8d8;
  border-radius: 10px;
  min-height: 48px;
  padding: 0.7rem 0.8rem;
}

.login-form button {
  margin-top: 10px;
  width: 100%;
}

.login-message {
  color: #b91c1c;
  font-size: 0.8rem;
  margin: 4px 0 0;
  min-height: 1.1rem;
}

.login-footer {
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.7rem;
  margin: 20px 0 0;
  padding-top: 14px;
  text-align: center;
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 90ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.62rem 0.82rem;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

button:not(:disabled):hover {
  filter: brightness(0.97);
}

button:not(:disabled):active {
  background: #fbbf24 !important;
  box-shadow: inset 0 4px 10px #0004;
  color: #172033 !important;
  transform: scale(0.92);
}

button.is-working {
  cursor: progress;
  filter: saturate(0.75);
}

button.button-confirmed {
  animation: confirmed-tap 700ms ease-out;
  background: #047857 !important;
  box-shadow: 0 0 0 5px #34d39966, 0 8px 18px #04785744 !important;
  color: #fff !important;
}

@keyframes confirmed-tap {
  0% { transform: scale(0.9); }
  35% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}

.app {
  width: min(1260px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 18px;
}

.shop-identity {
  align-items: center;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.shop-logo-frame,
.receipt-logo-frame {
  align-items: center;
  background: linear-gradient(145deg, #0f766e, #123c73);
  border: 2px solid #fff;
  border-radius: 16px;
  box-shadow: 0 6px 18px #123c7326;
  color: #fff;
  display: flex;
  flex: 0 0 auto;
  font-size: 1.65rem;
  font-weight: 900;
  height: 64px;
  justify-content: center;
  overflow: hidden;
  width: 64px;
}

.shop-logo-frame img,
.receipt-logo-frame img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.shop-meta {
  color: #526171;
  font-size: 0.75rem;
  line-height: 1.35;
  margin: 0.18rem 0 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  letter-spacing: 0;
}

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

.language-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(70px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.language-switch button {
  min-height: 38px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.language-switch button.active {
  background: var(--brand);
  color: white;
}

.primary-button,
.wide-button {
  background: var(--brand);
  color: white;
  font-weight: 800;
  padding: 0 18px;
}

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

.icon-button,
.settings-actions button,
.panel-heading button,
.manual-command button,
.cash-entry button,
.quick-cash button {
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 700;
  padding: 0 14px;
}

.voice-strip,
.mic-help,
.manual-command,
.summary-band,
.order-panel,
.menu-panel,
.payment-panel,
.transaction-history,
.settings-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.voice-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.mic-help {
  margin-top: 12px;
  padding: 14px 16px;
  border-left: 5px solid var(--danger);
  box-shadow: none;
}

.mic-help strong {
  display: block;
  margin-bottom: 8px;
  color: var(--danger);
}

.mic-help ol {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-weight: 700;
}

.mic-help li + li {
  margin-top: 4px;
}

.voice-strip div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 145px;
}

.voice-strip p {
  margin: 0;
  color: var(--muted);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--good);
  display: inline-block;
}

.status-dot.hot {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(185, 28, 28, 0.12);
}

.manual-command {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  box-shadow: none;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  overflow: hidden;
}

.summary-band div {
  display: grid;
  gap: 4px;
  padding: 16px;
  background: #fbfcfd;
}

.summary-band span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.summary-band strong {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.05;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.4fr) minmax(260px, 0.8fr);
  gap: 14px;
  margin-top: 14px;
}

.order-panel,
.menu-panel,
.payment-panel,
.settings-panel {
  padding: 16px;
}

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

.panel-heading span {
  color: var(--muted);
  font-weight: 700;
}

.order-lines {
  display: grid;
  gap: 10px;
}

.order-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.order-name {
  display: grid;
  gap: 3px;
}

.order-name strong {
  font-size: 17px;
}

.order-name span {
  color: var(--muted);
  font-size: 13px;
}

.line-actions {
  display: grid;
  grid-template-columns: repeat(3, 42px);
  gap: 6px;
}

.line-actions button {
  min-height: 38px;
  padding: 0;
  background: white;
  border-color: var(--line);
  font-weight: 900;
}

.empty-state {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  text-align: center;
}

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

.menu-item {
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  text-align: left;
}

.menu-item strong,
.menu-item span {
  display: block;
}

.menu-item strong {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 16px;
}

.menu-item span {
  color: var(--brand-dark);
  font-size: 18px;
  font-weight: 900;
}

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

.payment-panel label,
.help-text {
  color: var(--muted);
  font-weight: 700;
}

.cash-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.quick-cash {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.payment-result {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding: 16px;
  border-radius: 8px;
  background: #ecfdf5;
  color: var(--good);
}

.payment-result.due {
  background: #fef2f2;
  color: var(--danger);
}

.payment-result span {
  font-size: 14px;
  font-weight: 800;
}

.payment-result strong {
  font-size: 32px;
}

.settings-panel {
  margin-top: 14px;
}

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

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

.help-text {
  margin: 12px 0 0;
  font-size: 13px;
}

.receipt {
  display: none;
}

.platform-footer {
  align-items: center;
  color: #64748b;
  display: flex;
  font-size: 0.75rem;
  gap: 0.45rem;
  justify-content: center;
  padding: 18px 8px 4px;
}

.platform-footer strong {
  color: #0f766e;
}

@media (max-width: 980px) {
  .workbench {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .app {
    padding: 12px;
  }

  .topbar,
  .voice-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .shop-identity {
    align-items: flex-start;
  }

  .shop-logo-frame {
    height: 52px;
    width: 52px;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions button,
  .manual-command button {
    flex: 1;
  }

  .language-switch {
    width: 100%;
  }

  .manual-command,
  .summary-band,
  .cash-entry,
  .menu-editor {
    grid-template-columns: 1fr;
  }

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

  .summary-band strong {
    font-size: 30px;
  }
}

@media print {
  body {
    background: white;
  }

  .app > :not(.receipt) {
    display: none !important;
  }

  .app {
    width: 72mm;
    padding: 0;
  }

  .receipt {
    display: block;
    color: black;
    font-size: 13px;
    padding: 8px;
  }

  .receipt-logo-frame {
    border: 1px solid #777;
    border-radius: 8px;
    box-shadow: none;
    height: 46px;
    margin: 0 auto 6px;
    width: 46px;
  }

  .receipt h2,
  #receiptShopPlace,
  #receiptAddress,
  #receiptContact,
  #receiptRegulatory,
  .thanks {
    text-align: center;
  }

  .receipt-provider {
    border-top: 1px dashed #999;
    font-size: 9px;
    margin-top: 8px;
    padding-top: 5px;
    text-align: center;
  }

  #receiptShopPlace,
  #receiptAddress,
  #receiptContact,
  #receiptRegulatory {
    font-size: 11px;
    margin-bottom: 3px;
  }

  .receipt-line,
  .receipt-total {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px dashed #999;
    padding: 6px 0;
  }
}

/* Voice POS v2: bill lifecycle and verified-payment controls */
.bill-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.bill-control > div {
  background: #fff;
  border: 1px solid #d8e1ea;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.7rem 0.85rem;
}

.bill-control span {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill {
  border-radius: 999px;
  color: #fff;
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.2rem 0.65rem;
  width: fit-content;
}

.status-draft { background: #475569; }
.status-pending { background: #d97706; }
.status-received { background: #16823b; }
.status-closed { background: #123c73; }
.status-failed { background: #c81e1e; }

.payment-mode {
  background: #e9eef5;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 0.85rem;
  padding: 0.25rem;
}

.payment-mode button {
  background: transparent;
  border: 0;
}

.payment-mode button.active {
  background: #fff;
  box-shadow: 0 1px 4px #0002;
  color: #123c73;
}

.plan-badge {
  background: #dff5ef;
  border: 1px solid #9bd8ca;
  border-radius: 999px;
  color: #0f5f59;
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  margin-top: 0.35rem;
  padding: 0.28rem 0.55rem;
}

.manual-upi-panel {
  background: #f0fdfa;
  border: 1px solid #99d8cc;
  border-radius: 12px;
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  padding: 0.85rem;
}

.manual-upi-panel[hidden] {
  display: none;
}

.manual-upi-panel strong {
  color: #0f5f59;
}

.manual-upi-panel p {
  color: #475569;
  font-size: 0.8rem;
  line-height: 1.4;
  margin: 0;
}

.manual-upi-panel label,
#cashPinLabel {
  color: #334155;
  font-size: 0.76rem;
  font-weight: 800;
}

.manual-upi-panel input,
#cashEmployeePin {
  background: #fff;
  border: 1px solid #b9c8d8;
  border-radius: 9px;
  font: inherit;
  min-height: 44px;
  padding: 0.65rem 0.7rem;
  width: 100%;
}

.manual-upi-panel .manual-warning {
  color: #8a4b08;
  font-size: 0.72rem;
}

#cashEmployeePin {
  margin: 0.35rem 0 0.7rem;
}

.voice-payment-help {
  background: #edf7f5;
  border: 1px solid #b9ded8;
  border-radius: 10px;
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.75rem;
}

.voice-payment-help strong {
  color: #0f5f59;
  font-size: 0.82rem;
}

.voice-payment-help span,
.voice-payment-help small {
  color: #475569;
  font-size: 0.72rem;
  line-height: 1.35;
}

.payment-safety {
  color: #8a4b08;
  font-size: 0.82rem;
  line-height: 1.35;
  margin: 0 0 0.8rem;
}

.payment-primary {
  background: #5731a8;
}

.upi-qr-card {
  align-items: center;
  background: #f7f5ff;
  border: 1px solid #d8ccf2;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.8rem 0;
  padding: 0.8rem;
  text-align: center;
}

.egai-pay-brand {
  align-items: center;
  color: #172033;
  display: flex;
  gap: 0.65rem;
  justify-content: center;
}

.egai-pay-mark {
  align-items: center;
  background: linear-gradient(145deg, #0f766e, #123c73);
  border-radius: 12px;
  box-shadow: 0 4px 12px #123c7333;
  color: #fff;
  display: inline-flex;
  font-size: 1.45rem;
  font-style: italic;
  font-weight: 950;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.egai-pay-name {
  display: grid;
  text-align: left;
}

.egai-pay-name strong {
  color: #123c73;
  font-size: 1.25rem;
  line-height: 1.05;
}

.egai-pay-name small {
  color: #0f766e;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.qr-display {
  align-items: center;
  aspect-ratio: 1 / 1;
  background:
    linear-gradient(90deg, #fff 12px, transparent 12px) 0 0/24px 24px,
    linear-gradient(#fff 12px, #172033 12px) 0 0/24px 24px;
  border: 10px solid #fff;
  box-shadow: 0 0 0 1px #ccd4df;
  display: flex;
  height: auto;
  justify-content: center;
  overflow: hidden;
  width: min(260px, calc(100vw - 88px));
}

.qr-display img {
  background: #fff;
  height: 100%;
  image-rendering: crisp-edges;
  object-fit: contain;
  width: 100%;
}

.qr-display span {
  background: #fffffff2;
  color: #334155;
  font-size: 0.72rem;
  line-height: 1.2;
  padding: 0.45rem;
}

.qr-expand-button {
  background: #123c73;
  margin-bottom: 0.8rem;
}

.qr-close-button {
  background: #fff;
  border: 2px solid #cbd5e1;
  color: #172033;
  font-weight: 900;
  position: absolute;
  right: 20px;
  top: 20px;
}

body.qr-open {
  overflow: hidden;
}

.upi-qr-card.expanded {
  background: #f7f5ff;
  border: 0;
  border-radius: 0;
  inset: 0;
  justify-content: center;
  margin: 0;
  padding: 80px 28px 54px;
  position: fixed;
  z-index: 1000;
}

.upi-qr-card.expanded .egai-pay-brand {
  background: #ffffffee;
  border: 1px solid #d8ccf2;
  border-radius: 16px;
  box-shadow: 0 8px 24px #123c7324;
  left: 50%;
  padding: 8px 18px;
  position: fixed;
  top: 16px;
  transform: translateX(-50%);
  z-index: 1002;
}

.upi-qr-card.expanded .egai-pay-mark {
  height: 52px;
  width: 52px;
}

.upi-qr-card.expanded .egai-pay-name strong {
  font-size: clamp(24px, 3vw, 34px);
}

.upi-qr-card.expanded .qr-display {
  border-width: 18px;
  height: auto;
  width: min(64vmin, 500px);
}

.upi-qr-card.expanded .qr-display img {
  flex: 0 0 auto;
  height: 190%;
  max-height: none;
  max-width: none;
  width: 190%;
}

.upi-qr-card.expanded #upiAmount {
  color: #172033;
  font-size: clamp(32px, 5vw, 54px);
}

.upi-qr-card.expanded #upiExpires {
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 800;
}

.upi-qr-card.expanded #paymentReference {
  font-size: 14px;
  margin: 0;
}

.payment-trust {
  color: #475569;
  display: grid;
  font-size: 0.72rem;
  gap: 0.05rem;
  line-height: 1.25;
}

.payment-trust strong {
  color: #123c73;
}

.upi-qr-card.expanded .payment-trust {
  background: #ffffffee;
  border-radius: 10px;
  bottom: 10px;
  font-size: clamp(12px, 1.5vw, 15px);
  left: 50%;
  padding: 5px 16px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 1002;
}

.upi-link {
  color: #fff;
  display: block;
  text-decoration: none;
}

.verification-actions {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr 1fr;
}

.gateway-message {
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.35;
  min-height: 2.2em;
}

.gateway-message.success { color: #16823b; font-weight: 700; }
.gateway-message.error { color: #c81e1e; font-weight: 700; }

.print-button {
  margin-top: 0.8rem;
}

.print-button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  opacity: 0.7;
}

.action-toast {
  background: #123c73;
  border: 2px solid #fff;
  border-radius: 14px;
  bottom: auto;
  box-shadow: 0 12px 34px #0004;
  color: #fff;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 850;
  left: 50%;
  max-width: min(92vw, 520px);
  padding: 13px 22px;
  position: fixed;
  text-align: center;
  top: 86px;
  transform: translateX(-50%);
  z-index: 1200;
  animation: toast-in 220ms ease-out;
}

.action-toast.success { background: #047857; }
.action-toast.error { background: #b91c1c; }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -14px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.transaction-history {
  margin-top: 18px;
  padding: 18px;
}

.section-kicker {
  color: #0f766e;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
}

.transaction-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 1fr);
  margin: 16px 0;
}

.transaction-summary > div {
  background: #f1f6f8;
  border: 1px solid #d7e3e8;
  border-radius: 10px;
  display: grid;
  gap: 5px;
  padding: 12px 14px;
}

.transaction-summary span {
  color: #5c6875;
  font-size: 0.78rem;
  font-weight: 700;
}

.transaction-summary strong {
  color: #123c73;
  font-size: 1.35rem;
}

.transaction-table-wrap {
  overflow-x: auto;
}

.transaction-table {
  border-collapse: collapse;
  min-width: 680px;
  width: 100%;
}

.transaction-table th,
.transaction-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 12px;
  text-align: left;
}

.transaction-table th {
  color: #475569;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.transaction-table td:last-child,
.transaction-table th:last-child {
  text-align: right;
}

.transaction-mode {
  background: #e8f5f2;
  border-radius: 999px;
  color: #0f766e;
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 850;
  padding: 3px 9px;
}

.history-message {
  color: #5c6875;
  font-size: 0.78rem;
  margin: 10px 0 0;
}

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

  .transaction-summary {
    grid-template-columns: 1fr 1fr;
  }

  .upi-qr-card.expanded .egai-pay-brand {
    top: 8px;
  }
}

@media print {
  .bill-control {
    display: none !important;
  }
}

/* EGAI Tablet POS Basic */
.app {
  width: min(1600px, 100%);
  padding: 14px 18px 28px;
}

.top-actions {
  flex-wrap: wrap;
}

.employee-button {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 5px;
  border-radius: 999px;
  background: #dc2626;
}

.device-dot.ready {
  background: #16a34a;
  box-shadow: 0 0 0 3px #16a34a24;
}

.workbench {
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.3fr) minmax(240px, 0.9fr);
}

.menu-item {
  min-height: 86px;
  touch-action: manipulation;
}

.line-actions button,
.quick-cash button,
.payment-mode button {
  min-height: 46px;
}

.static-qr-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}

.static-qr-card img {
  width: min(220px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
  background: white;
}

.static-qr-card > strong {
  color: var(--ink);
  font-size: 1.65rem;
}

.static-qr-fallback {
  display: grid;
  gap: 5px;
  min-height: 150px;
  place-content: center;
  padding: 16px;
  text-align: center;
  color: #64748b;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
}

.static-qr-fallback strong,
.static-qr-fallback span {
  display: block;
}

.tablet-dialog,
.static-qr-dialog {
  width: min(720px, calc(100% - 28px));
  max-height: 90vh;
  border: 0;
  border-radius: 18px;
  padding: 22px;
  color: var(--ink);
  background: white;
  box-shadow: 0 28px 90px #0f172a55;
}

.tablet-dialog::backdrop,
.static-qr-dialog::backdrop {
  background: #0f172ab8;
  backdrop-filter: blur(3px);
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dialog-heading h2 {
  margin: 3px 0;
}

.employee-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.employee-option {
  display: grid;
  gap: 4px;
  min-height: 88px;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.employee-option.active {
  color: #0f766e;
  border-color: #0f766e;
  background: #ecfdf5;
}

.employee-option span {
  color: #64748b;
  font-size: 0.78rem;
}

.printer-setup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.printer-setup label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-weight: 750;
}

.printer-setup label:last-of-type,
.printer-setup .wide-button {
  grid-column: 1 / -1;
}

.printer-note {
  color: #64748b;
}

.static-qr-dialog {
  width: min(760px, calc(100% - 20px));
  text-align: center;
}

.static-qr-dialog[open] {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.static-qr-dialog .qr-close-button {
  justify-self: end;
}

.static-qr-dialog img {
  width: min(520px, 75vh, 90vw);
  aspect-ratio: 1;
  object-fit: contain;
  background: white;
}

.static-qr-dialog > strong {
  font-size: clamp(2.5rem, 7vw, 5rem);
}

.static-qr-fullscreen-brand {
  display: grid;
  gap: 2px;
  color: #0f766e;
}

.static-qr-fullscreen-brand strong {
  font-size: 1.5rem;
}

.printer-test-receipt {
  display: none;
}

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

  .printer-setup {
    grid-template-columns: 1fr;
  }

  .printer-setup label:last-of-type,
  .printer-setup .wide-button {
    grid-column: auto;
  }
}

@media print {
  body.printing-test .app,
  body.printing-test .login-screen,
  body.printing-test dialog {
    display: none !important;
  }

  body.printing-test .printer-test-receipt {
    display: block !important;
    width: 58mm;
    margin: 0;
    padding: 5mm;
    color: black;
    background: white;
    text-align: center;
    font-family: ui-monospace, monospace;
  }

  body.printer-80mm .app {
    width: 76mm;
  }

  body:not(.printer-80mm) .app {
    width: 54mm;
  }
}
