:root {
  --paper: #fff;
  --ink: #111;
  --muted: #555;
  --desk: #f3f5f7;
  --line: #d7dde3;
  --panel: #fff;
  --accent: #111827;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--desk);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 380px);
  padding: 28px;
  border: 1px solid #c6ccd1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 42px rgb(0 0 0 / 14%);
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  place-items: center;
  border: 2px solid #111;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
}

.login-card h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.login-card p {
  margin: 8px 0 22px;
  color: #515151;
  font-size: 14px;
}

.login-card label {
  display: block;
  margin: 14px 0 6px;
  color: #282828;
  font-size: 13px;
  font-weight: 700;
}

.login-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #9fa6ad;
  border-radius: 6px;
  padding: 10px 12px;
  color: #111;
  font: inherit;
}

.login-card input:focus {
  border-color: #111;
  outline: 2px solid rgb(17 17 17 / 16%);
}

.login-error {
  min-height: 18px;
  margin: 12px 0 8px !important;
  color: #9b1c1c !important;
  font-weight: 700;
}

.login-button {
  width: 100%;
  background: #111;
  color: #fff;
}

.demo-note {
  margin: 14px 0 0 !important;
  text-align: center;
}

.app-shell {
  display: none;
}

body.is-authenticated .login-screen {
  display: none;
}

body.is-authenticated .app-shell {
  display: grid;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid #202832;
  background: #111820;
  color: #fff;
  padding: 14px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgb(255 255 255 / 14%);
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  margin: 0;
  border-color: #fff;
  border-radius: 5px;
  font-size: 13px;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  font-size: 13px;
  line-height: 1.2;
}

.sidebar-brand span {
  margin-top: 2px;
  color: #b8c0c7;
  font-size: 11px;
}

.sidebar-nav {
  display: grid;
  flex: 1;
  align-content: start;
  grid-auto-rows: min-content;
  gap: 6px;
  margin-top: 12px;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-button {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: flex-start;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #dfe5ea;
  font-size: 13px;
  font-weight: 700;
  min-height: 34px;
  padding: 7px 9px;
  text-align: left;
  text-decoration: none;
}

.nav-button.active,
.nav-button:hover {
  border-color: rgb(255 255 255 / 12%);
  background: #fff;
  color: #111;
}

.sidebar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: auto;
  border-color: rgb(255 255 255 / 22%);
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.workspace {
  min-width: 0;
  padding: 22px 30px 40px;
}

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

.topbar h1 {
  margin: 3px 0 0;
  color: #15191d;
  font-size: 26px;
  line-height: 1.15;
}

.eyebrow {
  color: #5b6470;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: #47505a;
  font-size: 13px;
  font-weight: 700;
}

.db-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
}

.db-pill.connected {
  border-color: #b8d7c0;
  background: #edf8f0;
  color: #165f2c;
}

.db-pill.offline {
  border-color: #efd5a3;
  background: #fff8e8;
  color: #7a4b00;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  color: #202020;
}

.master-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.master-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.master-header p {
  margin: 6px 0 0;
  color: #4b4b4b;
  font-size: 14px;
}

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

.module-actions p {
  margin: 0;
  color: #4b4b4b;
  font-size: 14px;
}

.master-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.data-table-controls,
.data-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.data-table-controls {
  margin-top: 18px;
}

.data-table-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #30363b;
  font-size: 13px;
  font-weight: 700;
}

.data-table-controls select,
.data-table-controls input {
  min-height: 36px;
  border: 1px solid #aab1b8;
  border-radius: 6px;
  padding: 7px 9px;
  background: #fff;
  color: #111;
  font: inherit;
}

.data-table-controls input {
  width: min(260px, 42vw);
}

.data-table-footer {
  color: #59616a;
  font-size: 13px;
  font-weight: 700;
}

.data-table-pages {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.data-table-pages button {
  min-width: 68px;
  min-height: 32px;
  border-color: #9aa2a9;
  border-radius: 6px;
  padding: 5px 10px;
  background: #fff;
  color: #222a31;
  font-size: 12px;
  font-weight: 800;
}

.data-table-pages button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.data-table-empty {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  padding: 16px;
  background: #fff;
  color: #59616a;
  font-size: 14px;
  font-weight: 700;
}

.master-row {
  display: grid;
  grid-template-columns: 0.8fr 0.7fr 0.9fr 0.9fr 1fr;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid #e3e6e8;
  font-size: 14px;
}

.master-row.room-row {
  grid-template-columns: 0.9fr 0.8fr 1fr 1fr;
}

.master-row:first-child {
  border-top: 0;
}

.master-head {
  background: #f4f6f7;
  color: #3f454a;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.master-table.menu .master-row {
  grid-template-columns: 0.65fr 1.3fr 0.9fr 0.6fr 0.7fr 1fr;
}

.master-table.hotel .master-row {
  grid-template-columns: 1fr 1.25fr 0.75fr 0.85fr 1fr;
}

.master-table.order-list .master-row {
  grid-template-columns: 0.65fr 0.85fr 0.5fr 0.9fr 0.65fr 0.65fr 0.65fr 0.65fr 0.7fr 0.7fr 1.4fr;
  min-width: 1220px;
}

.master-table.billing-items .master-row,
.master-table.report-list .master-row {
  grid-template-columns: 1.2fr 1.4fr 0.8fr 0.8fr;
}

.billing-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.form-card,
.summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.form-card {
  padding: 18px;
}

.master-form {
  margin-bottom: 18px;
}

.form-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.2;
}

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

.form-grid.compact {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: #30363b;
  font-size: 13px;
  font-weight: 700;
}

.form-grid input,
.form-grid select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #aab1b8;
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: #111;
  font: inherit;
}

.order-items-editor {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

[data-order-items] {
  display: grid;
  gap: 8px;
}

.order-item-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.45fr) minmax(180px, 1.45fr) minmax(80px, 0.45fr) minmax(100px, 0.6fr) minmax(110px, 0.65fr) minmax(86px, 0.45fr);
  gap: 10px;
  align-items: center;
}

.order-item-head {
  color: #4a525a;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.order-item-row input,
.order-item-row select,
.payment-grid input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #aab1b8;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: #111;
  font: inherit;
}

.order-item-row input[readonly],
.payment-grid input[readonly] {
  background: #f4f6f7;
}

.item-count-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.item-count-cell strong {
  min-width: 16px;
  color: #222a31;
  font-size: 14px;
  line-height: 1;
  text-align: center;
}

.item-count-cell .item-toggle {
  min-width: 28px;
  width: 28px;
  min-height: 28px;
  height: 28px;
  border-color: #aab1b8;
  border-radius: 6px;
  padding: 0;
  background: #fff;
  color: #222a31;
}

.item-count-cell .item-toggle svg {
  width: 14px;
  height: 14px;
}

.item-count-cell .item-toggle:hover {
  border-color: #111;
  background: #f8fafb;
}

.order-items-detail {
  border-top: 1px solid #e3e6e8;
  background: #fbfcfd;
  padding: 12px 16px 14px;
}

.order-items-detail-inner {
  max-width: 720px;
  border: 1px solid #e0e4e8;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.order-items-detail-head,
.order-items-detail-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 80px 90px 100px;
  gap: 10px;
  padding: 10px 12px;
}

.order-items-detail-head {
  background: #f4f6f7;
  color: #3f454a;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.order-items-detail-row {
  border-top: 1px solid #eef1f3;
  font-size: 13px;
}

.order-items-detail-row span:first-child {
  overflow-wrap: anywhere;
}

.add-item-button {
  justify-self: start;
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.payment-grid label {
  display: grid;
  gap: 6px;
  color: #30363b;
  font-size: 13px;
  font-weight: 700;
}

.print-preview-panel {
  margin-top: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-summary {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-grid.wide {
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.7fr);
}

.dashboard-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.dashboard-panel-wide {
  min-width: 0;
}

.dashboard-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-panel-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.dashboard-panel-head p {
  margin: 5px 0 0;
  color: #59616a;
  font-size: 13px;
}

.dashboard-panel-head .action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 82px;
  border: 1px solid #111;
  border-radius: 6px;
  padding: 6px 10px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

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

.status-metrics div,
.master-health a,
.top-items div {
  border: 1px solid #e0e4e8;
  border-radius: 6px;
  background: #f8fafb;
  padding: 12px;
}

.master-health a {
  color: inherit;
  text-decoration: none;
}

.status-metrics span,
.master-health span,
.top-items span {
  display: block;
  color: #59616a;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-metrics strong,
.master-health strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.1;
}

.master-table.dashboard-orders .master-row {
  grid-template-columns: 0.65fr 0.9fr 0.55fr 1fr 0.65fr 0.65fr 0.75fr 1fr;
  min-width: 920px;
}

.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.report-filter {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.report-filter label {
  display: grid;
  gap: 6px;
  color: #30363b;
  font-size: 13px;
  font-weight: 700;
}

.report-filter input {
  min-height: 36px;
  border: 1px solid #aab1b8;
  border-radius: 6px;
  padding: 7px 9px;
  background: #fff;
  color: #111;
  font: inherit;
}

.report-filter button,
.report-filter .action-link {
  min-height: 36px;
}

.report-filter .action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  border: 1px solid #9aa2a9;
  border-radius: 6px;
  padding: 7px 12px;
  background: #f8fafb;
  color: #222a31;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.report-filter .action-link:hover {
  border-color: #111;
  background: #fff;
}

.report-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid #aab1b8;
  border-radius: 6px;
  padding: 7px 10px;
  background: #fff;
  color: #222a31;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.report-tabs a.active,
.report-tabs a:hover {
  border-color: #111;
  background: #111;
  color: #fff;
}

.report-option-list {
  display: grid;
  gap: 10px;
}

.report-option-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e0e4e8;
  border-radius: 6px;
  padding: 12px;
  background: #f8fafb;
  color: inherit;
  text-decoration: none;
}

.report-option-list span {
  color: #222a31;
  font-size: 13px;
  font-weight: 800;
}

.report-option-list strong {
  color: #59616a;
  font-size: 13px;
}

.master-table.report-orders .master-row {
  grid-template-columns: 0.65fr 1fr 0.85fr 0.55fr 1fr 0.65fr 0.65fr 0.7fr 0.7fr;
  min-width: 1120px;
}

.master-table.report-items .master-row {
  grid-template-columns: 1.5fr 0.5fr 0.7fr;
}

.master-table.report-room-sales .master-row,
.master-table.report-hotel-sales .master-row {
  grid-template-columns: 1.2fr 0.6fr 0.8fr 0.8fr;
}

.master-table.report-balances .master-row {
  grid-template-columns: 0.65fr 0.9fr 0.6fr 1fr 0.7fr 0.7fr 0.75fr;
  min-width: 860px;
}

.master-table.report-daily .master-row {
  grid-template-columns: 0.9fr 0.55fr 0.75fr 0.75fr 0.75fr 0.75fr;
  min-width: 760px;
}

.top-items {
  display: grid;
  gap: 10px;
}

.top-items div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
}

.top-items span {
  color: #222a31;
  overflow-wrap: anywhere;
  text-transform: none;
}

.top-items strong {
  color: #111;
  font-size: 13px;
}

.top-items em {
  grid-column: 1 / -1;
  color: #59616a;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.empty-state {
  padding: 18px;
  color: #59616a;
  font-size: 14px;
  font-weight: 700;
}

.form-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions form {
  margin: 0;
}

.form-actions {
  margin-top: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.form-actions button,
.form-actions .action-link,
.module-actions .module-button,
.row-actions button,
.row-actions .action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 72px;
  border: 1px solid #111;
  border-radius: 6px;
  padding: 6px 10px;
  background: #fff;
  color: #111;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.row-actions .icon-button {
  min-width: 34px;
  width: 34px;
  min-height: 34px;
  height: 34px;
  border-color: #9aa2a9;
  padding: 0;
  background: #fff;
  color: #222a31;
}

.row-actions .icon-button svg {
  width: 16px;
  height: 16px;
}

.row-actions .icon-button:hover {
  border-color: #111;
  background: #f8fafb;
}

.item-count-cell .item-toggle.active {
  border-color: #111;
  background: #111;
  color: #fff;
}

.row-actions .icon-button.success {
  border-color: #166534;
  background: #e9f7ef;
  color: #166534;
}

.row-actions .icon-button.success:hover {
  background: #d7f0df;
}

.row-actions .icon-button.danger {
  border-color: #b91c1c;
  background: #fff1f1;
  color: #b91c1c;
}

.row-actions .icon-button.danger:hover {
  background: #ffe3e3;
}

.form-actions button:first-child {
  background: #111;
  color: #fff;
}

.module-actions .module-button {
  background: #111;
  color: #fff;
}

.ghost-button,
.row-actions button:nth-child(2) {
  border-color: #9aa2a9;
  background: #fff;
  color: #333;
}

.flash-message {
  margin: 0 0 16px;
  border: 1px solid #b8d7c0;
  border-radius: 8px;
  padding: 10px 12px;
  background: #edf8f0;
  color: #165f2c;
  font-size: 14px;
  font-weight: 700;
}

.flash-message.is-hidden {
  display: none;
}

.summary-card {
  padding: 16px;
}

.summary-card span,
.summary-card strong {
  display: block;
}

.summary-card span {
  color: #4f565c;
  font-size: 13px;
  font-weight: 700;
}

.summary-card strong {
  margin-top: 8px;
  font-size: 26px;
  line-height: 1.1;
}

.total-row {
  background: #f7f8f9;
  font-weight: 800;
}

.status {
  width: max-content;
  min-width: 78px;
  border-radius: 999px;
  padding: 5px 9px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.status.done {
  background: #e9f7ef;
  color: #166534;
}

.status.live {
  background: #fff4d8;
  color: #7a4b00;
}

.status.wait {
  background: #eaf0ff;
  color: #23428f;
}

.toolbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.toolbar p {
  margin: 6px 0 0;
  color: #4b4b4b;
  font-size: 14px;
}

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

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 38px;
  border: 1px solid #111;
  border-radius: 6px;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.print-button {
  background: #111;
  color: #fff;
}

.sidebar-logout {
  border-color: rgb(255 255 255 / 22%);
  background: transparent;
  color: #fff;
  min-height: 34px;
  font-size: 13px;
}

.receipt {
  display: none;
  width: 80mm;
  min-height: 210mm;
  margin: 0 auto;
  padding: 8mm 5mm;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 14px 36px rgb(0 0 0 / 18%);
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.receipt.active {
  display: block;
}

.receipt-header {
  text-align: center;
}

.receipt-header h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 1px;
}

.receipt-header p,
.receipt-footer p {
  margin: 2px 0;
}

.rule {
  border-top: 1px dashed #222;
  margin: 10px 0;
}

.bill-meta,
.guest-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}

.bill-meta span,
.guest-block span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.bill-meta strong,
.guest-block strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.guest-block div:first-child,
.guest-block.parcel div:first-child {
  grid-column: 1 / -1;
}

.guest-block div:first-child strong {
  font-size: 24px;
  font-weight: 900;
}

.items {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.items th,
.items td {
  padding: 3px 0;
  vertical-align: top;
}

.items th {
  border-bottom: 1px dashed #222;
  text-align: right;
  font-size: 12px;
  font-weight: 800;
}

.items td {
  font-weight: 700;
}

.items th:first-child,
.items td:first-child {
  width: 46%;
  text-align: left;
}

.items th:nth-child(2),
.items td:nth-child(2) {
  width: 13%;
  text-align: center;
}

.items th:nth-child(3),
.items td:nth-child(3),
.items th:nth-child(4),
.items td:nth-child(4) {
  width: 20%;
  text-align: right;
}

.items td:first-child {
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.totals {
  display: grid;
  gap: 3px;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.totals .grand {
  align-items: baseline;
  margin: 4px 0;
  padding: 6px 0;
  border-top: 1px dashed #222;
  border-bottom: 1px dashed #222;
  font-size: 16px;
  font-weight: 800;
}

.totals .grand strong {
  font-size: 24px;
}

.receipt-footer {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .sidebar-logout {
    width: 100%;
    margin-top: 12px;
  }

  .sidebar-nav {
    flex: none;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    margin-top: 14px;
  }

  .nav-button {
    justify-content: center;
    min-width: 0;
    padding-inline: 8px;
    text-align: center;
  }

  .workspace {
    padding: 18px 10px 28px;
  }

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

  .topbar-meta {
    justify-content: flex-start;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .controls {
    justify-content: stretch;
  }

  button {
    flex: 1;
    min-width: 0;
  }

  .master-header {
    align-items: stretch;
    flex-direction: column;
  }

  .module-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .master-table {
    overflow-x: auto;
  }

  .data-table-controls,
  .data-table-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .data-table-controls label,
  .data-table-controls input,
  .data-table-controls select,
  .data-table-pages {
    width: 100%;
  }

  .data-table-pages button {
    flex: 1;
  }

  .master-row {
    min-width: 560px;
  }

  .billing-layout,
  .form-grid,
  .payment-grid,
  .summary-grid,
  .dashboard-summary,
  .dashboard-grid,
  .dashboard-grid.wide,
  .status-metrics,
  .master-health {
    grid-template-columns: 1fr;
  }

  .form-grid.compact {
    grid-template-columns: 1fr;
  }

  .dashboard-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .order-item-row {
    grid-template-columns: 1fr;
  }

  .order-item-head {
    display: none;
  }
}

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

  body {
    background: #fff;
  }

  .app-shell {
    width: auto;
    margin: 0;
    padding: 0;
  }

  .toolbar {
    display: none;
  }

  .flash-message,
  .topbar,
  .dashboard-summary,
  .sidebar,
  .panel:not([data-panel-view="dashboard"]) {
    display: none !important;
  }

  .workspace {
    padding: 0;
  }

  .login-screen {
    display: none !important;
  }

  body.is-authenticated .app-shell {
    display: block;
  }

  .receipt {
    width: 80mm;
    min-height: auto;
    margin: 0;
    padding: 5mm;
    box-shadow: none;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    break-after: auto;
    page-break-after: auto;
  }

  .receipt * {
    color: #000 !important;
    font-weight: 700;
  }

  .receipt-header h2 {
    font-size: 22px;
    font-weight: 800;
  }

  .bill-meta strong,
  .guest-block strong,
  .items th,
  .totals .grand,
  .totals .grand strong {
    font-weight: 900;
  }

  .items th,
  .items td {
    font-size: 12px;
  }

  .totals .grand strong {
    font-size: 24px;
  }

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

  body.is-order-print .panel[data-panel-view="billing"] {
    display: block !important;
  }

  body.is-order-print .panel[data-panel-view="billing"] > :not(.print-preview-panel),
  body.is-order-print .print-preview-panel .module-actions {
    display: none !important;
  }

  body.is-order-print .order-print-receipt {
    display: block !important;
  }
}
