:root {
  --green: #4CAF50;
  --red: #F44336;
  --blue: #2196F3;
  --orange: #FF9800;
  --bg: #F5F5F5;
  --card: #FFFFFF;
  --text: #212121;
  --text-light: #757575;
  --border: #E0E0E0;
  --radius: 16px;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --header-height: 56px;
  --footer-height: 64px;
  --font-lg: 20px;
  --font-md: 18px;
  --font-sm: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--font-md);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

input, textarea, select {
  -webkit-user-select: text;
  user-select: text;
}

/* ===== SVG ICONS ===== */
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.menu-btn .icon { width: 26px; height: 26px; }
.footer .nav-btn .icon { width: 26px; height: 26px; }
.slide-menu .menu-item .icon { width: 22px; height: 22px; }
.search-box .icon { width: 18px; height: 18px; }
.empty-state .icon { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.3; }
.btn .icon { width: 18px; height: 18px; }
.btn-sm .icon { width: 16px; height: 16px; }

/* ===== STATUS DOTS (no emoji) ===== */
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot.green { background: var(--green); }
.dot.red { background: var(--red); }
.dot.orange { background: var(--orange); }
.dot.gray { background: #bdbdbd; }

#app {
  max-width: 480px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* ===== HEADER ===== */
.header {
  height: var(--header-height);
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 12px;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header .menu-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
}

.header .menu-btn:active {
  background: rgba(255,255,255,0.2);
}

.header .logo {
  flex: 1;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
}

/* ===== CONTENT AREA ===== */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

/* ===== FOOTER ===== */
.footer {
  height: var(--footer-height);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-shrink: 0;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
  z-index: 100;
  padding: 0 8px;
  position: relative;
}

.footer .nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 56px;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 12px;
  border-radius: 12px;
  gap: 2px;
}

.footer .nav-btn.active {
  color: var(--blue);
}

.footer .nav-btn .icon {
  font-size: 24px;
}

.footer .add-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  border: none;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: -28px;
  box-shadow: 0 4px 12px rgba(255,152,0,0.4);
  z-index: 10;
  transition: transform 0.15s;
}

.footer .add-btn:active {
  transform: scale(0.92);
}

/* ===== SLIDE MENU ===== */
.slide-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  background: #fff;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  box-shadow: 2px 0 12px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
}

.slide-menu.open {
  transform: translateX(0);
}

.slide-menu .menu-header {
  height: 56px;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  flex-shrink: 0;
}

.slide-menu .menu-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.slide-menu .menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  font-size: var(--font-md);
  color: var(--text);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-radius: 0;
}

.slide-menu .menu-item:active {
  background: #f0f0f0;
}

.slide-menu .menu-item .menu-icon {
  font-size: 22px;
  width: 28px;
  text-align: center;
}

.slide-menu .menu-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 16px;
}

/* ===== OVERLAY ===== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 150;
  display: none;
}

.overlay.show {
  display: block;
}

/* ===== LOGIN ===== */
.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 32px 24px;
  background: var(--bg);
}

.login-screen .login-logo {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--blue);
  margin-bottom: 6px;
}

.login-screen .login-subtitle {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 48px;
}

.login-screen .login-message {
  font-size: 22px;
  color: var(--text);
  margin-bottom: 32px;
  font-weight: 600;
}

/* Shared PIN UI (used by login screen and PIN modals) */
.pin-box {
  background: #fff;
  border-radius: 20px;
  padding: 28px 36px;
  box-shadow: var(--shadow);
  margin-bottom: 44px;
}

.pin-box.shake {
  animation: shakeBox 0.45s ease;
}

@keyframes shakeBox {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-12px); }
  30% { transform: translateX(12px); }
  45% { transform: translateX(-10px); }
  60% { transform: translateX(10px); }
  75% { transform: translateX(-6px); }
  90% { transform: translateX(6px); }
}

.pin-dots {
  display: flex;
  gap: 24px;
}

.pin-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid var(--blue);
  background: transparent;
  transition: background 0.1s, transform 0.1s;
}

.pin-dot.filled {
  background: var(--blue);
  animation: dotPop 0.25s ease;
}

.pin-dot.error {
  border-color: var(--red);
  background: var(--red);
}

@keyframes dotPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.5); }
  70%  { transform: scale(0.85); }
  100% { transform: scale(1); }
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 80px);
  gap: 14px;
  justify-content: center;
}

.key {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border);
  font-size: 30px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0,0,0,0.10);
  transition: transform 0.08s, background 0.08s;
}

.key:active {
  background: #e0e0e0;
  transform: scale(0.93);
}

.key.clear {
  font-size: 15px;
  font-weight: 700;
  color: var(--red);
  border-color: var(--red);
}

.key.del {
  font-size: 20px;
  color: var(--text-light);
}

/* PIN modal layout (Change PIN / Set PIN) */
.pin-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 16px;
}

.pin-modal-body .pin-box {
  margin-bottom: 32px;
}

.pin-modal-message {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 24px;
  text-align: center;
}

.pin-modal-error {
  color: var(--red);
  font-size: 18px;
  font-weight: 700;
  min-height: 26px;
  margin-top: 16px;
  text-align: center;
}

.login-screen .login-error {
  color: var(--red);
  font-size: 20px;
  margin-top: 20px;
  font-weight: 700;
  min-height: 28px;
  text-align: center;
}

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card-large {
  padding: 16px 20px;
  text-align: left;
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.card-large .card-label {
  order: 1;
  font-size: var(--font-sm);
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-large .card-value {
  order: 2;
  font-size: 26px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-large .card-value.value-long {
  font-size: 19px;
}

.card-green .card-value { color: var(--green); }
.card-red .card-value { color: var(--red); }
.card-blue .card-value { color: var(--blue); }

.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* ===== FORM ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: var(--font-md);
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.form-group .required:after {
  content: " *";
  color: var(--red);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  font-size: var(--font-md);
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--blue);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.form-group .remaining-preview {
  margin-top: 8px;
  padding: 12px 16px;
  background: #FFF3E0;
  border-radius: 12px;
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--orange);
  text-align: center;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: var(--font-md);
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  min-height: 48px;
  gap: 8px;
  transition: transform 0.1s, opacity 0.2s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  width: 100%;
}

.btn-success {
  background: var(--green);
  color: #fff;
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-warning {
  background: var(--orange);
  color: #fff;
}

.btn-outline {
  background: #fff;
  color: var(--blue);
  border: 2px solid var(--blue);
}

.btn-sm {
  padding: 10px 18px;
  font-size: var(--font-sm);
  min-height: 40px;
}

.btn-block {
  width: 100%;
}

/* ===== CREDIT LIST ===== */
.credit-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  border-left: 6px solid var(--red);
  cursor: pointer;
  transition: transform 0.1s;
}

.credit-card:active {
  transform: scale(0.98);
}

.credit-card.paid {
  border-left-color: var(--green);
}

.credit-card .credit-name {
  font-size: var(--font-lg);
  font-weight: 700;
  margin-bottom: 4px;
}

.credit-card .credit-amount {
  font-size: var(--font-md);
  color: var(--text);
}

.credit-card .credit-remaining {
  font-size: var(--font-md);
  font-weight: 700;
  margin-top: 4px;
}

.credit-card .credit-remaining.red { color: var(--red); }
.credit-card .credit-remaining.green { color: var(--green); }

.credit-card .credit-date {
  font-size: var(--font-sm);
  color: var(--text-light);
  margin-top: 4px;
}

.credit-card .credit-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 6px;
}

.credit-card .credit-status.active {
  background: #FFEBEE;
  color: var(--red);
}

.credit-card .credit-status.paid-badge {
  background: #E8F5E9;
  color: var(--green);
}

/* ===== SEARCH ===== */
.search-box {
  position: relative;
  margin-bottom: 16px;
}

.search-box input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  font-size: var(--font-md);
  border: 2px solid var(--border);
  border-radius: 28px;
  background: #fff;
  outline: none;
}

.search-box input:focus {
  border-color: var(--blue);
}

.search-box .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--text-light);
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 300;
  display: none;
  align-items: stretch;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal .modal-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
}

.modal .modal-content {
  position: relative;
  background: #fff;
  border-radius: 0;
  width: 100%;
  max-width: 480px;
  max-height: 100vh;
  overflow-y: auto;
  padding: 20px 20px 48px;
  z-index: 1;
  animation: fadeIn 0.2s ease;
}

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

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

.modal .modal-title {
  font-size: var(--font-lg);
  font-weight: 700;
}

.modal .modal-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--font-md);
}

.modal .detail-row .detail-label {
  color: var(--text-light);
}

.modal .detail-row .detail-value {
  font-weight: 600;
}

.modal .detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.modal .detail-actions .btn {
  flex: 1;
  min-width: 70px;
}

.modal .payment-history {
  margin-top: 20px;
}

.modal .payment-history h3 {
  font-size: var(--font-md);
  margin-bottom: 12px;
}

.modal .payment-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: var(--font-sm);
}

/* ===== REPORT ===== */
.report-filters {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.report-filters::-webkit-scrollbar { display: none; }

.report-filters .filter-chip {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-align: center;
}

.report-filters .filter-chip.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.report-summary {
  text-align: center;
  padding: 24px;
}

.report-summary .summary-row {
  display: flex;
  justify-content: space-around;
  flex-wrap: nowrap;
  gap: 8px;
}

.report-summary .summary-row > div {
  flex: 1 1 0;
  min-width: 0;
}

.report-summary .summary-value {
  font-size: clamp(18px, 6vw, 40px);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.report-summary .summary-label {
  font-size: var(--font-sm);
  color: var(--text-light);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== SETTINGS ===== */
.settings-section {
  margin-bottom: 24px;
}

.settings-section h3 {
  font-size: var(--font-md);
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.settings-section .settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--card);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.settings-section .settings-item:active {
  background: #f8f8f8;
}

.settings-section .settings-item .settings-label {
  font-size: var(--font-md);
  font-weight: 600;
}

.settings-section .settings-item .settings-arrow {
  font-size: 18px;
  color: var(--text-light);
}

.settings-section .settings-item .settings-value {
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--green);
}

.settings-section .settings-item.danger {
  border: 2px solid var(--red);
}

.settings-section .settings-item.danger .settings-label {
  color: var(--red);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 24px;
  border-radius: 28px;
  background: #333;
  color: #fff;
  font-size: var(--font-md);
  font-weight: 600;
  z-index: 400;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
}

.toast.success { background: var(--green); }
.toast.error { background: var(--red); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state .empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state .empty-text {
  font-size: var(--font-md);
  color: var(--text-light);
  margin-bottom: 8px;
}

/* ===== BACKUP STATUS ===== */
.backup-status-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  font-size: var(--font-md);
  font-weight: 600;
  gap: 8px;
  text-align: center;
}

.backup-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-light);
  background: #f0f0f0;
  border-radius: 20px;
}

.backup-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.backup-status .dot.online { background: var(--green); }
.backup-status .dot.offline { background: var(--red); }
.backup-status .dot.syncing { background: var(--orange); animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ===== RECEIPT ===== */
.receipt-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 500;
  background: rgba(0,0,0,0.45);
  display: none !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 16px;
}

.receipt-screen.open {
  display: flex !important;
}

.receipt-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
  max-width: 340px;
  flex-wrap: wrap;
}

.receipt-actions .btn {
  flex: 1;
  min-width: 90px;
}

.receipt-include-reason {
  width: 100%;
  max-width: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: var(--font-md);
  font-weight: 600;
  cursor: pointer;
}

.receipt-include-reason input {
  width: 22px;
  height: 22px;
}

.receipt-paper {
  background: #fff;
  width: 100%;
  max-width: 340px;
  padding: 24px 20px;
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
  color: #000;
  font-size: 16px;
  line-height: 1.5;
}

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

.receipt-brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
}

.receipt-title {
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.receipt-sub {
  font-size: 13px;
  color: #444;
  margin-top: 4px;
}

.receipt-divider {
  border-top: 1px dashed #999;
  margin: 14px 0;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  gap: 12px;
}

.receipt-row .receipt-label {
  color: #333;
  white-space: nowrap;
}

.receipt-row .receipt-value {
  font-weight: 700;
  text-align: right;
}

.receipt-row.receipt-remaining .receipt-value {
  color: var(--red);
}

.receipt-status {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 4px;
  padding: 6px 0;
}

.receipt-status.paid { color: var(--green); }
.receipt-status.unpaid { color: var(--red); }

.receipt-thanks {
  font-size: 16px;
  font-weight: 700;
}

.receipt-section-title {
  font-weight: 700;
  margin: 8px 0;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.receipt-empty {
  text-align: center;
  padding: 12px 0;
  color: #444;
}

.receipt-list-item {
  padding: 6px 0;
  border-bottom: 1px dashed #ddd;
}

.receipt-list-item:last-child {
  border-bottom: none;
}

.receipt-list-name {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.receipt-list-status {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
}

.receipt-list-status.paid { color: var(--green); }
.receipt-list-status.unpaid { color: var(--red); }

.receipt-list-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #333;
}

/* ===== PRINT ===== */
@media print {
  html, body { background: #fff; overflow: visible; height: auto; }

  /* Hide all app chrome in every print (safety net even if receipt flow fails) */
  .header, .footer, .slide-menu, .overlay, .modal, .toast,
  .menu-btn, .backup-status, .search-box, .detail-actions, .modal-close,
  .report-filters, .filter-chip, .settings-section, .settings-item,
  .receipt-screen .receipt-actions, .receipt-include-reason { display: none !important; }
  .content { overflow: visible; padding: 0; }
  .card, .credit-card { box-shadow: none; break-inside: avoid; }

  /* Receipt-only printing (body.print-receipt set before window.print()) */
  body.print-receipt * { visibility: hidden !important; }
  body.print-receipt #receipt-screen,
  body.print-receipt #receipt-screen * { visibility: visible !important; }
  body.print-receipt #app {
    display: none !important;
  }
  body.print-receipt #receipt-screen {
    position: static !important;
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
    padding: 0 !important;
  }
  body.print-receipt .receipt-actions,
  body.print-receipt .receipt-include-reason { display: none !important; }
  body.print-receipt .receipt-paper {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 80mm !important;
  }
  body.print-receipt .receipt-divider { border-color: #000; }

  @page { margin: 5mm; }
}

/* ===== SCROLLBAR ===== */
.content::-webkit-scrollbar { width: 4px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* ===== PAGE HIDDEN ===== */
.page { display: none; }
.page.active { display: block; }
