/* ==========================================================================
   Design Tokens — Piangdao Classic & Resort Receipt Builder
   Mode: Operate (Hospitality Back-Office Precision)
   ========================================================================== */
:root {
  --navy-900: #162B47;
  --navy-800: #1E3A5F;
  --navy-700: #274B7A;
  --navy-100: #EBF1F7;
  --navy-50: #F4F7FA;

  --surface-canvas: #E9EEF4;
  --surface-panel: #FFFFFF;
  --surface-subtle: #F7F9FC;
  --surface-input: #FFFFFF;

  --ink-primary: #152232;
  --ink-secondary: #475569;
  --ink-muted: #64748B;
  --ink-placeholder: #94A3B8;

  --border-subtle: #E2E8F0;
  --border-strong: #CBD5E1;
  --border-focus: #1E3A5F;

  --danger: #B91C1C;
  --danger-bg: #FEF2F2;
  --success: #15803D;
  --accent-warm: #B47B2B;
  --accent-warm-soft: #FEF7EC;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;

  --shadow-card: 0 1px 3px rgba(21, 34, 50, 0.05), 0 1px 2px rgba(21, 34, 50, 0.04);
  --shadow-popover: 0 12px 28px rgba(21, 34, 50, 0.16), 0 2px 6px rgba(21, 34, 50, 0.08);
  --shadow-paper: 0 12px 32px rgba(21, 34, 50, 0.12), 0 2px 6px rgba(21, 34, 50, 0.06);
  --shadow-toast: 0 10px 24px rgba(21, 34, 50, 0.18);

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 120ms;
  --dur-med: 180ms;

  --font-ui: "Noto Sans Thai", "Sarabun", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-doc: "Sarabun", "Noto Sans Thai", sans-serif;
}

/* Base Reset & Browser Surface Theming */
*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-ui);
  color: var(--ink-primary);
  background: var(--surface-canvas);
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 14px;
  z-index: 200;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-popover);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus {
  top: 12px;
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}

button,
input,
select,
textarea,
summary {
  touch-action: manipulation;
}

::selection {
  background: rgba(30, 58, 95, 0.18);
  color: var(--navy-900);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
  border: 2px solid transparent;
  background-clip: content-box;
}

/* ==========================================================================
   Top Action Bar
   ========================================================================== */
.topbar {
  height: 60px;
  background: var(--surface-panel);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--navy-800);
  border-bottom: 2px solid var(--accent-warm);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink-primary);
  letter-spacing: -0.01em;
}

.brand-text p {
  margin: 1px 0 0;
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
  margin: 0 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 100ms ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(0.5px);
}

.btn:focus-visible {
  outline: 2px solid var(--navy-800);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 99px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  flex-shrink: 0;
  animation: btn-spin 0.65s linear infinite;
}

.btn-primary {
  background: var(--navy-800);
  color: #FFFFFF;
}
.btn-primary:hover:not(:disabled) {
  background: var(--navy-900);
}

.btn-secondary {
  background: var(--surface-panel);
  color: var(--ink-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-subtle);
  border-color: #94A3B8;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--navy-50);
  color: var(--navy-800);
}

/* History Dropdown */
.history-dropdown {
  position: relative;
}

.history-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--navy-800);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.history-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 310px;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  z-index: 60;
  overflow: hidden;
  animation: popover-in var(--dur-fast) var(--ease-out);
}

@keyframes popover-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.history-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-900);
}

.btn-history-clear {
  border: 1px solid #FECACA;
  background: var(--danger-bg);
  color: var(--danger);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn-history-clear:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
}

.history-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.history-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border-subtle);
  background: #FFFFFF;
}
.history-row:last-child {
  border-bottom: none;
}

.history-item {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 9px 10px 9px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--font-ui);
  transition: background-color 120ms ease;
}
.history-item:hover {
  background: var(--navy-50);
}

.btn-history-delete {
  width: 34px;
  flex-shrink: 0;
  border: none;
  border-left: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 120ms ease, color 120ms ease;
}
.btn-history-delete:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-item-doc {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy-900);
}

.history-item-total {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy-800);
}

.history-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-muted);
}

.history-item-cust {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-time {
  flex-shrink: 0;
}

.history-empty {
  padding: 18px 14px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Main Split Workspace
   ========================================================================== */
.workspace {
  display: grid;
  grid-template-columns: 440px minmax(0, 1fr);
  height: calc(100vh - 60px);
  height: calc(100dvh - 60px);
  overflow: hidden;
}

/* Left Editor Panel */
.editor-panel {
  background: #F4F7FB;
  border-right: 1px solid var(--border-subtle);
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.editor-scroll {
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-section {
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-section:last-child {
  margin-bottom: 4px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-900);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.section-icon {
  color: var(--navy-700);
  flex-shrink: 0;
}

.save-indicator {
  font-size: 11px;
  color: var(--success);
  font-weight: 600;
  background: #ECFDF5;
  padding: 2px 8px;
  border-radius: 99px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="number"],
.field textarea {
  width: 100%;
  padding: 8px 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-primary);
  background: var(--surface-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 140ms ease, box-shadow 140ms ease;
  caret-color: var(--navy-800);
}

.field textarea {
  resize: vertical;
  line-height: 1.45;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-placeholder);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.input-right {
  text-align: right;
}

.input-with-action {
  display: flex;
  gap: 6px;
}

.input-with-action input {
  flex: 1;
  min-width: 0;
}

.input-doc-actions {
  gap: 4px;
}

#docNumber[readonly] {
  background: var(--navy-50);
  border-style: dashed;
  border-color: #B8C8DC;
  color: var(--navy-900);
  font-weight: 700;
  cursor: default;
  padding: 8px 7px;
  font-size: 12.5px;
}

.label-auto-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 99px;
  border: 1px solid #D6E1EE;
  background: var(--navy-50);
  color: var(--navy-800);
  font-size: 10.5px;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 4px;
}

.label-auto-badge.is-editing {
  background: #FEF3C7;
  border-color: #FCD34D;
  color: #92400E;
}

.btn-inline {
  padding: 0 10px;
  height: 35px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--navy-800);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.btn-inline-sm {
  padding: 0 7px;
  font-size: 11.5px;
}
.btn-inline:hover {
  background: var(--navy-100);
  border-color: var(--navy-700);
}

.btn-danger-text {
  color: var(--danger);
  border-color: #FECACA;
  background: var(--danger-bg);
}
.btn-danger-text:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--navy-50);
  color: var(--navy-800);
  border: 1px solid #D6E1EE;
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease;
}
.btn-link:hover {
  background: var(--navy-100);
}

/* Quick Room Presets */
.preset-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
}

.preset-chip {
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 99px;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--ink-primary);
  cursor: pointer;
  transition: all 140ms ease;
}
.preset-chip:hover {
  border-color: var(--navy-800);
  background: var(--navy-100);
  color: var(--navy-900);
}

/* Editable Default Room & Extra Bed Rates */
.rate-editor {
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
}

.rate-editor-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy-800);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.rate-editor-summary::-webkit-details-marker {
  display: none;
}

.rate-editor-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rate-editor[open] .chevron {
  transform: rotate(180deg);
}

.rate-editor-body {
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px dashed var(--border-strong);
}

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

.rate-editor-grid > div {
  min-width: 0;
}

.rate-editor-grid input {
  width: 100%;
  padding: 6px 8px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-primary);
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.rate-editor-grid input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.rate-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.rate-editor-hint {
  font-size: 11px;
  color: var(--ink-muted);
}

.rate-editor-footer .btn-inline {
  height: 28px;
  font-size: 11.5px;
  padding: 0 9px;
}

/* Room Item Rows in Editor */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-row-editor {
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.item-row-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--navy-800);
}

.item-row-subtotal {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-primary);
  margin-left: auto;
}

.btn-remove-row {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 140ms ease, color 140ms ease;
}
.btn-remove-row:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.item-row-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.item-row-nums {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr 0.8fr;
  gap: 8px;
}

.item-row-dates > div,
.item-row-nums > div {
  min-width: 0;
}

.item-row-editor input,
.item-row-editor select {
  width: 100%;
  padding: 7px 9px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: var(--ink-primary);
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.item-row-editor select {
  cursor: pointer;
}

.item-custom-name {
  margin-top: 6px;
}

.item-row-editor input:focus,
.item-row-editor select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

/* Custom dd/mm/yyyy Date Picker Overlay */
.date-picker-field {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  padding: 7px 9px;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.date-picker-field:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.date-picker-display {
  font-size: 12.5px;
  color: var(--ink-primary);
  line-height: 1.35;
  white-space: nowrap;
}

.date-picker-display.is-empty {
  color: var(--ink-placeholder);
}

.date-picker-icon {
  color: var(--ink-muted);
  flex-shrink: 0;
}

.date-picker-field-inline {
  flex: 1;
  min-width: 0;
  min-height: 35px;
}

.date-picker-field .date-picker-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
}

.date-picker-field .date-picker-native:focus {
  box-shadow: none;
}

.date-picker-field .date-picker-native::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}

.item-mini-label {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 3px;
}

/* Per-Room Extra Bed Add-on Stepper */
.item-addon-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  border: 1px dashed var(--border-strong);
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.item-addon-bar.is-active {
  background: var(--accent-warm-soft);
  border-style: solid;
  border-color: #EBD9B5;
}

.item-addon-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.item-addon-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.item-addon-bar.is-active .item-addon-label {
  color: var(--navy-900);
}

.item-addon-cost {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-warm);
}

.addon-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-stepper {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--navy-800);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.btn-stepper:hover:not(:disabled) {
  background: var(--navy-100);
  border-color: var(--navy-700);
}
.btn-stepper:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.addon-count {
  min-width: 18px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-primary);
}

/* Summary Box inside Editor */
.payment-summary-box {
  background: var(--navy-50);
  border: 1px solid #D6E1EE;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-secondary);
}

.summary-input-row label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-primary);
}

.summary-input-row input {
  width: 118px;
  padding: 6px 9px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
}

.summary-deposit-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-auto-deposit {
  padding: 4px 8px;
  border-radius: 99px;
  border: 1px solid var(--border-strong);
  background: #FFFFFF;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms ease;
}
.btn-auto-deposit:hover {
  border-color: var(--navy-700);
  color: var(--navy-800);
}
.btn-auto-deposit.is-active {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #FFFFFF;
}

.summary-input-row input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.summary-balance {
  padding-top: 8px;
  border-top: 1px dashed #B8C8DC;
  font-size: 14px;
  color: var(--navy-900);
}

/* Checkbox Pills */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-panel);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-primary);
  cursor: pointer;
  user-select: none;
  transition: all 140ms ease;
}

.checkbox-pill:has(input:checked) {
  border-color: var(--navy-800);
  background: var(--navy-100);
  color: var(--navy-900);
  font-weight: 600;
}

.checkbox-pill input {
  accent-color: var(--navy-800);
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
}

/* Collapsible Resort Settings */
.collapsible-section {
  padding: 14px 16px;
}

.section-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy-900);
  cursor: pointer;
  padding: 2px 0;
  border-radius: var(--radius-sm);
}

.section-summary-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.section-summary::-webkit-details-marker {
  display: none;
}

.collapsible-section[open] .chevron {
  transform: rotate(180deg);
}

.chevron {
  transition: transform 180ms ease;
}

.collapsible-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
}

/* ==========================================================================
   Right Live Preview Panel
   ========================================================================== */
.preview-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--surface-canvas);
}

.preview-toolbar {
  height: 44px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #F4F7FA;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.preview-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.badge-paper {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--navy-800);
  background: var(--navy-100);
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}

.preview-hint {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.zoom-btn {
  height: 30px;
  min-width: 30px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: #FFFFFF;
  color: var(--ink-primary);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

/* Unified Focus-Visible Ring (ui-ux-pro-max Accessibility) */
.btn-inline:focus-visible,
.btn-link:focus-visible,
.preset-chip:focus-visible,
.zoom-btn:focus-visible,
.btn-remove-row:focus-visible,
.btn-auto-deposit:focus-visible,
.btn-history-delete:focus-visible,
.btn-history-clear:focus-visible,
.btn-stepper:focus-visible,
.section-summary:focus-visible,
.rate-editor-summary:focus-visible,
.history-item:focus-visible,
.checkbox-pill:has(input:focus-visible) {
  outline: 2px solid var(--navy-800);
  outline-offset: 2px;
}
.zoom-btn:hover {
  background: var(--navy-50);
  border-color: var(--navy-700);
}

.zoom-label {
  min-width: 44px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.preview-stage {
  flex: 1;
  overflow: auto;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.paper-scale-wrapper {
  transform-origin: top center;
  transition: transform 120ms ease-out;
}

/* ==========================================================================
   EXACT A4 LANDSCAPE RECEIPT SHEET (Matches Reference PDF 1:1)
   Dimensions: 1123px × 794px (A4 Landscape 297mm × 210mm @ 96 DPI)
   ========================================================================== */
.receipt-sheet {
  width: 1123px;
  min-height: 794px;
  background: #FFFFFF;
  padding: 0 48px 18px;
  box-shadow: var(--shadow-paper);
  font-family: var(--font-doc);
  color: #1A202C;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Top Dual Accent Bar (Navy + Antique Gold) */
.rc-top-accent {
  height: 8px;
  margin: 0 -48px 10px;
  background: #162B47;
  border-bottom: 2.5px solid #B48A3E;
  flex-shrink: 0;
}

/* Formal Two-Column Resort Letterhead */
.rc-letterhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 9px;
}

.rc-brand-col {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 0;
}

.rc-brand-emblem {
  width: 86px;
  height: 86px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
}

.rc-brand-art {
  width: 116%;
  height: 116%;
  max-width: none;
  object-fit: contain;
  display: block;
  opacity: 0.94;
  user-select: none;
}

.rc-brand-content {
  min-width: 0;
  padding-left: 14px;
  border-left: 1.5px solid #D9C398;
  line-height: 1.48;
}

.rc-resort-name {
  font-size: 19px;
  font-weight: 700;
  color: #162B47;
  letter-spacing: 0.01em;
  margin-bottom: 2px;
}

.rc-resort-address {
  font-size: 12.5px;
  color: #1F2937;
}

.rc-resort-contact {
  font-size: 12px;
  color: #334155;
}

.rc-doc-meta-col {
  flex: 0 0 auto;
  max-width: 470px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.rc-doc-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #162B47;
  text-align: right;
  padding-bottom: 4px;
  border-bottom: 2px solid #B48A3E;
  letter-spacing: 0.01em;
}

.rc-doc-meta-box {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-right: 3.5px solid #162B47;
  border-radius: 5px;
  padding: 5px 12px;
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 14px;
  font-size: 12.5px;
  align-items: baseline;
}

.rc-meta-label {
  font-weight: 700;
  color: #475569;
  text-align: right;
}

.rc-meta-value {
  font-weight: 700;
  color: #162B47;
  text-align: right;
}

.rc-divider {
  height: 1px;
  background: #DCE4EE;
  margin-bottom: 8px;
}

/* Framed Customer Info Box */
.rc-customer-box {
  background: #F8FAFC;
  border: 1px solid #DCE4EE;
  border-left: 3.5px solid #162B47;
  border-radius: 5px;
  padding: 6px 14px 7px;
  margin-bottom: 8px;
}

.rc-customer-box-title {
  font-size: 11px;
  font-weight: 700;
  color: #162B47;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

/* Info Grid */
.rc-info-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 24px;
  margin-bottom: 0;
  font-size: 13px;
}

.rc-info-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rc-info-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: baseline;
  gap: 8px;
}

.rc-info-col-right .rc-info-row {
  grid-template-columns: 145px 1fr;
}

.rc-label {
  font-weight: 700;
  color: #1F2937;
}

.rc-value {
  color: #374151;
  word-break: break-word;
}

.rc-value.is-placeholder {
  color: #6B7280;
}

/* Section Title */
.rc-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #1E3A5F;
  margin-bottom: 5px;
}

/* Booking Table */
.rc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 8px;
}

.rc-table th,
.rc-table td {
  border: 1px solid #DCE4EE;
  padding: 4px 9px;
  vertical-align: middle;
}

.rc-table thead th {
  background: #162B47;
  color: #FFFFFF;
  border-color: #162B47;
  border-bottom: 2px solid #B48A3E;
  font-weight: 600;
  text-align: center;
  padding: 6px 9px;
}

.rc-table tbody tr {
  height: 24px;
}

.rc-table tbody tr:nth-child(even) {
  background: #FAFBFD;
}

.rc-table .col-no {
  width: 56px;
  text-align: center;
}

.rc-table .col-desc {
  text-align: left;
}

.rc-item-addon {
  font-size: 11.5px;
  color: #475569;
  font-weight: 500;
  margin-left: 5px;
}

.rc-table .col-dates {
  width: 195px;
  text-align: center;
  white-space: nowrap;
}

.rc-table .col-price {
  width: 125px;
  text-align: right;
}

.rc-table .col-qty {
  width: 82px;
  text-align: center;
}

.rc-table .col-nights {
  width: 82px;
  text-align: center;
}

.rc-table .col-total {
  width: 130px;
  text-align: right;
}

.rc-table tbody td.col-no {
  text-align: center;
  color: #374151;
}
.rc-table tbody td.col-dates,
.rc-table tbody td.col-qty,
.rc-table tbody td.col-nights {
  text-align: center;
}
.rc-table tbody td.col-price,
.rc-table tbody td.col-total {
  text-align: right;
}

/* Table Footer Totals */
.rc-sum-row td {
  padding: 5px 10px;
}

.rc-sum-spacer {
  border: none !important;
  background: transparent !important;
}

.rc-sum-label {
  text-align: right;
  font-weight: 700;
  color: #1F2937;
}

.rc-sum-value {
  text-align: right;
  font-weight: 700;
  color: #111827;
}

.rc-sum-highlight .rc-sum-label,
.rc-sum-highlight .rc-sum-value {
  background: #F1F5F9;
}

.rc-sum-final .rc-sum-label,
.rc-sum-final .rc-sum-value {
  background: #EBF1F7;
  color: #162B47;
  font-size: 13.5px;
  border-top: 1.5px solid #162B47;
  border-bottom: 3px double #162B47;
}

/* Bottom Area: Payment Info & Signatures */
.rc-bottom-grid {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rc-bottom-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* Payment Section */
.rc-payment-section {
  font-size: 13px;
  margin-bottom: 0;
}

.rc-payment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 6px;
}

.rc-payment-methods {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.rc-pay-label {
  font-weight: 700;
  color: #1F2937;
  min-width: auto;
  display: inline-block;
}

.rc-payment-date {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.rc-check-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1F2937;
}

.rc-checkbox {
  width: 14px;
  height: 14px;
  border: 1.4px solid #334155;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  flex-shrink: 0;
}

.rc-check-item.is-checked .rc-checkbox {
  background: #1E3A5F;
  border-color: #1E3A5F;
}

.rc-check-item.is-checked .rc-checkbox::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid #FFFFFF;
  border-bottom: 2px solid #FFFFFF;
  transform: rotate(-45deg) translateY(-1px);
}

.rc-remark-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: #FEFBF5;
  border: 1px solid #EBD9B5;
  border-left: 3px solid #B48A3E;
  border-radius: 4px;
  padding: 5px 10px;
  margin-top: 6px;
  font-size: 12.5px;
}

.rc-remark-text {
  color: #374151;
}

/* Footer Signatures */
.rc-footer {
  margin-top: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding-top: 4px;
}

.rc-signatures {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13px;
  padding-bottom: 2px;
}

.rc-sig-caption {
  font-size: 10.5px;
  color: #64748B;
  text-align: center;
  padding-left: 136px;
  margin-top: -5px;
}

.rc-sig-line {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.rc-sig-label {
  width: 128px;
  color: #374151;
}

.rc-sig-dots {
  width: 220px;
  border-bottom: 1px dotted #475569;
  min-height: 20px;
  text-align: center;
  padding-bottom: 2px;
}

.rc-sig-typed {
  font-size: 13.5px;
  color: #111827;
  font-weight: 500;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--navy-900);
  color: #FFFFFF;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-toast);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 100;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Export Confirmation Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 120;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-dialog {
  width: 100%;
  max-width: 420px;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.22);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 11px;
}

.modal-icon {
  width: 36px;
  height: 36px;
  border-radius: 99px;
  background: var(--navy-100);
  color: var(--navy-800);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.3;
}

.modal-desc {
  margin: 12px 0 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-secondary);
}

.modal-doc-highlight {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--navy-50);
  border: 1px solid #D6E1EE;
  color: var(--navy-900);
  font-weight: 700;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

/* ==========================================================================
   PIN Lock Screen
   ========================================================================== */
body.is-locked .skip-link,
body.is-locked .topbar,
body.is-locked .workspace,
body.is-locked .toast,
body.is-locked .modal-backdrop {
  display: none !important;
}

.auth-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--surface-canvas);
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  width: 100%;
  max-width: 396px;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 44px rgba(21, 34, 50, 0.14);
  overflow: hidden;
}

.auth-accent {
  height: 7px;
  background: var(--navy-900);
  border-bottom: 2.5px solid #B48A3E;
}

.auth-body {
  padding: 26px 26px 24px;
}

.auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--navy-100);
  color: var(--navy-800);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--navy-900);
}

.auth-subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.pin-slots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  cursor: text;
}

.pin-slot {
  height: 46px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.pin-slot.is-filled {
  background: #FFFFFF;
  border-color: var(--navy-700);
}

.pin-slot.is-active {
  border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.14);
}

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.pin-slots.is-shake {
  animation: auth-shake 320ms ease-in-out;
}

.pin-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pin-input-wrap input {
  width: 100%;
  padding: 9px 40px 9px 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-align: center;
  color: var(--ink-primary);
  background: var(--surface-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  caret-color: var(--navy-800);
  font-variant-numeric: tabular-nums;
}

.pin-input-wrap input::placeholder {
  letter-spacing: normal;
  font-weight: 400;
  color: var(--ink-placeholder);
}

.pin-input-wrap input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.btn-pin-toggle {
  position: absolute;
  right: 6px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-pin-toggle:hover {
  background: var(--navy-50);
  color: var(--navy-800);
}

.btn-pin-toggle:focus-visible,
.auth-remember:has(input:focus-visible) {
  outline: 2px solid var(--navy-800);
  outline-offset: 2px;
}

.btn-pin-toggle .icon-eye-off {
  display: none;
}

.btn-pin-toggle.is-visible .icon-eye {
  display: none;
}

.btn-pin-toggle.is-visible .icon-eye-off {
  display: block;
}

.auth-error {
  margin: 10px 0 0;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  border: 1px solid #FECACA;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}

.auth-remember {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-secondary);
  cursor: pointer;
  user-select: none;
  border-radius: 4px;
}

.auth-remember input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--navy-800);
  cursor: pointer;
}

.auth-submit {
  width: 100%;
  height: 40px;
  margin-top: 14px;
  font-size: 14px;
}

.btn-auth-link {
  width: 100%;
  margin-top: 10px;
  background: none;
  border: none;
  color: var(--navy-700);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background-color 140ms ease, color 140ms ease;
}

.btn-auth-link:hover {
  background: var(--navy-50);
  color: var(--navy-900);
}

.btn-auth-link:focus-visible {
  outline: 2px solid var(--navy-800);
  outline-offset: 2px;
}

.auth-success {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: var(--success);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}

.auth-reset-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-reset-form[hidden] {
  display: none;
}

.auth-reset-note {
  margin: 0 0 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy-800);
  text-align: center;
}

.auth-reset-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-reset-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.auth-reset-field input {
  width: 100%;
  padding: 8px 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-primary);
  background: var(--surface-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  caret-color: var(--navy-800);
}

.auth-reset-field input::placeholder {
  color: var(--ink-placeholder);
}

.auth-reset-field input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.auth-reset-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.btn-lock:hover:not(:disabled) {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1080px) {
  body {
    overflow-x: clip;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .editor-panel {
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .preview-panel {
    height: auto;
    min-height: 620px;
  }

  .topbar {
    height: auto;
    padding: 10px 14px;
    flex-wrap: wrap;
  }

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

@media (max-width: 768px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .field input[type="text"],
  .field input[type="tel"],
  .field input[type="number"],
  .field textarea,
  .item-row-editor input,
  .item-row-editor select,
  .rate-editor-grid input {
    font-size: 16px;
    min-height: 44px;
  }

  .date-picker-field {
    min-height: 44px;
  }

  .date-picker-display {
    font-size: 15px;
  }

  .btn,
  .btn-inline,
  .preset-chip,
  .checkbox-pill {
    min-height: 40px;
  }

  .history-dropdown {
    position: static;
  }

  .history-menu {
    top: calc(100% - 2px);
    left: 12px;
    right: 12px;
    width: auto;
  }

  .preview-toolbar {
    height: auto;
    padding: 8px 12px;
    flex-wrap: wrap;
  }

  .preview-stage {
    padding: 12px;
  }
}

@media (max-width: 640px) {
  .rate-editor-grid {
    grid-template-columns: 1fr;
  }

  .rate-editor-footer {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Print / Native Save-as-PDF Mode (A4 Landscape Exact Fit)
   ========================================================================== */
@page {
  size: A4 landscape;
  margin: 0;
}

@media print {
  html, body {
    background: #FFFFFF !important;
    height: auto !important;
    overflow: visible !important;
  }

  .no-print {
    display: none !important;
  }

  body.is-locked .receipt-sheet,
  body.is-locked .workspace {
    display: none !important;
  }

  .workspace,
  .preview-panel,
  .preview-stage,
  .paper-scale-wrapper {
    display: block !important;
    height: auto !important;
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    transform: none !important;
    background: #FFFFFF !important;
  }

  .receipt-sheet {
    width: 297mm !important;
    min-height: 210mm !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 13mm 7mm !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .rc-top-accent {
    margin: 0 -13mm 14px !important;
  }
}
