/* Larger, more readable screen typography with thermal-print refinements. */
body {
  font-size: 1rem;
  line-height: 1.5;
}

.app { grid-template-columns: 270px minmax(0, 1fr); }
.sidebar { padding: 22px 16px 16px; }
.brand b { font-size: 1.2rem; }
.brand small { font-size: 0.75rem; }
.nav-label { font-size: 0.7rem; }
.nav-link {
  gap: 11px;
  padding: 11px 12px;
  font-size: 0.9rem;
  line-height: 1.35;
}
.nav-link span { font-size: 1.15rem; }
.nav-key {
  min-width: 30px;
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.76);
  font: 700 0.68rem/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
  text-align: center;
}
.nav-link.active .nav-key { color: #fff; border-color: rgba(255, 255, 255, 0.34); }
.btn-dark-outline .nav-key { min-width: 34px; }
.offline-chip { font-size: 0.75rem; }

.topbar { min-height: 88px; }
.top-left h1 { font-size: 1.55rem; }
.top-left p { font-size: 0.82rem; }
.clock,
.shift-chip { font-size: 0.78rem; }

.card-head h2,
.section-head h2,
.subhead { font-size: 1.08rem; }
.card-head p,
.section-head p { font-size: 0.78rem; }
.stat label { font-size: 0.78rem; }
.stat strong { font-size: 1.7rem; }
.stat small { font-size: 0.74rem; }

.btn {
  min-height: 42px;
  padding: 8px 13px;
  font-size: 0.84rem;
}
.btn-sm {
  min-height: 34px;
  padding: 5px 9px;
  font-size: 0.72rem;
}
.control {
  min-height: 44px;
  padding: 9px 11px;
}
.field label { font-size: 0.75rem; }
.hint { font-size: 0.73rem; }
.seg button { font-size: 0.76rem; }
.pos-toolbar {
  align-items: stretch;
  flex-wrap: wrap;
}
.order-type-seg {
  width: min(490px, 100%);
  min-width: 0;
  flex: 0 1 490px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  border: 1px solid #d2ddd7;
  border-radius: 14px;
  background: #e6ece8;
}
.order-type-seg button {
  min-width: 0;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: 10px;
  color: #43504b;
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
  touch-action: manipulation;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.order-type-seg button::before {
  font-size: 1.08rem;
  line-height: 1;
}
.order-type-seg button[data-value="dine-in"]::before { content: "▦"; }
.order-type-seg button[data-value="takeaway"]::before { content: "▣"; }
.order-type-seg button[data-value="delivery"]::before { content: "➜"; }
.order-type-seg button:hover {
  background: rgba(255, 255, 255, 0.72);
  color: #153f36;
}
.order-type-seg button.active,
.order-type-seg button.active:hover {
  background: #153f36;
  color: #fff;
  box-shadow: 0 6px 16px rgba(21, 63, 54, 0.2);
}
.order-type-seg button:active { transform: scale(0.98); }
.order-type-seg button:focus-visible {
  outline: 3px solid rgba(231, 131, 61, 0.35);
  outline-offset: 2px;
}
.pos-toolbar .search {
  min-width: 260px;
  flex: 1 1 260px;
}
.pos-toolbar .search .control { min-height: 66px; }
.pos-toolbar .search::before { top: 15px; }
.badge { font-size: 0.65rem; }

.table th {
  padding: 12px;
  font-size: 0.7rem;
}
.table td {
  padding: 13px 12px;
  font-size: 0.8rem;
  line-height: 1.45;
}
.table .primary { font-size: 0.86rem; }
.small { font-size: 0.73rem; }
.empty b { font-size: 0.94rem; }

.quick b,
.activity-row b { font-size: 0.8rem; }
.quick small,
.activity-row small { font-size: 0.7rem; }
.activity-icon { font-size: 0.78rem; }

.cat-strip button { font-size: 0.74rem; }
.menu-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.menu-tile b { font-size: 0.9rem; }
.menu-tile small { font-size: 0.72rem; }
.menu-price { font-size: 0.96rem; }
.menu-tile.has-image {
  min-height: 294px;
  padding: 0;
  overflow: hidden;
  border-color: #d7dfda;
  background: #fbfcfb;
  box-shadow: 0 4px 14px rgba(25, 57, 46, 0.05);
}
.menu-thumb {
  width: calc(100% - 12px);
  height: auto;
  aspect-ratio: 36 / 25;
  display: block;
  flex: 0 0 auto;
  margin: 6px 6px 0;
  border-radius: 8px;
  object-fit: contain;
  object-position: center;
  background: #17211e;
}
.menu-tile.has-image > div:not(.menu-price) {
  width: 100%;
  flex: 1;
  padding: 11px 12px 0;
}
.menu-tile .menu-description {
  display: -webkit-box;
  margin-top: 7px;
  overflow: hidden;
  color: #43504b;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.menu-tile.has-image .menu-price {
  width: 100%;
  padding: 0 12px 12px;
}
.menu-image-field {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.menu-image-preview {
  width: 180px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #aebdb6;
  border-radius: 13px;
  background: #f7f9f7;
  color: #68746f;
  font-size: 0.75rem;
}
.menu-image-preview.has-image { border-style: solid; }
.menu-image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.menu-image-controls {
  min-width: 0;
  display: grid;
  gap: 8px;
  justify-items: start;
}
.menu-image-controls .control { max-width: 430px; }
.menu-table-item {
  min-width: 285px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.menu-table-thumb {
  width: 68px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 8px;
  background: #edf1ef;
}
.menu-table-item .small {
  max-width: 300px;
  margin-top: 3px;
  line-height: 1.35;
}
.cart-line b { font-size: 0.84rem; }
.cart-line small { font-size: 0.72rem; }
.qty span { font-size: 0.76rem; }
.line-note input { font-size: 0.72rem; }
.total-row { font-size: 0.78rem; }
.total-row.grand { font-size: 1.08rem; }

.table-card h3 { font-size: 0.94rem; }
.table-card p { font-size: 0.72rem; }
.table-bottom b { font-size: 0.8rem; }
.ticket-head h3 { font-size: 1rem; }
.ticket-head p,
.ticket-note { font-size: 0.72rem; }
.ticket-time { font-size: 0.76rem; }
.ticket-item { font-size: 0.82rem; }

.tabs button,
.bar-row,
.check-card { font-size: 0.76rem; }
.dialog-card h2 { font-size: 1.16rem; }
.dialog-card header p { font-size: 0.74rem; }
.toast { font-size: 0.8rem; }
.lock-card p { font-size: 0.78rem; }
.error { font-size: 0.74rem; }
.switch-copy b { font-size: 0.82rem; }
.switch-copy small { font-size: 0.7rem; }
.logo-preview { font-size: 0.72rem; }
.backup-schedule {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 8px;
}
.backup-schedule > div {
  padding: 12px;
  border: 1px solid #cfe2da;
  border-radius: 11px;
  background: #f2f8f5;
}
.backup-schedule span {
  display: block;
  color: #68746f;
  font-size: 0.72rem;
}
.backup-schedule strong {
  display: block;
  margin-top: 3px;
  color: #153f36;
  font-size: 0.92rem;
}

@media (max-width: 880px) {
  .sidebar { width: 270px; }
}

@media (max-width: 620px) {
  .top-left h1 { font-size: 1.3rem; }
  .nav-link { font-size: 0.88rem; }
  .table td { font-size: 0.78rem; }
  .backup-schedule { grid-template-columns: 1fr; }
  .menu-image-field { grid-template-columns: 1fr; }
  .menu-image-preview { width: 100%; max-width: 260px; }
  .order-type-seg {
    width: 100%;
    flex-basis: auto;
    gap: 4px;
    padding: 4px;
  }
  .order-type-seg button {
    min-height: 50px;
    gap: 4px;
    padding: 8px 4px;
    font-size: 0.82rem;
  }
  .order-type-seg button::before { font-size: 0.92rem; }
  .pos-toolbar .search { min-width: 0; }
  .pos-toolbar .search .control { min-height: 50px; }
  .pos-toolbar .search::before { top: 8px; }
}

@media print {
  .receipt:not(.kot) {
    box-sizing: border-box;
    padding: 1.5mm 0 4mm;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
    text-rendering: optimizeSpeed;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    forced-color-adjust: none;
  }

  .receipt:not(.kot),
  .receipt:not(.kot) * {
    color: #000 !important;
    opacity: 1 !important;
    text-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .receipt:not(.kot) :where(
    h1,
    .receipt-contact,
    .receipt-info,
    .receipt-sale-table,
    .receipt-summary,
    .receipt-grand-total,
    .receipt-note,
    .receipt-foot
  ) {
    -webkit-text-stroke: 0.24px #000;
    paint-order: stroke fill;
  }

  .receipt:not(.kot).mm58 {
    width: 48mm;
    font-size: 11px;
  }

  .receipt:not(.kot).mm80 {
    width: 70mm;
    font-size: 12.5px;
  }

  .receipt:not(.kot) .receipt-brand {
    margin-bottom: 2.5mm;
    text-align: center;
  }

  .receipt:not(.kot) .receipt-logo {
    display: block;
    width: 31mm;
    max-width: 46%;
    height: auto;
    max-height: 30mm;
    margin: 0 auto 2.5mm;
    object-fit: contain;
    object-position: center;
    filter: grayscale(1) contrast(2.25);
  }

  .receipt:not(.kot).mm58 .receipt-logo {
    width: 23mm;
    max-height: 22mm;
  }

  .receipt:not(.kot) .receipt-brand h1 {
    margin: 0 0 1.2mm;
    font-size: 1.34em;
    font-weight: 900;
    -webkit-text-stroke-width: 0.34px;
    line-height: 1.08;
    letter-spacing: 0;
    text-transform: uppercase;
    overflow-wrap: normal;
    word-break: normal;
    text-wrap: balance;
  }

  .receipt:not(.kot) .receipt-contact {
    font-size: 0.9em;
    font-weight: 700;
    line-height: 1.32;
    white-space: pre-line;
  }

  .receipt:not(.kot) .receipt-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, auto);
    gap: 1mm 2mm;
    margin: 0;
    padding: 2.5mm 0;
    border-top: 0.3mm dashed #000;
    border-bottom: 0.3mm dashed #000;
    font-size: 0.96em;
    font-weight: 700;
  }

  .receipt:not(.kot) .receipt-info .right {
    min-width: 0;
    text-align: right !important;
    overflow-wrap: normal;
    word-break: normal;
  }

  .receipt:not(.kot) .receipt-info .full {
    grid-column: 1 / -1;
    overflow-wrap: anywhere;
  }

  .receipt:not(.kot) .receipt-service {
    font-weight: 700;
  }

  .receipt:not(.kot) .receipt-sale-table {
    width: 100%;
    margin: 2.2mm 0 0;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.98em;
  }

  .receipt:not(.kot) .receipt-sale-table th,
  .receipt:not(.kot) .receipt-sale-table td {
    padding: 1.15mm 0;
    border: 0;
    text-align: left;
    vertical-align: top;
  }

  .receipt:not(.kot) .receipt-sale-table thead tr,
  .receipt:not(.kot) .receipt-sale-table tbody tr:last-child {
    border-bottom: 0.3mm dashed #000;
  }

  .receipt:not(.kot) .receipt-sale-table th {
    padding-bottom: 1.5mm;
    font-weight: 700;
  }

  .receipt:not(.kot) .receipt-sale-table th:nth-child(2),
  .receipt:not(.kot) .receipt-sale-table td:nth-child(2) {
    width: 10mm;
    text-align: center;
  }

  .receipt:not(.kot) .receipt-sale-table th:last-child,
  .receipt:not(.kot) .receipt-sale-table td:last-child {
    width: 23mm;
    text-align: right;
    white-space: nowrap;
  }

  .receipt:not(.kot) .receipt-sale-table td small {
    display: block;
    font-size: 0.84em;
    font-weight: 700;
  }

  .receipt:not(.kot) .receipt-sale-table tbody td,
  .receipt:not(.kot) .receipt-summary-row {
    font-weight: 700;
  }

  .receipt:not(.kot) .receipt-summary {
    display: grid;
    gap: 1mm;
    padding-top: 2.2mm;
  }

  .receipt:not(.kot) .receipt-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 3mm;
  }

  .receipt:not(.kot) .receipt-grand-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3mm;
    margin-top: 2.2mm;
    padding: 2.2mm 2.5mm;
    border: 0.45mm solid #000;
    border-radius: 1.5mm;
    background: #fff !important;
    box-shadow: none !important;
    font-size: 1.45em;
    font-weight: 900;
    -webkit-text-stroke-width: 0.34px;
  }

  .receipt:not(.kot) .receipt-grand-total strong {
    font-size: 1.08em;
  }

  .receipt:not(.kot) .receipt-note {
    margin-top: 2.5mm;
    font-weight: 700;
    overflow-wrap: anywhere;
  }

  .receipt:not(.kot) .receipt-foot {
    margin-top: 3.5mm;
    font-size: 0.9em;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
  }
}

.brand-logo.has-image,
.boot-mark.has-image {
  background-color: #fff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  color: transparent;
}

.logo-preview {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.receipt-note-editor {
  display: grid;
  gap: 5px;
  padding: 11px 13px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.receipt-note-editor label {
  color: #43504b;
  font-size: 0.72rem;
  font-weight: 900;
}

.receipt-note-editor textarea {
  min-height: 58px;
  font-size: 0.78rem;
}

.setup-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px;
  border: 1px solid #b9d7c9;
  border-radius: var(--r);
  background: linear-gradient(120deg, #e7f1ed, #fff);
}

.setup-welcome span {
  color: var(--green2);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.setup-welcome h2 {
  margin: 4px 0;
  font-size: 1.35rem;
}

.setup-welcome p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
}

.setup-steps {
  display: grid;
  gap: 6px;
  min-width: 210px;
  color: var(--green);
}

@media (max-width: 760px) {
  .setup-welcome { align-items: flex-start; flex-direction: column; }
  .setup-steps { min-width: 0; }
}
