/* ═══════════════════════════════════════════════════════════════════
   ChequePrintPro — Stylesheet
   Design system: dark-navy header · white cards · amber accent
   ═══════════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────────── */
:root {
  --color-primary:      #1e3a5f;
  --color-primary-mid:  #2a5298;
  --color-accent:       #f5a623;
  --color-accent-dark:  #d4891a;

  --color-bg:           #f0f4f9;
  --color-card:         #ffffff;
  --color-border:       #dde3ec;
  --color-border-focus: #4a85d8;

  --color-text:         #1a2332;
  --color-text-muted:   #6b7a8d;
  --color-text-light:   #9ba8b8;

  --color-success:      #16a34a;
  --color-danger:       #dc2626;
  --color-danger-hover: #b91c1c;
  --color-warning:      #d97706;

  /* Semantic dot colours for calibration fields */
  --dot-payee:   #3b82f6;
  --dot-words:   #22c55e;
  --dot-figures: #f59e0b;
  --dot-date:    #ef4444;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:  0 12px 32px rgba(0,0,0,.15);

  --transition: 150ms ease;
}

/* ── Reset / Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────────────────────── */
.header {
  background: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { width: 36px; height: 36px; flex-shrink: 0; }
.logo-text {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -.3px;
}
.logo-sub {
  display: block;
  font-size: .7rem;
  color: rgba(255,255,255,.55);
  letter-spacing: .4px;
  text-transform: uppercase;
}

/* ── Tab Navigation ────────────────────────────────────────────────── */
.tab-nav {
  background: var(--color-primary);
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  gap: 0;
  max-width: 1280px;
  /* Spans full width but buttons are left-aligned */
  padding: 0 24px;
}
.tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 22px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: rgba(255,255,255,.6);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.tab-btn svg { width: 16px; height: 16px; }
.tab-btn:hover { color: rgba(255,255,255,.9); }
.tab-btn.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* ── Main / Panes ──────────────────────────────────────────────────── */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Card ──────────────────────────────────────────────────────────── */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 20px;
}
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.card-header-row .card-title { margin-bottom: 0; }

/* ── Forms ─────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.flex-1 { flex: 1; min-width: 120px; }
.form-group.flex-2 { flex: 2; min-width: 200px; }
.form-group.form-btn-group { justify-content: flex-end; }

.form-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.required { color: var(--color-danger); }

.form-input, .form-select {
  padding: 9px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: .92rem;
  color: var(--color-text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}
.form-input:focus, .form-select:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(74,133,216,.15);
}
.form-input::placeholder { color: var(--color-text-light); }

.input-prefix-wrap { position: relative; }
.input-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-weight: 600;
  pointer-events: none;
}
.input-with-prefix { padding-left: 28px; }

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.form-row .form-group { flex: 1; min-width: 120px; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--transition), transform 80ms, box-shadow var(--transition);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--color-primary-mid);
  color: #fff;
  box-shadow: 0 2px 6px rgba(42,82,152,.3);
}
.btn-primary:hover {
  background: var(--color-primary);
  box-shadow: 0 4px 10px rgba(42,82,152,.4);
}

.btn-secondary {
  background: #fff;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--color-bg); }

.btn-danger {
  background: #fef2f2;
  color: var(--color-danger);
  border: 1px solid #fecaca;
}
.btn-danger:hover { background: #fee2e2; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}

/* ── Divider ───────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: 20px 0;
}

/* ════════════════════════════════════ TAB 1: FILL CHEQUE */

.fill-layout {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 24px;
  align-items: start;
}

.fill-form-card .form-group { margin-bottom: 16px; }
.fill-form-card .form-group:last-child { margin-bottom: 0; }

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 4px;
}

/* Amount words display */
.words-display {
  min-height: 48px;
  padding: 10px 14px;
  background: #f0f7ff;
  border: 1.5px solid #bfd9f5;
  border-radius: var(--radius-md);
  font-size: .88rem;
  font-style: italic;
  color: var(--color-primary);
  line-height: 1.6;
  word-break: break-word;
}

/* Date boxes */
.date-boxes-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}
.date-box {
  display: inline-flex;
  width: 30px;
  height: 34px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  font-family: "Courier New", monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  background: var(--color-bg);
  transition: all .2s;
}
.date-box.filled {
  background: #e8f4fd;
  border-color: var(--color-border-focus);
  color: var(--color-primary);
}
.date-sep {
  font-weight: 700;
  color: var(--color-text-muted);
  margin: 0 2px;
  font-size: 1.1rem;
}

/* ── Calibration-accurate live preview ─────────────────────────── */
.cheque-visual-wrap {
  background: repeating-linear-gradient(
    45deg,
    #f0f4f9 0px, #f0f4f9 4px,
    #e8edf5 4px, #e8edf5 8px
  );
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  overflow-x: auto;
  margin-bottom: 10px;
}

/* The scaled cheque rectangle */
.cheque-live-sheet {
  position: relative;
  background: #fffef8;
  border: 1px solid #c8d4e0;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  /* width + height set by JS */
  min-height: 60px;
}

/* Each positioned text field */
.cheque-live-field {
  position: absolute;
  color: #1a2332;
  white-space: nowrap;
  line-height: 1;
  pointer-events: none;
}

/* Placeholder fields (no data yet) */
.cheque-live-field.placeholder {
  color: #b0bcc8;
  font-style: italic;
}

/* Footer row below the cheque */
.live-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.live-profile-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--color-text-muted);
}
.live-scale-hint {
  font-size: .72rem;
  color: var(--color-text-light);
}

.preview-hint {
  font-size: .78rem;
  color: var(--color-text-light);
  line-height: 1.5;
}
.preview-hint strong { color: var(--color-text-muted); }

/* ════════════════════════════════════ TAB 2: PAYEES */

.payees-layout { display: flex; flex-direction: column; gap: 24px; }

.payee-add-form .form-row { align-items: flex-end; }

.search-wrap { position: relative; }
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-light);
  pointer-events: none;
}
.search-input { padding-left: 34px; min-width: 220px; }

/* Payees list */
.payees-list { display: flex; flex-direction: column; gap: 0; }

.payee-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-bg);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  gap: 12px;
}
.payee-item:hover { background: #f8fafd; }
.payee-item:last-child { border-bottom: none; }

.payee-info { display: flex; align-items: center; gap: 10px; flex: 1; }
.payee-name { font-weight: 600; font-size: .92rem; }
.payee-category {
  font-size: .75rem;
  padding: 2px 9px;
  background: #eef4ff;
  color: #3b5998;
  border-radius: 999px;
  font-weight: 500;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text-light);
  font-size: .9rem;
}
.loading {
  padding: 24px;
  text-align: center;
  color: var(--color-text-light);
  font-size: .9rem;
}

/* ════════════════════════════════════ TAB 3: CALIBRATE */

.calib-layout {
  display: grid;
  grid-template-columns: 560px 1fr;
  gap: 24px;
  align-items: start;
}

.calib-settings { display: flex; flex-direction: column; gap: 16px; }

.calib-section { padding: 20px; }
.calib-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.calib-section-title svg { width: 15px; height: 15px; color: var(--color-text-muted); }

.calib-input { font-size: .88rem; padding: 7px 10px; }

/* Paper preset row */
.paper-preset-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 14px;
  flex-wrap: wrap;
}
.paper-preset-label {
  font-size: .78rem;
  color: var(--color-text-muted);
  font-weight: 500;
}
.btn-preset {
  font-size: .78rem;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  font-weight: 500;
  transition: border-color .15s, background .15s;
}
.btn-preset:hover { border-color: var(--color-primary); background: var(--color-primary-light, #eff6ff); }
.btn-preset-direct {
  border-color: #f59e0b;
  color: #92400e;
  background: #fffbeb;
}
.btn-preset-direct:hover { background: #fef3c7; border-color: #d97706; }

.calib-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding-top: 4px;
}

/* Dot colour indicator */
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Calibration visual preview */
.calib-preview-card {
  position: sticky;
  top: 88px; /* below header + tab-nav */
}
.calib-preview-header { margin-bottom: 16px; }
.calib-preview-scroll {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 8px;
}

.calib-preview-box {
  position: relative;
  background: #fffef8;
  border: 2px dashed #c0ccd8;
  border-radius: var(--radius-sm);
  overflow: visible;
  /* Dimensions set by JS (cheque_width_mm × 2.5, cheque_height_mm × 2.5) */
  min-width: 200px;
  min-height: 100px;
}

/* Decorative guide lines (approximate cheque printed lines) */
.cv-line {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: rgba(180,195,215,.5);
}

/* Draggable field handles in calibration preview */
.calib-handle {
  position: absolute;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #fff;
  cursor: grab;
  user-select: none;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  transition: box-shadow .1s;
  transform: translateY(-50%);  /* align label centre to Y coordinate */
}
.calib-handle:hover { box-shadow: 0 4px 10px rgba(0,0,0,.3); }
.calib-handle.dragging {
  cursor: grabbing;
  box-shadow: 0 6px 16px rgba(0,0,0,.3);
  z-index: 20;
}

/* Legend */
.calib-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ── Toast ─────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--color-text);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: .88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  z-index: 9999;
  max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Modal ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,20,40,.55);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-border);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--color-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: background var(--transition);
}
.modal-close:hover { background: var(--color-border); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Preview paper */
.preview-content { overflow-x: auto; }
.preview-paper {
  background: #fff;
  width: 210mm;
  min-height: 100mm;
  border: 1.5px solid var(--color-border);
  position: relative;
  margin: 0 auto 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
}
.preview-cheque-area {
  position: absolute;
  background: transparent;
  /* Dimensions and position set by JS from calibration */
}
.preview-field {
  position: absolute;
  font-family: Arial, sans-serif;
  color: #000;
  white-space: nowrap;
}
.preview-note {
  font-size: .78rem;
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.5;
}

/* ── Ruler print elements ──────────────────────────────────────────── */
.ruler-header {
  position: absolute;
  font-family: Arial, sans-serif;
  font-size: 7pt;
  color: #444;
  line-height: 1.6;
}
.ruler-outline {
  position: absolute;
  border: 1px dashed #aaa;
  box-sizing: border-box;
}
.ruler-marker {
  position: absolute;
  font-family: Arial, sans-serif;
  font-size: 6.5pt;
  white-space: nowrap;
  transform: translateY(-50%);
  line-height: 1;
}
.ruler-crosshair {
  font-size: 9pt;
  font-weight: 700;
  margin-right: 2px;
}
.ruler-dim-line {
  position: absolute;
  background: #ccc;
}

/* ── Print Sheet — ONLY visible during window.print() ─────────────── */
#print-sheet {
  display: none;
}

@media print {
  /* Hide the entire app UI */
  #app    { display: none !important; }
  #toast  { display: none !important; }
  .modal-overlay { display: none !important; }

  /* Reset page margins */
  html, body {
    margin: 0;
    padding: 0;
    background: transparent;
  }

  @page {
    size: A4 portrait;
    margin: 0;
  }

  /* Show the print sheet — it is a full A4 page */
  #print-sheet {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 210mm;
    height: 297mm;
    background: transparent;
    page-break-after: avoid;
  }

  /* Each text field on the cheque */
  .print-field {
    position: absolute;
    background: transparent;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ── Print setup tips (collapsible) ───────────────────────────────── */
.print-tips {
  margin-bottom: 16px;
  border: 1.5px solid #fed7aa;
  border-radius: var(--radius-md);
  background: #fffbf5;
  overflow: hidden;
}
.print-tips[open] { border-color: #fb923c; }

.print-tips-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: .82rem;
  font-weight: 600;
  color: #9a3412;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.print-tips-summary::-webkit-details-marker { display: none; }
.print-tips-summary svg { width: 15px; height: 15px; flex-shrink: 0; color: #f97316; }
.print-tips-summary::after {
  content: '▸';
  margin-left: auto;
  font-size: .7rem;
  color: #f97316;
  transition: transform .15s;
}
.print-tips[open] .print-tips-summary::after { transform: rotate(90deg); }

.print-tips-body {
  padding: 0 14px 14px;
  border-top: 1px solid #fed7aa;
}

.print-tips-grid { display: flex; flex-direction: column; gap: 0; margin-top: 10px; }

.tip-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #fde8d0;
  font-size: .82rem;
}
.tip-row:last-child { border-bottom: none; }
.tip-row.tip-critical .tip-key { color: #9a3412; }
.tip-row.tip-critical .tip-val strong { color: #c2410c; font-size: .9rem; }

.tip-key {
  min-width: 150px;
  font-weight: 600;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.tip-val {
  color: var(--color-text);
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.tip-val em { color: var(--color-text-light); font-style: normal; font-size: .76rem; }
.tip-note {
  font-size: .74rem;
  color: #c2410c;
  font-style: italic;
}

.tip-calibrate-hint {
  margin-top: 10px;
  padding: 8px 10px;
  background: #fff7ed;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  color: #7c2d12;
  line-height: 1.5;
}
.tip-calibrate-hint strong { color: #9a3412; }

/* ── Save-payee inline hint ────────────────────────────────────────── */
.save-payee-hint {
  margin-top: 8px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1.5px dashed #86efac;
  border-radius: var(--radius-md);
  animation: fadeSlideIn .2s ease;
}

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

.save-hint-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: #166534;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 8px;
}

.save-hint-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.save-hint-cat {
  flex: 1;
  min-width: 120px;
  font-size: .85rem;
  padding: 7px 10px;
  border-color: #86efac;
}
.save-hint-cat:focus { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.15); }

.btn-save-hint {
  background: #22c55e;
  color: #fff;
  font-size: .85rem;
  padding: 7px 14px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(34,197,94,.3);
}
.btn-save-hint:hover { background: #16a34a; }
.btn-save-hint svg { width: 14px; height: 14px; }

/* ── Bank profile UI ───────────────────────────────────────────────── */

/* Fill Cheque: bank selector group */
.bank-profile-group { margin-bottom: 0; }

/* Auto-detected bank badge under fill-bank-select */
.bank-active-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  font-size: .8rem;
  color: #92400e;
  margin-top: 8px;
  font-weight: 500;
}
.bank-active-badge svg { flex-shrink: 0; }

/* Payee list: bank pill */
.payee-bank-pill {
  display: flex;
  align-items: center;
  gap: 5px;
}
.payee-bank-select {
  font-size: .78rem;
  padding: 3px 8px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #f0f7ff;
  color: #1e3a5f;
  cursor: pointer;
  outline: none;
  max-width: 160px;
  transition: border-color var(--transition);
}
.payee-bank-select:focus { border-color: var(--color-border-focus); }
.payee-bank-select.has-bank {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

/* Calibrate: bank profile section */
.calib-bank-section {
  border-left: 3px solid var(--color-accent);
  background: linear-gradient(to right, #fffcf5, #fff);
}
.calib-bank-row { align-items: flex-end; }
.calib-bank-btns { flex-direction: row; gap: 8px; }

.calib-active-badge {
  margin-top: 12px;
  padding: 8px 12px;
  background: #f0f4ff;
  border-radius: var(--radius-md);
  font-size: .82rem;
  color: var(--color-primary);
  border: 1px solid #c7d8f5;
}
.calib-active-badge strong { color: var(--color-primary-mid); }
.calib-active-badge.is-bank {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.calib-active-badge.is-bank strong { color: #b45309; }

.calib-delete-bank {
  color: var(--color-danger);
  border-color: #fecaca;
  background: #fef2f2;
}
.calib-delete-bank:hover { background: #fee2e2; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .fill-layout {
    grid-template-columns: 1fr;
  }
  .calib-layout {
    grid-template-columns: 1fr;
  }
  .calib-preview-card {
    position: static;
  }
}

@media (max-width: 600px) {
  .main { padding: 16px 14px 40px; }
  .header-inner { padding: 0 16px; }
  .tab-nav { padding: 0 8px; }
  .tab-btn { padding: 12px 14px; font-size: .82rem; }
  .card { padding: 16px; }
}
