/* ==========================================================================
   LOAN SETTLEMENT TEMPLATE STUDIO — MASTER STYLESHEET
   Accurate recreation of the master reference PDF + Modern Editor UI
   ========================================================================== */

/* --- CSS Variables & Design Tokens --- */
:root {
  /* Master PDF Palette */
  --pdf-bg: #fdfdfd;
  --pdf-border: #e2e8f0;
  --pdf-navy-header: #081d2f;
  --pdf-green-header: #076644;
  --pdf-red-header: #be0e0e;
  --pdf-text-dark: #0f172a;
  --pdf-text-muted: #475569;
  --pdf-green-text: #076644;
  --pdf-red-text: #c00f0f;
  --pdf-accent-green: #0a7758;

  /* App Editor UI Palette (Modern Dark / Slate) */
  --app-bg: #0d1117;
  --panel-bg: #161b22;
  --card-bg: #21262d;
  --card-border: #30363d;
  --text-main: #f0f6fc;
  --text-dim: #8b949e;
  --text-link: #58a6ff;

  --primary: #238636;
  --primary-hover: #2ea043;
  --secondary: #30363d;
  --secondary-hover: #3c444d;
  --danger: #da3633;
  --danger-hover: #f85149;
  --warning: #d29922;
  --info: #1f6feb;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-pdf: 0 10px 30px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.08);

  --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-brand: 'Montserrat', sans-serif;
  --font-condensed: 'Barlow Condensed', 'Oswald', sans-serif;
}

/* Reset & Box Model */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base);
  background-color: var(--app-bg);
  color: var(--text-main);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   APP HEADER & TOPBAR
   ========================================================================== */
.app-topbar {
  height: 64px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 100;
}

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

.topbar-logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #0a7758, #076644);
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(10, 119, 88, 0.4);
}

.topbar-brand h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.topbar-brand .subtitle {
  font-size: 12px;
  color: var(--text-dim);
}

/* Permanent logo image in top bar */
.topbar-logo-img {
  height: 38px;
  width: auto;
  display: block;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
  padding: 3px 8px;
  flex-shrink: 0;
}

/* Vertical divider between logo and app title */
.topbar-brand-divider {
  width: 1px;
  height: 32px;
  background: var(--card-border);
  margin: 0 6px;
  flex-shrink: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

/* ==========================================================================
   BUTTONS & UI CONTROLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-base);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
  text-decoration: none;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-lg {
  padding: 10px 20px;
  font-size: 14px;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 0 12px rgba(35, 134, 54, 0.4);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--text-main);
  border-color: var(--card-border);
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
  color: #fff;
}

.btn-outline {
  background-color: transparent;
  color: var(--text-main);
  border-color: var(--card-border);
}

.btn-outline:hover {
  background-color: var(--secondary);
  border-color: #8b949e;
}

.btn-success {
  background-color: #0a7758;
  color: #ffffff;
}

.btn-success:hover {
  background-color: #076644;
  box-shadow: 0 0 10px rgba(10, 119, 88, 0.4);
}

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

.btn-danger:hover {
  background-color: var(--danger-hover);
  box-shadow: 0 0 10px rgba(218, 54, 51, 0.4);
}

.btn-icon {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-icon:hover {
  background: var(--secondary);
  color: #fff;
}

.file-input-label {
  cursor: pointer;
}

/* ==========================================================================
   MAIN DUAL-PANE LAYOUT
   ========================================================================== */
.main-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* Left Pane: Editor */
.editor-pane {
  width: 480px;
  min-width: 380px;
  max-width: 580px;
  background: var(--panel-bg);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
}

.editor-tabs {
  display: flex;
  background: var(--app-bg);
  border-bottom: 1px solid var(--card-border);
  padding: 6px 8px 0;
  gap: 4px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-base);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: var(--text-link);
  border-bottom-color: var(--text-link);
  background: var(--panel-bg);
}

.editor-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--card-border) transparent;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Right Pane: Preview */
.preview-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #090c10;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.preview-toolbar {
  height: 48px;
  background: rgba(22, 27, 34, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 10;
}

.preview-status-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-main);
}

.live-indicator {
  width: 8px;
  height: 8px;
  background-color: #2ea043;
  border-radius: 50%;
  box-shadow: 0 0 8px #2ea043;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

.preview-zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.preview-viewport {
  flex: 1;
  overflow: auto;
  padding: 30px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background-color: #0b0f14;
  background-image: radial-gradient(#1e293b 1px, transparent 1px);
  background-size: 20px 20px;
}

/* ==========================================================================
   CARDS & FORM CONTROLS IN EDITOR
   ========================================================================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.card-accent-glow {
  background: linear-gradient(145deg, #1b2838, #182230);
  border-color: #284766;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.1);
}

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

.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-dim);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  background: #0d1117;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-base);
  font-size: 13px;
  padding: 8px 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--text-link);
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.form-control.bg-readonly {
  background: #161b22;
  color: var(--text-dim);
  cursor: not-allowed;
}

.form-hint {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.input-addon-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}

.input-addon-wrapper .form-control {
  padding-right: 32px;
}

.input-addon {
  position: absolute;
  right: 10px;
  font-size: 12px;
  color: var(--text-dim);
  pointer-events: none;
}

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

.grid-3-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.action-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.section-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.section-subbar h4 {
  font-size: 13px;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
}

.badge-primary {
  background: rgba(88, 166, 255, 0.15);
  color: #58a6ff;
}

.badge-success {
  background: rgba(46, 160, 67, 0.15);
  color: #3fb950;
}

.badge-warning {
  background: rgba(210, 153, 34, 0.15);
  color: #d29922;
}

.badge-info {
  background: rgba(56, 139, 253, 0.15);
  color: #58a6ff;
}

.badge-danger {
  background: rgba(218, 54, 51, 0.15);
  color: #f85149;
}

/* Utility classes */
.d-flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.mb-1 {
  margin-bottom: 6px;
}

/* Loan Card in Editor List */
.loan-rows-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.loan-card-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: transform 0.1s, border-color 0.15s;
}

.loan-card-item:hover {
  border-color: #484f58;
}

.loan-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.loan-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.loan-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-card-action {
  background: transparent;
  border: none;
  color: var(--text-dim);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
}

.btn-card-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-card-action.btn-del:hover {
  background: rgba(218, 54, 51, 0.2);
  color: #f85149;
}

.loan-card-grid {
  display: grid;
  grid-template-columns: 70px 1.4fr 1.2fr;
  gap: 8px;
  margin-bottom: 8px;
}

/* Streamlined 2-input layout: Bank + Outstanding only */
.loan-card-grid-2input {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.loan-card-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px;
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.calc-box-item {
  display: flex;
  flex-direction: column;
}

.calc-box-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.calc-box-label.text-payable {
  color: #3fb950;
}

.calc-box-label.text-waived {
  color: #f85149;
}

.calc-box-value {
  font-size: 14px;
  font-weight: 800;
}

/* Summary stats box */
.summary-calc-card {
  background: #111822;
  border-color: #2b394e;
  margin-top: 10px;
}

.summary-calc-card h4 {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.summary-stat-box {
  background: #161f2c;
  padding: 8px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
}

.stat-value {
  font-size: 13px;
  font-weight: 800;
  margin-top: 2px;
}

.text-dark {
  color: #f0f6fc;
}

.text-success {
  color: #3fb950;
}

.text-danger {
  color: #f85149;
}

.text-warning {
  color: #d29922;
}

/* ==========================================================================
   MASTER PDF TEMPLATE CANVAS — MULTI-PAGE CONTAINER & PAGES
   ========================================================================== */
#pdfPagesContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  transform-origin: top center;
  transition: transform 0.2s ease;
}

.pdf-document-page {
  background-color: var(--pdf-bg);
  color: var(--pdf-text-dark);
  box-shadow: var(--shadow-pdf);
  border-radius: 4px;
  padding: 22px 32px 18px 32px;
  position: relative;
  box-sizing: border-box;
  transform-origin: top center;
  transition: transform 0.2s ease;
}

/* Gap between pages on preview screen */
.pdf-page-gap {
  height: 28px;
  width: 100%;
  position: relative;
}

/* Master Aspect Ratio: Standard Print Dimensions */
.pdf-document-page.landscape {
  width: 1060px;
  min-height: 560px;
}

.pdf-document-page.portrait {
  width: 792px;
  min-height: 800px;
}

/* Continuation Header (Page 2, 3, etc.) */
.doc-header-cont {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--pdf-navy);
}

.doc-brand-block-cont {
  display: flex;
  align-items: center;
}

.doc-logo-img-cont {
  height: 32px;
  width: auto;
  object-fit: contain;
  display: block;
}

.doc-heading-cont {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.doc-cont-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  color: var(--pdf-navy);
  letter-spacing: 0.5px;
}

.doc-cont-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--pdf-text-muted);
}

/* Prevent rows splitting across page breaks */
.settlement-table tr {
  page-break-inside: avoid;
  break-inside: avoid;
}

/* --- HEADER RECREATION --- */
.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

/* Left Brand Block — holds the permanent fixed logo image */
.doc-brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 260px;
  flex-shrink: 0;
}

/* PERMANENT LOGO IMAGE — fixed, not editable */
.doc-logo-img {
  width: 220px;
  height: auto;
  display: block;
  object-fit: contain;
  /* White background to ensure clean appearance on any template bg */
  background: transparent;
}


.doc-logo {
  font-family: var(--font-brand);
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.8px;
  display: flex;
  align-items: baseline;
}

.logo-settle {
  color: var(--pdf-accent-green);
  font-weight: 700;
}

.logo-xpert-box {
  color: #0c1a24;
  position: relative;
}

.logo-x {
  color: #0c1a24;
  position: relative;
  font-weight: 800;
}

.logo-x::before {
  content: "•";
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--pdf-accent-green);
  font-size: 20px;
}

.logo-pert {
  color: #0c1a24;
  font-weight: 700;
}

.doc-brand-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 6px 0 4px 0;
  gap: 6px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background-color: #64748b;
  opacity: 0.6;
}

.divider-diamond {
  font-size: 7px;
  color: #0c1a24;
}

/* Client Name + Phone — ONE LINE, right side below subtitle */
.doc-client-name {
  margin-top: 10px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  background: rgba(8, 29, 47, 0.06);
  border: 1px solid rgba(8, 29, 47, 0.14);
  border-radius: 6px;
  padding: 6px 14px;
  white-space: nowrap;
}

.doc-client-name-text {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: #081d2f;
  letter-spacing: 0.2px;
}

.doc-client-name-text::before {
  content: "Client: ";
  font-weight: 500;
  color: #475569;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-right: 2px;
}

.doc-client-phone-text {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  letter-spacing: 0.1px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-left: 1px solid #cbd5e1;
  padding-left: 8px;
}


.doc-tagline {
  font-family: var(--font-base);
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: 0.2px;
}

/* Right Heading Block */
.doc-heading-block {
  text-align: right;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.doc-main-title {
  font-family: 'Montserrat', 'Outfit', sans-serif;
  font-size: 35px;
  font-weight: 800;
  color: #071f33;
  letter-spacing: 0.8px;
  line-height: 1.1;
  margin: 0;
  text-transform: uppercase;
}

/* Font variations selected via Header Tab */
.font-montserrat .doc-main-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 35px;
  font-weight: 800;
  letter-spacing: 0.8px;
}

.font-outfit .doc-main-title {
  font-family: 'Outfit', sans-serif;
  font-size: 37px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.font-jakarta .doc-main-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 33px;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.font-barlow .doc-main-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 46px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.font-poppins .doc-main-title {
  font-family: 'Poppins', sans-serif;
  font-size: 33px;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.doc-subtitle-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
}

.doc-subtitle {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #092032;
  letter-spacing: 0.3px;
}

.doc-subtitle-underline {
  width: 100%;
  height: 2.5px;
  background: linear-gradient(90deg, #0a7758 0%, #081d2f 50%, #be0e0e 100%);
  border-radius: 2px;
  margin-top: 5px;
}

/* --- MAIN SETTLEMENT TABLE RECREATION --- */
.doc-table-wrapper {
  margin-bottom: 8px;
  width: 100%;
}

.settlement-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-base);
}

/* Table Header Row */
.settlement-table thead tr {
  height: 42px;
}

.settlement-table th {
  padding: 7px 10px;
  font-family: var(--font-base);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  text-align: center;
  vertical-align: middle;
  border-right: 1.5px solid rgba(255, 255, 255, 0.4);
}

.settlement-table th:last-child {
  border-right: none;
}

/* Distinct Header Colors (Exact to PDF) */
.settlement-table th.th-sr {
  background-color: var(--pdf-navy-header);
  width: 6.5%;
  font-size: 13px;
}

.settlement-table th.th-loan {
  background-color: var(--pdf-navy-header);
  width: 24%;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.settlement-table th.th-outstanding {
  background-color: var(--pdf-navy-header);
  width: 20%;
}

.settlement-table th.th-payable {
  background-color: var(--pdf-green-header);
  width: 24.5%;
}

.settlement-table th.th-waived {
  background-color: var(--pdf-red-header);
  width: 25%;
}

/* Table Body Rows */
.settlement-table tbody tr {
  border-bottom: 1px solid #e5e7eb;
}

.settlement-table td {
  padding: 7px 12px;
  font-size: 15px;
  color: var(--pdf-text-dark);
  vertical-align: middle;
}

/* Row Columns Alignment & Colors */
.settlement-table td.td-sr {
  text-align: center;
  font-weight: 700;
  color: #111827;
}

.settlement-table td.td-loan {
  text-align: left;
  font-weight: 600;
  color: #111827;
  padding-left: 20px;
}

.settlement-table td.td-outstanding {
  text-align: right;
  font-weight: 700;
  color: #111827;
  padding-right: 28px;
}

.settlement-table td.td-payable {
  text-align: right;
  font-weight: 700;
  color: var(--pdf-green-text);
  padding-right: 28px;
}

.settlement-table td.td-waived {
  text-align: right;
  font-weight: 700;
  color: var(--pdf-red-text);
  padding-right: 28px;
}

/* Total Row */
.settlement-table tfoot .tr-total {
  border-top: 1.5px solid #d1d5db;
  border-bottom: 1.5px solid #d1d5db;
}

.settlement-table tfoot td {
  padding: 8px 12px;
  font-size: 16px;
  font-weight: 800;
}

.settlement-table td.td-loan-total {
  text-align: center;
  font-weight: 800;
  color: var(--pdf-green-text);
  letter-spacing: 0.5px;
  font-size: 16.5px;
}

.settlement-table td.td-outstanding-total {
  text-align: right;
  color: #111827;
  padding-right: 28px;
}

.settlement-table td.td-payable-total {
  text-align: right;
  color: var(--pdf-green-text);
  padding-right: 28px;
}

.settlement-table td.td-waived-total {
  text-align: right;
  color: var(--pdf-red-text);
  padding-right: 28px;
}

/* --- FOOTER VALUE PROPOSITIONS RECREATION --- */
.doc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  margin-top: 10px;
  border-top: 1px solid transparent;
}

.footer-guarantee-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.guarantee-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guarantee-icon-wrapper.icon-transparency .badge-circle {
  background: #061d2f;
  color: #22c55e;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 0 3px #061d2f, 0 0 0 4px #22c55e;
}

.guarantee-icon-wrapper.icon-accuracy .badge-circle {
  background: #ffffff;
  color: #086947;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 0 3px #061d2f, 0 0 0 4px #086947;
}

.guarantee-icon-wrapper.icon-commitment .badge-circle {
  background: #061d2f;
  color: #22c55e;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 0 0 3px #061d2f, 0 0 0 4px #22c55e;
}

.guarantee-text {
  display: flex;
  flex-direction: column;
}

.guarantee-title {
  font-family: var(--font-base);
  font-size: 13.5px;
  font-weight: 800;
  color: #0c1a24;
  line-height: 1.2;
}

.guarantee-desc {
  font-family: var(--font-base);
  font-size: 11.5px;
  font-weight: 500;
  color: #475569;
  margin-top: 2px;
}

/* Scaling Options for Table */
.scale-compact .settlement-table td {
  padding: 7px 10px;
  font-size: 14px;
}

.scale-compact .settlement-table th {
  padding: 6px 8px;
  font-size: 13px;
}

.scale-large .settlement-table td {
  padding: 14px 14px;
  font-size: 18px;
}

/* ==========================================================================
   MODAL: BULK IMPORT
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-dialog {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: var(--radius-lg);
  width: 900px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  0% {
    transform: scale(0.95);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1c2128;
}

.modal-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(35, 134, 54, 0.2);
  color: #3fb950;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-dim);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-label-bold {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.sample-chips {
  display: flex;
  gap: 8px;
}

.chip {
  background: #21262d;
  border: 1px solid #30363d;
  color: #58a6ff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover {
  background: #30363d;
  color: #fff;
}

.bulk-textarea {
  width: 100%;
  height: 170px;
  background: #0d1117;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: #e6edf3;
  font-family: 'Consolas', monospace;
  font-size: 12.5px;
  padding: 12px;
  resize: vertical;
  line-height: 1.4;
}

.bulk-textarea:focus {
  outline: none;
  border-color: var(--text-link);
}

.bulk-options-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
}

/* Bulk Preview Section inside modal */
.bulk-preview-section {
  border-top: 1px solid var(--card-border);
  padding-top: 14px;
}

.preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #21262d;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.bulk-preview-table-wrapper {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
}

.bulk-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.bulk-preview-table th {
  background: #1c2128;
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
}

.bulk-preview-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #21262d;
  color: var(--text-main);
}

.bulk-preview-table tr.row-error {
  background: rgba(218, 54, 51, 0.15);
}

.status-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.status-ok {
  background: #238636;
  color: #fff;
}

.status-err {
  background: #da3633;
  color: #fff;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--card-border);
  background: #1c2128;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: #1f242c;
  color: #fff;
  border: 1px solid #30363d;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.toast-success {
  border-left: 4px solid #2ea043;
}

.toast.toast-error {
  border-left: 4px solid #f85149;
}

.toast.toast-info {
  border-left: 4px solid #58a6ff;
}

@keyframes toast-in {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN & PRINT MEDIA
   ========================================================================== */
/* Tablet & Medium Screens (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .main-layout {
    flex-direction: column;
    overflow-y: auto;
    height: auto;
  }

  body {
    overflow: auto;
    height: auto;
  }

  .editor-pane {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--card-border);
  }

  .preview-pane {
    min-height: 800px;
  }
}

/* Dedicated Mobile Phone Responsive Design (<= 768px) */
@media (max-width: 768px) {
  html,
  body {
    height: auto !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    background-color: var(--app-bg);
  }

  /* Topbar: Clean, sleek, mobile-optimized */
  .app-topbar {
    height: 56px;
    padding: 0 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(22, 27, 34, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
  }

  .topbar-brand {
    gap: 8px;
  }

  .topbar-logo-img {
    height: 30px;
    padding: 2px 6px;
    border-radius: 4px;
  }

  .topbar-brand-divider {
    height: 20px;
    margin: 0 4px;
  }

  .topbar-brand h1 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.2px;
    white-space: nowrap;
  }

  /* Hide subtitle and desktop action buttons on phone */
  .topbar-brand .subtitle {
    display: none !important;
  }

  .topbar-actions .btn:not(#btnDownloadPDF) {
    display: none !important;
  }

  .topbar-actions .divider-v {
    display: none !important;
  }

  .topbar-actions #btnDownloadPDF {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(218, 54, 51, 0.35);
  }

  /* Main Container */
  .main-layout {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  .editor-pane {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    border-right: none !important;
    background: transparent !important;
    overflow: visible !important;
  }

  .editor-content {
    padding: 12px 12px 28px 12px !important;
    overflow: visible !important;
    height: auto !important;
  }

  /* HIDE LAPTOP-ONLY CLUTTER:
     Tabs & Hero card removed so phone shows ONLY the 5 required sections */
  .editor-tabs {
    display: none !important;
  }

  .hero-input-card {
    display: none !important;
  }

  /* Mobile Navigation Pills */
  .mobile-nav-pills {
    display: flex !important;
    position: sticky !important;
    top: 56px !important;
    z-index: 95 !important;
    background: #161b22 !important;
    padding: 6px 12px !important;
    gap: 8px !important;
    border-bottom: 1px solid var(--card-border) !important;
  }

  .mobile-nav-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--card-border);
    background: #0d1117;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .mobile-nav-btn.active {
    background: #238636;
    color: #ffffff;
    border-color: #2ea043;
    box-shadow: 0 0 10px rgba(35, 134, 54, 0.3);
  }

  /* Live Preview Canvas on Mobile: Fully visible, touch-scrollable, and zoomable */
  .preview-pane {
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 480px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 10 !important;
    background: #0d1117 !important;
    border-top: 1px solid var(--card-border) !important;
    margin-top: 10px !important;
    overflow: hidden !important;
  }

  .preview-toolbar {
    height: 46px !important;
    padding: 0 10px !important;
    background: rgba(22, 27, 34, 0.96) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid var(--card-border) !important;
  }

  .preview-status-tag {
    font-size: 11px !important;
    gap: 6px !important;
  }

  .preview-status-tag span:last-child {
    display: none !important;
  }

  .preview-zoom-controls {
    gap: 6px !important;
    font-size: 11px !important;
  }

  .preview-zoom-controls .btn-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 11px !important;
  }

  .preview-viewport {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 14px 6px 36px 6px !important;
    min-height: 380px !important;
    max-height: 80vh !important;
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    background-color: #0b0f14 !important;
    background-image: radial-gradient(#1e293b 1px, transparent 1px) !important;
    background-size: 16px 16px !important;
  }

  #pdfPagesContainer {
    width: auto !important;
    min-width: 0 !important;
    transform-origin: top center !important;
  }

  .pdf-document-page {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
    margin-bottom: 16px !important;
  }

  /* SECTION 1: Client Info */
  .client-info-card {
    margin-bottom: 12px;
    border-radius: var(--radius-md);
  }

  .client-info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 8px;
  }

  /* SECTION 2: Bulk CTA Button (Paste Multiple Loans from ChatGPT) */
  .bulk-cta-btn {
    padding: 12px 14px;
    gap: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
  }

  .bulk-cta-btn strong {
    font-size: 13.5px;
  }

  .bulk-cta-btn small {
    font-size: 11px;
  }

  /* SECTION 3: Settlement Rate */
  .rate-display-row {
    gap: 8px;
    margin-top: 8px;
  }

  .rate-box {
    padding: 8px 10px;
  }

  .rate-input {
    font-size: 20px;
    padding: 4px 6px;
  }

  .rate-pct {
    font-size: 16px;
  }

  /* SECTION 4: Loan Records */
  .section-subbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0 6px 0;
  }

  .section-subbar h4 {
    font-size: 14px;
  }

  .loan-card-item {
    padding: 10px 12px;
    border-radius: var(--radius-md);
  }

  .loan-card-grid-2input {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .btn-card-action {
    width: 32px !important;
    height: 32px !important;
    font-size: 12.5px !important;
  }

  .loan-card-calc-grid {
    padding: 6px 10px;
  }

  .calc-box-value {
    font-size: 13px;
  }

  /* SECTION 5: Auto-calculated Totals */
  .summary-calc-card {
    margin-top: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .summary-stat-box:first-child {
    grid-column: span 2;
    background: #192535;
    border: 1px solid rgba(88, 166, 255, 0.25);
    padding: 10px 12px;
  }

  .summary-stat-box:first-child .stat-value {
    font-size: 18px;
  }

  .summary-stat-box {
    padding: 8px 10px;
  }

  /* Mobile Download Button Below Totals */
  .mobile-download-wrapper {
    display: block !important;
  }

  .mobile-download-wrapper .btn {
    padding: 12px 18px;
    font-size: 14px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(218, 54, 51, 0.4);
  }

  /* Touch input zoom protection (iOS Safari) */
  .form-control,
  .rate-input,
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Mobile Toast */
  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast {
    width: 100%;
  }

  /* BULK IMPORT MODAL — PHONE OPTIMIZED */
  .modal-backdrop {
    padding: 8px !important;
  }

  .modal-dialog {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 94vh !important;
    border-radius: 14px !important;
    margin: 0 !important;
  }

  .modal-header {
    padding: 12px 14px !important;
  }

  .modal-icon-badge {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .modal-title {
    font-size: 14px !important;
    line-height: 1.2;
  }

  .modal-subtitle {
    font-size: 11px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .modal-body {
    padding: 12px !important;
    gap: 12px !important;
  }

  .paste-instructions-card {
    flex-direction: column !important;
  }

  .pi-col {
    padding: 10px 12px !important;
    width: 100% !important;
  }

  .pi-divider {
    width: 100% !important;
    border-left: none !important;
    border-right: none !important;
    border-top: 1px solid #30363d !important;
    border-bottom: 1px solid #30363d !important;
    padding: 4px 0 !important;
  }

  .pi-example {
    font-size: 11px !important;
    overflow-x: auto;
  }

  .sample-chips {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .chip {
    padding: 4px 8px !important;
    font-size: 11px !important;
  }

  .bulk-textarea {
    height: 120px !important;
    font-size: 13px !important;
    padding: 10px !important;
  }

  .bulk-options-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  #btnParseBulkData {
    width: 100% !important;
    padding: 10px !important;
  }

  .bulk-preview-table-wrapper {
    max-height: 180px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .bulk-preview-table {
    min-width: 580px;
  }

  .modal-footer {
    flex-direction: column-reverse !important;
    padding: 12px 14px !important;
    gap: 8px !important;
  }

  .modal-footer .btn {
    width: 100% !important;
    padding: 11px 16px !important;
  }
}

@media print {

  /* Hide all editor chrome and toolbars when printing */
  .no-print,
  .app-topbar,
  .editor-pane,
  .preview-toolbar,
  .modal-backdrop,
  .toast-container,
  .pdf-page-gap {
    display: none !important;
  }

  body,
  html {
    background: #ffffff !important;
    height: auto !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .main-layout,
  .preview-pane,
  .preview-viewport,
  #pdfPagesContainer {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    overflow: visible !important;
    transform: none !important;
  }

  .pdf-document-page {
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 6mm 10mm 6mm 10mm !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-after: always !important;
    break-after: page !important;
    transform: none !important;
  }

  .pdf-document-page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .settlement-table td,
  .settlement-table th {
    padding: 5px 8px !important;
  }

  .pdf-page-break-before {
    page-break-before: always !important;
    break-before: page !important;
  }

  @page {
    size: A4 landscape;
    margin: 6mm 6mm 6mm 6mm;
  }
}

/* ==========================================================================
   NEW: HERO CARD — 2-INPUT CONCEPT EXPLAINER
   ========================================================================== */
.hero-input-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #0f2d1f, #0a1f15);
  border: 1px solid #1a4731;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 4px;
}

.hero-card-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #0a7758, #076644);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #facc15;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(10, 119, 88, 0.5);
}

.hero-card-body h3 {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 2px;
}

.hero-card-body p {
  font-size: 12px;
  color: #94d3b5;
  line-height: 1.5;
}

/* ==========================================================================
   NEW: BULK CTA BUTTON (primary call-to-action in editor tab)
   ========================================================================== */
.bulk-cta-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  background: linear-gradient(135deg, #1a6b3a, #155e30);
  border: 1px solid rgba(63, 185, 80, 0.3);
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  box-shadow: 0 4px 15px rgba(35, 134, 54, 0.25);
  transition: all 0.2s;
}

.bulk-cta-btn:hover {
  background: linear-gradient(135deg, #238636, #1a6b3a);
  box-shadow: 0 6px 20px rgba(35, 134, 54, 0.4);
  transform: translateY(-1px);
}

.bulk-cta-btn span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bulk-cta-btn strong {
  font-size: 14px;
  font-weight: 700;
}

.bulk-cta-btn small {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
}

/* ==========================================================================
   NEW: SETTLEMENT RATE DISPLAY (Payable % / Waived Off %)
   ========================================================================== */
.rate-display-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 6px;
}

.rate-box {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rate-box.rate-payable {
  background: rgba(63, 185, 80, 0.08);
  border: 1px solid rgba(63, 185, 80, 0.25);
}

.rate-box.rate-waived {
  background: rgba(248, 81, 73, 0.08);
  border: 1px solid rgba(248, 81, 73, 0.25);
}

.rate-big-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.rate-box.rate-payable .rate-big-label {
  color: #3fb950;
}

.rate-box.rate-waived .rate-big-label {
  color: #f85149;
}

.rate-input-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rate-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #ffffff;
  font-family: var(--font-base);
  font-size: 22px;
  font-weight: 800;
  padding: 4px 8px;
  line-height: 1.2;
  transition: border-color 0.15s;
}

.rate-input:focus {
  outline: none;
  border-color: #3fb950;
}

.rate-input.rate-readonly {
  background: rgba(0, 0, 0, 0.15);
  color: var(--text-dim);
  cursor: not-allowed;
}

.rate-pct {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dim);
}

.rate-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-dim);
  font-size: 16px;
  padding-top: 8px;
}

/* ==========================================================================
   NEW: PASTE INSTRUCTIONS CARD IN BULK MODAL
   ========================================================================== */
.paste-instructions-card {
  display: flex;
  align-items: flex-start;
  gap: 0;
  background: #1c2128;
  border: 1px solid #30363d;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.pi-col {
  flex: 1;
  padding: 14px 16px;
}

.pi-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 6px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  border-left: 1px solid #30363d;
  border-right: 1px solid #30363d;
  min-width: 30px;
}

.pi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pi-example {
  display: block;
  font-size: 11.5px;
  line-height: 1.7;
  color: #e6edf3;
  background: transparent;
  white-space: pre;
}

.pi-calc-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  margin-top: 4px;
}

/* Small form control variant */
.form-control-sm {
  padding: 4px 8px;
  font-size: 12px;
}

/* Client Info Card & Grid */
.client-info-card {
  background: linear-gradient(145deg, #18202c, #131923);
  border: 1px solid #2b394e;
}

.client-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

/* Mobile Quick Download wrapper (hidden on desktop) */
.mobile-download-wrapper {
  display: none;
  margin-top: 14px;
  margin-bottom: 24px;
}

.w-100 {
  width: 100%;
}

.mb-2 {
  margin-bottom: 8px;
}

/* Mobile Nav Pills Base (hidden on desktop) */
.mobile-nav-pills {
  display: none;
}