.form-shell{max-width:none;width:100%;margin:0 auto 16px;background:#fff;border:1px solid #e4eaf3;border-radius:12px;box-shadow:0 8px 20px rgba(30,41,59,.05);overflow:hidden}
.form-intro{padding:10px 14px 8px;background:linear-gradient(110deg,#fbfcff,#f4f6ff);border-bottom:1px solid #e8edf5}
.form-intro h1{font-size:1.2rem;letter-spacing:-.02em;margin:2px 0}
.form-intro p{max-width:760px;color:#64748b;line-height:1.35;margin:0;font-size:13px}
.form-intro .customer-banner{margin-top:4px}
.finance-form{padding:12px 16px 14px}
.form-section{border:1px solid #e9eef5;border-radius:8px;padding:10px;background:#fff}
.form-section + .form-section{margin-top:8px}
.section-heading{display:flex;align-items:flex-start;gap:8px;margin-bottom:8px}
.section-heading>span{display:grid;place-items:center;flex:none;width:24px;height:24px;border-radius:7px;background:#e9edff;color:#4f46e5;font-size:11px;font-weight:800}
.section-heading h2{font-size:14px;margin:0}
.section-heading p{font-size:12px;color:#64748b;margin:2px 0 0}
.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px;width:100%}
.field-grid.dense-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.field-grid.dense-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.field-grid.dense-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.field-wrap{min-width:0;max-width:none;width:100%}
/* Address / long fields: half-width, not full row */
.field-wrap.wide{
  grid-column:span 1;
  max-width:none;
  width:100%;
}
.field-grid.dense-3 .field-wrap,
.field-grid.dense-4 .field-wrap{
  max-width:none;
  width:100%;
}
.field-grid.dense-3 .field-wrap.wide,
.field-grid.dense-4 .field-wrap.wide{
  grid-column:span 1;
  max-width:none;
  width:100%;
}
.guarantor-section .field-wrap{max-width:none;width:100%}
.guarantor-section .field-grid{gap:8px 12px;width:100%}
.field-wrap label{display:block;font-size:14px;color:#1e293b;font-weight:700;margin:0 0 4px}
.field-wrap label em{font-style:normal;color:#e11d48;margin-left:3px}
.field-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field-wrap select,.field-wrap textarea{width:100%;min-height:38px;border:1px solid #c5d0e0!important;border-radius:7px!important;padding:7px 11px!important;background:#fff;font-size:15px!important;line-height:1.35;box-shadow:none!important}
.field-wrap input[type="file"]{font-size:14px!important;padding:4px 0!important;min-height:auto!important;border:0!important}
.field-wrap textarea{min-height:56px;max-height:96px;resize:vertical}
.loan-preview{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 12px;margin-top:8px;width:100%}
.loan-preview>div{border:1px solid #e8edf5;border-radius:8px;padding:8px 10px;background:#f8fafc}
.loan-preview small{display:block;font-size:11px;color:#64748b;font-weight:700;text-transform:uppercase}
.loan-preview strong{display:block;margin-top:4px;font-size:16px}
.id-check-block{margin-top:6px;max-width:none;width:100%}
.id-check-block-title{font-size:13px;font-weight:700;display:block;margin-bottom:5px}
.id-check-block-title em{font-style:normal;color:#e11d48;margin-left:2px}
.id-check-grid,.id-check-list{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(155px,1fr));
  gap:6px;
  width:100%;
  justify-content:stretch;
}
.id-check-card,.id-check-row{
  display:flex;
  flex-direction:column;
  gap:4px;
  align-items:stretch;
  padding:6px 8px;
  border:1px solid #e2e8f0;
  border-radius:5px;
  background:#f8fafc;
  max-width:none;
  width:100%;
  min-width:0;
}
.id-check{font-size:12px;font-weight:600;display:flex;align-items:flex-start;gap:5px;margin:0;cursor:pointer;white-space:normal;line-height:1.25}
.id-check input[type="checkbox"]{
  width:14px!important;height:14px!important;min-height:14px!important;max-height:14px!important;
  padding:0!important;margin:2px 0 0!important;flex-shrink:0;accent-color:#4f46e5;cursor:pointer;
}
.id-check span{line-height:1.25;flex:1}
.id-num{
  min-height:28px!important;height:28px;padding:4px 8px!important;border:1px solid #c5d0e0;
  border-radius:4px;font-size:13px!important;width:100%;background:#fff;box-sizing:border-box
}
.id-check-card:has(input[type="checkbox"]:checked),.id-check-row:has(input[type="checkbox"]:checked){
  border-color:#93c5fd;background:#f0f7ff;box-shadow:0 0 0 2px rgba(37,99,235,.08)
}
.photo-field .photo-preview{margin-top:6px}
.photo-field .photo-preview img{width:64px;height:64px;object-fit:cover;border-radius:8px;border:1px solid #c5d0e0}
.customer-banner{display:flex;align-items:center;gap:12px;margin-top:6px;flex-wrap:wrap}
.customer-banner .ghost-button{margin-left:auto;flex-shrink:0}
.customer-photo{width:52px;height:52px;border-radius:50%;object-fit:cover;border:2px solid #c5d0e0;flex-shrink:0}
.customer-photo.placeholder{display:grid;place-items:center;background:#e0e7ff;color:#4338ca;font-weight:800;font-size:1.1rem}
.customer-banner p{margin:0;font-size:13px}
.customer-banner-name{font-size:1.75rem!important;font-weight:800;letter-spacing:-.02em;line-height:1.15;color:#0f172a}
.customer-banner-loan-time{margin-top:4px!important;font-size:1.05rem!important;font-weight:700;color:#334155}
.customer-banner-loan-time strong{font-weight:800;color:#1e293b}
.customer-banner small{color:#64748b;font-size:11px}
.guarantor-section{margin-top:8px}
.loan-shell .form-section{padding:8px 10px}
.loan-shell .form-section + .form-section{margin-top:6px}
.loan-shell .section-heading{margin-bottom:6px}
.loan-shell .field-help,.loan-shell .field-wrap .help{margin-top:2px;line-height:1.25}
.loan-shell .form-actions{margin-top:10px}
.field-wrap input::placeholder,
.field-wrap textarea::placeholder {
  color: #94a3b8;
  font-weight: 400;
}
.field-wrap input[type="checkbox"] {
  width: auto !important;
  min-height: auto !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.loan-option-card {
  margin-top: 10px;
  max-width: 420px;
  width: fit-content;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.loan-option-card:has(.loan-option-input:checked) {
  border-color: #93c5fd;
  background: #f8fbff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .08);
}
.loan-option-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin: 0;
  cursor: pointer;
}
.loan-option-label input[type="checkbox"],
.loan-option-label .loan-option-input {
  flex: 0 0 15px !important;
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  max-width: 15px !important;
  min-height: 15px !important;
  max-height: 15px !important;
  margin: 1px 0 0 !important;
  padding: 0 !important;
  accent-color: #2563eb;
  cursor: pointer;
}
.loan-option-copy {
  flex: 1;
  min-width: 0;
}
.loan-option-copy strong {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.35;
}
.loan-option-copy small {
  display: block;
  margin-top: 3px;
  font-size: .7rem;
  color: #64748b;
  line-height: 1.4;
}
.loan-option-error {
  display: block;
  padding: 0 12px 8px;
  font-size: .72rem;
}
@media (max-width: 640px) {
  .loan-option-card { max-width: 100%; width: 100%; }
}
.field-wrap input:focus,.field-wrap select:focus,.field-wrap textarea:focus{border-color:#6366f1!important;box-shadow:0 0 0 4px #e0e7ff!important}
.field-wrap .help{font-size:13px;color:#64748b;margin-top:6px}
.field-wrap .error{display:block;color:#b91c1c;font-size:13px;margin-top:6px}
.form-actions{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin-top:16px;flex-wrap:wrap}
.cancel-action{
  color:#64748b;text-decoration:none;font-size:.875rem;font-weight:600;
  padding:10px 16px;min-height:40px;background:transparent;border:0;cursor:pointer;
  border-radius:8px;transition:background .15s ease,color .15s ease;
}
.cancel-action:hover{background:#f1f5f9;color:#334155}
.finance-form .primary{
  border:1px solid #1e40af!important;
  padding:0 22px!important;
  min-height:42px!important;
  font-size:.9rem!important;
  border-radius:8px!important;
  background:#1d4ed8!important;
  box-shadow:0 1px 2px rgba(15,23,42,.06)!important;
  font-weight:600!important;
}
.finance-form .primary:hover{
  background:#1e3a8a!important;
  border-color:#1e3a8a!important;
  box-shadow:0 2px 4px rgba(15,23,42,.08)!important;
  transform:none!important;
}
.finance-form .primary span{font-size:.9em;margin-left:2px;opacity:.9}
.form-tip{margin-top:12px;display:flex;gap:10px;align-items:center;border-radius:10px;background:#edfdf4;color:#166534;padding:10px 12px;width:max-content}
.form-tip>span{display:grid;place-items:center;border-radius:50%;width:20px;height:20px;background:#22c55e;color:#fff;font-size:12px}
.form-tip b,.form-tip small{display:block;font-size:13px}
.form-tip small{color:#43815b;margin-top:2px}
.loan-snapshot{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:16px}
.loan-snapshot>div,.snapshot-card{border:1px solid #e8edf5;border-radius:12px;padding:14px 16px;background:#f8fafc}
.loan-snapshot small{display:block;font-size:12px;color:#64748b;font-weight:700;text-transform:uppercase;letter-spacing:.04em}
.loan-snapshot strong{display:block;margin-top:6px;font-size:20px;color:#0f172a}
.snapshot-overdue.is-zero strong{color:#94a3b8}
.snapshot-overdue-edit{display:flex;align-items:center;gap:4px;margin-top:6px}
.snapshot-currency{font-size:20px;font-weight:700;color:#0f172a;line-height:1}
.snapshot-input{
  width:100%;min-height:36px;border:1px solid #c5d0e0;border-radius:8px;padding:4px 8px;
  font-size:20px;font-weight:700;color:#0f172a;background:#fff;box-shadow:none;
}
.snapshot-input:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.12)}
.snapshot-hint{display:block;margin-top:6px;font-size:11px;font-weight:500;color:#64748b;text-transform:none;letter-spacing:0}
.collection-total-bar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:16px;padding:16px;border-radius:12px;background:linear-gradient(105deg,#ecfdf5,#f0fdf4);border:1px solid #bbf7d0}
.collection-total-bar small{display:block;font-size:12px;color:#166534;font-weight:700;text-transform:uppercase}
.collection-total-bar b{display:block;margin-top:6px;font-size:18px;color:#14532d}
.collection-total-bar div:last-child b{font-size:22px;color:#166534}
.guarantor-grid{display:grid;grid-template-columns:1fr;gap:10px!important;margin-top:10px}
.guarantor-grid section{padding:12px!important;border:1px solid #e9eef5;border-radius:10px!important;background:#fff}
.loan-shell .field-wrap-date input[type="date"],
.loan-shell #id_loan_date{
  min-width:0;
  width:100%;
  padding:7px 11px;
  font-size:15px;
}
.compact-form .form-intro{padding:12px 16px 10px}
.compact-form .finance-form{padding:12px 16px 14px}
@media(max-width:900px){
  .field-grid.dense-3,.field-grid.dense-4,.loan-preview{grid-template-columns:repeat(2,minmax(0,1fr))}
  .id-check-grid,.id-check-list{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}
  .id-check-row{grid-template-columns:1fr}
}

/* Backup / data management */
.data-shell{max-width:1120px;margin:0 auto 36px}
.data-hero{padding:28px 32px;border-radius:16px;background:linear-gradient(120deg,#0f172a,#1e293b 55%,#312e81);color:#fff;margin-bottom:20px;border:1px solid #1e293b}
.data-hero .eyebrow{display:inline-block;font-size:12px;font-weight:800;letter-spacing:.14em;color:#a5b4fc;margin-bottom:8px}
.data-hero h1{margin:0 0 8px;font-size:28px;letter-spacing:-.03em}
.data-hero p{margin:0;color:#cbd5e1;font-size:15px;max-width:640px;line-height:1.5}
.data-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:20px}
.data-stat{background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:16px 18px;box-shadow:0 8px 20px rgba(15,23,42,.04)}
.data-stat small{display:block;font-size:12px;font-weight:800;color:#64748b;text-transform:uppercase;letter-spacing:.04em}
.data-stat strong{display:block;margin-top:8px;font-size:15px;color:#0f172a;word-break:break-all;line-height:1.4}
.data-stat.accent strong{font-size:26px;color:#4f46e5}
.data-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.data-card{background:#fff;border:1px solid #e2e8f0;border-radius:16px;padding:22px;box-shadow:0 10px 24px rgba(15,23,42,.04);display:flex;flex-direction:column;min-height:100%}
.data-card h2{margin:0 0 8px;font-size:20px}
.data-card p{margin:0 0 16px;color:#64748b;font-size:14px;line-height:1.5;flex:1}
.data-card label{display:block;font-size:14px;font-weight:700;color:#1e293b;margin:0 0 8px}
.data-card input,.data-card select{width:100%;min-height:48px;border:1px solid #c5d0e0;border-radius:10px;padding:12px 14px;font-size:16px;margin-bottom:14px;background:#fff}
.data-card .primary{width:100%;margin-top:auto;padding:13px 16px;font-size:15px;border:0;border-radius:10px}
.data-card.danger{border-color:#fecaca;background:linear-gradient(180deg,#fff,#fff5f5)}
.data-card.danger h2{color:#b91c1c}
.data-card.safe{border-color:#bbf7d0;background:linear-gradient(180deg,#fff,#f0fdf4)}
.data-backups{margin-top:20px;background:#fff;border:1px solid #e2e8f0;border-radius:16px;overflow:hidden;box-shadow:0 10px 24px rgba(15,23,42,.04)}
.data-backups .panel-head{padding:18px 22px;border-bottom:1px solid #eef2f7}
.data-backups h2{margin:0;font-size:18px}
.data-backups table{width:100%;border-collapse:collapse;font-size:15px}
.data-backups th,.data-backups td{padding:6px 14px;text-align:left;border-bottom:1px solid #f1f5f9}
.data-backups th{padding:4px 14px;font-size:.62rem;letter-spacing:.03em;line-height:1.2}
.data-backups th{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:#64748b;background:#f8fafc}
.data-empty{padding:28px 22px;color:#64748b;font-size:15px}

@media(max-width:900px){
  .data-stats,.data-actions{grid-template-columns:1fr}
}
@media(max-width:600px){
  .id-check-grid,.id-check-list{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  .form-intro,.finance-form{padding:18px 16px}
  .field-grid,.guarantor-grid,.loan-snapshot,.collection-total-bar{grid-template-columns:1fr 1fr}
  .collection-total-bar{grid-template-columns:1fr 1fr}
  .field-wrap.wide{grid-column:auto}
  .form-actions{justify-content:space-between}
  .form-tip{width:100%}
}

/* Daily / Weekly / Monthly loan dashboard table only */
.dashboard-entries-panel .loan-register-table { font-size: 13px; }
.dashboard-entries-panel .loan-register-table th,
.dashboard-entries-panel .loan-register-table td {
  padding: 5px 8px !important;
  line-height: 1.25;
}
.dashboard-entries-panel .loan-register-table th {
  white-space: nowrap;
  font-size: 10px !important;
  letter-spacing: .03em;
  padding: 4px 8px !important;
  line-height: 1.2 !important;
}
.dashboard-entries-panel .loan-register-table td { font-size: 13px !important; }
.dashboard-entries-panel .loan-register-table .entry-cell { white-space: nowrap; width: 1%; }
.dashboard-entries-panel .loan-register-table a.primary,
.dashboard-entries-panel .loan-register-table a.primary.sm,
.dashboard-entries-panel .loan-register-table .ghost-button.sm {
  min-height: 30px !important;
  padding: 0 11px !important;
  font-size: 12px !important;
}
.dashboard-entries-panel .loan-register-table .status-pill { font-size: 10px; padding: 2px 8px; }
.dashboard-entries-panel .loan-register-table tfoot td {
  background: #f8fafc;
  border-top: 2px solid #e2e8f0;
  font-weight: 700;
  font-size: 13px !important;
  padding: 8px 11px !important;
}
.dashboard-entries-panel .loan-register-table tfoot .totals-label { color: #475569; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
.dashboard-entries-panel .loan-register-table .num { text-align: right; white-space: nowrap; }
.dashboard-entries-panel .loan-register-table .loan-number-link { font-size: inherit; }
.dashboard-entries-panel .panel-head h2,
.pending-alert-panel .panel-head h2 { font-size: .85rem !important; }
.dashboard-entries-panel .panel-head p,
.pending-alert-panel .panel-head p { font-size: .72rem !important; }
.dashboard-page-head{
  align-items:center;
  gap:12px;
  margin-bottom:6px;
  flex-wrap:nowrap;
}
.dashboard-head-left{
  flex:0 0 auto;
  min-width:140px;
}
.dashboard-head-left h1{
  margin:0;
  font-size:1rem!important;
  line-height:1.2;
}
.dashboard-head-meta{
  margin:2px 0 0;
  font-size:.68rem;
  color:#64748b;
}
.dashboard-top-search{
  flex:1 1 auto;
  min-width:0;
  margin:0;
  display:flex;
  justify-content:center;
}
.dashboard-top-search input{
  min-height:38px;
  padding:8px 14px;
  font-size:.84rem;
  width:min(520px,100%);
  border:1px solid #cbd5e1;
  border-radius:8px;
}
.dashboard-head-actions{
  flex:0 0 auto;
  gap:8px;
  align-items:center;
}
.dashboard-head-actions .dashboard-view-tabs,
.dashboard-head-actions .view-tabs{
  gap:6px;
}
.dashboard-head-actions .dashboard-head-btn,
.dashboard-head-actions .view-tabs a,
.dashboard-head-actions .view-tab-btn{
  min-height:38px !important;
  padding:0 16px !important;
  font-size:.84rem !important;
  border-radius:8px !important;
  font-weight:600;
}
.dashboard-head-actions .dashboard-head-btn.active,
.dashboard-head-actions .view-tabs a.active{
  background:#eff6ff !important;
  border-color:#93c5fd !important;
  color:#1d4ed8 !important;
}
.dashboard-head-actions .dashboard-head-btn.active:hover,
.dashboard-head-actions .view-tabs a.active:hover,
.dashboard-head-actions .dashboard-head-btn:hover,
.dashboard-head-actions .view-tabs a:hover,
.dashboard-head-actions .view-tab-btn:hover{
  background:#f8fafc;
  border-color:#cbd5e1;
  color:#334155;
}
.dashboard-head-actions .dashboard-head-btn.active:hover,
.dashboard-head-actions .view-tabs a.active:hover{
  background:#dbeafe !important;
  border-color:#60a5fa !important;
  color:#1e40af !important;
}
.dashboard-head-actions .dashboard-new-loan-btn,
.dashboard-head-actions .primary.dashboard-head-btn{
  background:#1d4ed8 !important;
  border-color:#1e40af !important;
  color:#fff !important;
}
.dashboard-head-actions .dashboard-new-loan-btn:hover,
.dashboard-head-actions .primary.dashboard-head-btn:hover{
  background:#1e3a8a !important;
  border-color:#1e3a8a !important;
  color:#fff !important;
}
.dashboard-entries-panel{
  margin-top:0;
}
.compact-panel.dashboard-entries-panel .panel-head.tight{
  display:none;
}

/* Beat redesign.css .panel td padding on finance dashboards */
.compact-panel.dashboard-entries-panel .loan-register-table th {
  font-size: 10px !important;
  letter-spacing: .03em !important;
  line-height: 1.2 !important;
}
.compact-panel.dashboard-entries-panel .loan-register-table td {
  font-size: 13px !important;
}
.compact-panel.dashboard-entries-panel .loan-register-table th {
  padding: 4px 8px !important;
}
.compact-panel.dashboard-entries-panel .loan-register-table td {
  padding: 5px 8px !important;
}
.compact-panel.dashboard-entries-panel .panel-head.tight {
  padding: 8px 11px !important;
}

/* Entry schedule page table only */
.entry-schedule-page .entry-schedule-table { font-size: 13px; }
.entry-schedule-page .entry-schedule-table th,
.entry-schedule-page .entry-schedule-table td {
  padding: 4px 8px !important;
  line-height: 1.25;
}
.entry-schedule-page .entry-schedule-table th {
  font-size: 10px !important;
  letter-spacing: .03em !important;
  line-height: 1.2 !important;
  padding: 4px 8px !important;
}
.entry-schedule-page .entry-schedule-table td { font-size: 13px !important; }
.entry-schedule-page .entry-schedule-table tfoot td { font-size: 13px !important; font-weight: 700; }
@media (max-width: 900px){
  .dashboard-page-head{flex-wrap:wrap}
  .dashboard-top-search{order:3;flex-basis:100%;justify-content:stretch}
  .dashboard-top-search input{width:100%}
}
.pending-alert-panel .panel-head.tight { padding: 8px 11px !important; }
.page-head .eyebrow { font-size: .56rem !important; letter-spacing: .12em; }
.status-pill{display:inline-block;padding:3px 10px;border-radius:999px;font-size:10px;font-weight:800;letter-spacing:.04em}
.status-pill.status-active{background:#fef2f2;color:#dc2626}
.status-pill.status-closed{background:#f1f5f9;color:#64748b}
.status-pill.status-pending{background:#eff6ff;color:#2563eb}
.status-pill.status-overdue{background:#fee2e2;color:#991b1b}
.row-defaulter{background:#fff7f7}
.defaulter-cell{text-align:center;white-space:nowrap}
.defaulter-toggle-form{display:inline-block;margin:0}
.toggle-switch{position:relative;display:inline-block;width:42px;height:24px;cursor:pointer}
.toggle-switch input{opacity:0;width:0;height:0;position:absolute}
.toggle-slider{
  position:absolute;inset:0;background:#cbd5e1;border-radius:999px;transition:background .2s
}
.toggle-slider::before{
  content:'';position:absolute;width:18px;height:18px;left:3px;top:3px;background:#fff;border-radius:50%;
  transition:transform .2s;box-shadow:0 1px 3px rgba(0,0,0,.15)
}
.toggle-switch input:checked + .toggle-slider{background:#ef4444}
.toggle-switch input:checked + .toggle-slider::before{transform:translateX(18px)}
.toggle-switch input:focus-visible + .toggle-slider{outline:2px solid #93c5fd;outline-offset:2px}

/* Entry record page — balanced compact (readable, minimal scroll) */
.entry-record-page{
  width:100%;max-width:none;margin:0;background:#fff;border:1px solid #e2e8f0;
  border-radius:11px;padding:10px 14px 10px;box-shadow:var(--sh-xs,0 1px 2px rgba(15,23,42,.05))
}
body.no-topbar .page.compact-page:has(.entry-record-page){padding:6px 10px 8px}
.entry-record-page .cp-header{
  display:flex;flex-wrap:nowrap;align-items:center;gap:10px 12px;
  margin-bottom:8px;padding-bottom:0
}
.entry-record-page .cp-header-left{flex:1 1 auto;min-width:0}
.entry-record-page .cp-header-actions{flex:0 0 auto;margin:0;align-self:center}
.entry-record-page .cp-header-stats{
  display:flex;gap:6px;flex-wrap:nowrap;margin:0;justify-content:flex-end;
  flex:0 0 auto!important;width:auto!important
}
.entry-record-page .cp-title{margin:0;font-size:1.2rem;line-height:1.15}
.entry-record-page .cp-sub{
  margin:3px 0 0;font-size:.95rem;line-height:1.3;
  display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 6px;color:#475569
}
.entry-record-page .cp-sub .loan-number{
  font-size:1.15rem!important;font-weight:800;letter-spacing:-.02em
}
.entry-record-page .cp-sub .customer-name-display{
  font-size:1.15rem;font-weight:800;color:#0f172a;letter-spacing:-.02em
}
.entry-record-page .cp-sub .customer-mobile-display{
  font-size:.95rem;font-weight:650;color:#334155
}
.entry-record-page .cp-sub-sep{color:#94a3b8;font-weight:600}
.entry-record-page .cp-stat{padding:5px 9px;min-width:72px;border-radius:8px}
.entry-record-page .cp-stat span{font-size:8px;letter-spacing:.05em}
.entry-record-page .cp-stat strong{margin-top:2px;font-size:1rem}
.entry-record-page .cp-stat-remaining strong{font-size:1.05rem}
.entry-record-page .cp-panel{padding:10px 12px;margin-bottom:8px;border-radius:9px}
.entry-record-page .cp-panel-title{margin:0 0 6px;font-size:.88rem}
.entry-record-page .cp-payment-row,
.entry-record-page .cp-payment-row-4,
.entry-record-page .cp-payment-row-5,
.entry-record-page .cp-payment-row-6{
  display:flex;flex-wrap:wrap;align-items:end;gap:12px 14px;
  grid-template-columns:none
}
.entry-record-page .cp-entry-panel .cp-field{
  flex:0 0 auto;width:132px;max-width:132px
}
.entry-record-page .cp-entry-panel .cp-field:first-child{width:148px;max-width:148px}
.entry-record-page .cp-entry-panel .cp-field-combined-entry{width:170px;max-width:170px}
.entry-record-page .cp-field-head{min-height:0;margin-bottom:4px}
.entry-record-page .cp-field label{font-size:12px!important}
.entry-record-page .cp-field-hint{display:none}
.entry-record-page .cp-field input:not([type="checkbox"]),
.entry-record-page .cp-field select{
  width:100%;min-height:36px;padding:6px 10px;font-size:14px;border-radius:7px
}
.entry-record-page .cp-entry-panel .cp-field input:not([type="checkbox"]),
.entry-record-page .cp-entry-panel .cp-field select{min-height:38px}
.entry-record-page .highlight-due-field input,
.entry-record-page .highlight-due-field #id_due_amount,
.entry-record-page .cp-combined-input{font-size:14px!important}
.entry-record-page .cp-loan-grid{gap:8px 14px}
.entry-record-page .cp-loan-grid>div span{font-size:9px;margin:0}
.entry-record-page .cp-loan-grid>div strong{font-size:13px!important;margin-top:2px}
.entry-record-page .cp-record-total-row{
  display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px 14px;
  margin-top:12px
}
.entry-record-page .cp-record-total{
  margin:0;padding:10px 16px;border-radius:9px;
  display:inline-flex;flex-direction:row;align-items:center;justify-content:center;
  gap:10px;width:auto;max-width:100%;text-align:left;
  background:#86efac;color:#14532d;border:1px solid #4ade80
}
.entry-record-page .cp-record-total-label{
  display:inline-flex;flex-direction:row;align-items:baseline;gap:6px;flex-wrap:wrap
}
.entry-record-page .cp-record-total-label span{font-size:12px}
.entry-record-page .cp-record-total-label small{margin-top:0;font-size:11px}
.entry-record-page .cp-record-total strong{font-size:1.5rem!important}
.entry-record-page .cp-record-actions{
  display:inline-flex;align-items:center;gap:10px
}
.entry-record-page .cp-btn-enter{
  min-height:52px!important;font-size:1.15rem!important;padding:0 32px!important;
  font-weight:800;border-radius:10px;min-width:140px
}
.entry-record-page .cp-footer{display:none}
.entry-record-page .cp-btn-sm{min-height:36px!important;font-size:13px!important;padding:0 16px!important}
.entry-record-page .cp-btn-statement.cp-btn-sm{min-height:34px!important;padding:0 12px!important;font-size:12px!important}
.entry-record-page .cp-panel-head-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:6px}
.entry-record-page .cp-panel-head-row .cp-panel-title{margin:0}
.entry-record-page .cp-panel-meta{font-size:11px;font-weight:600;color:#64748b}
.entry-record-page .cp-entry-history-panel{margin-top:8px;margin-bottom:0}
.entry-record-page .cp-entry-history-scroll{max-height:220px;overflow:auto;border:1px solid #e2e8f0;border-radius:8px}
.entry-record-page .cp-entry-history-table{font-size:.82rem;margin:0}
.entry-record-page .cp-entry-history-table th,
.entry-record-page .cp-entry-history-table td{padding:4px 7px!important;white-space:nowrap}
.entry-record-page .cp-entry-history-table th{font-size:.62rem!important;letter-spacing:.03em;line-height:1.2;padding:3px 7px!important}
.entry-record-page .cp-entry-delete-cell{text-align:right}
.entry-record-page .cp-entry-delete-cell .ghost-button{min-height:28px;padding:0 8px;font-size:11px}

.collect-page-panel{width:100%;max-width:none;margin:0;padding:0;background:transparent;border:0;box-shadow:none}
.cp-sub{margin:6px 0 0;font-size:13px;color:#64748b;font-weight:500}
.cp-due-reason-row{margin-top:12px}
.cp-due-reason-row .cp-field.wide{max-width:480px}
.cp-entry-panel .cp-field input:not([type="checkbox"]),.cp-entry-panel .cp-field select{min-height:38px}

/* Collect payment modal — embed fallback */
.collection-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:20px}
.collection-modal[hidden]{display:none!important}
.collection-modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.45)}
.collection-modal-dialog{position:relative;width:min(920px,96vw);max-height:92vh;background:#fff;border-radius:14px;box-shadow:0 24px 60px rgba(15,23,42,.22);overflow:hidden;display:flex;flex-direction:column}
.collection-modal-iframe{width:100%;height:min(720px,88vh);border:0;display:block;background:#fff}
body.modal-open{overflow:hidden}

.collect-payment-modal{background:#fff;padding:20px 24px 18px;font-family:inherit}
.collect-payment-modal.is-embed{padding:18px 22px 16px}
.cp-header{display:flex;align-items:center;gap:12px;margin-bottom:10px;position:relative;padding-right:0;flex-wrap:wrap;width:100%}
.cp-header-left{flex:1 1 220px;min-width:0}
.cp-header-actions{flex:0 0 auto;display:flex;align-items:center;gap:8px}
.cp-header-stats{display:flex;gap:8px;flex-wrap:nowrap;margin-left:auto;align-items:center;flex:0 0 auto;justify-content:flex-end}
.cp-eyebrow{display:block;font-size:11px;font-weight:800;letter-spacing:.12em;color:#92400e;margin-bottom:4px}
.cp-title{margin:0;font-size:1.65rem;font-weight:700;color:#0f172a;letter-spacing:-.02em}
.cp-stat{border:1px solid #e2e8f0;border-radius:10px;padding:10px 14px;background:#f8fafc;min-width:110px;text-align:center}
.cp-stat span{display:block;font-size:9px;font-weight:800;color:#64748b;letter-spacing:.06em}
.cp-stat strong{display:block;margin-top:5px;font-size:1.25rem;font-weight:700;color:#0f172a}
.cp-stat-total{border-color:#bfdbfe;background:#eff6ff}
.cp-stat-total strong{color:#1d4ed8}
.cp-stat-paid{border-color:#a7f3d0;background:#ecfdf5}
.cp-stat-paid strong{color:#065f46}
.cp-stat-remaining{border-color:#fecaca;background:#fef2f2}
.cp-stat-remaining span{color:#991b1b}
.cp-stat-remaining strong{color:#991b1b;font-size:1.35rem;font-weight:800}
.cp-close-x{position:absolute;top:0;right:0;width:32px;height:32px;border:0;background:transparent;font-size:1.5rem;line-height:1;color:#64748b;cursor:pointer;border-radius:8px}
.cp-close-x:hover{background:#f1f5f9;color:#0f172a}

.cp-panel{border:1px solid #e2e8f0;border-radius:10px;padding:14px 16px;margin-bottom:12px;background:#fff}
.cp-panel-title{margin:0 0 12px;font-size:0.95rem;font-weight:700;color:#0f172a}
.cp-payment-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-items:end}
.cp-payment-row-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.cp-payment-row-5{grid-template-columns:repeat(5,minmax(0,1fr))}
.cp-payment-row-6{grid-template-columns:repeat(6,minmax(0,1fr))}
.entry-record-page .cp-monthly-payment-row{margin-bottom:12px}
.entry-record-page .cp-monthly-payment-row select{
  width:100%;min-width:0;font-size:14px;padding:8px 12px
}
.cp-field{display:flex;flex-direction:column;min-width:0}
.cp-field-head{min-height:42px;display:flex;flex-direction:column;justify-content:flex-end;margin-bottom:6px}
.cp-field label{display:block;font-size:12px;font-weight:600;color:#334155;line-height:1.25;margin:0}
.cp-field-hint{display:block;font-size:10px;font-weight:500;color:#64748b;line-height:1.25;margin-top:3px}
.cp-field input:not([type="checkbox"]),.cp-field select{
  width:100%;min-height:38px;border:1px solid #cbd5e1;border-radius:8px;padding:8px 10px;font-size:14px;background:#fff;box-sizing:border-box
}
.cp-readonly{background:#f1f5f9!important;color:#475569;cursor:not-allowed}
.cp-emi-row{margin-top:12px;display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.cp-emi-check{
  display:inline-flex;align-items:center;gap:10px;padding:10px 14px;border-radius:10px;
  background:linear-gradient(135deg,#fef9c3,#fef08a);border:2px solid #eab308;font-weight:700;font-size:13px;cursor:pointer
}
.cp-emi-check.is-active{box-shadow:0 0 0 3px rgba(234,179,8,.35)}
.cp-emi-check input{width:18px;height:18px;accent-color:#ca8a04;margin:0}
.cp-due-reason{flex:1;min-width:200px}
.cp-due-reason label{display:block;font-size:11px;font-weight:600;margin-bottom:4px}
.cp-due-reason input{width:100%;min-height:36px;border:1px solid #cbd5e1;border-radius:8px;padding:6px 10px}

.cp-loan-panel{background:#faf8f5;border-color:#ebe4d8}
.cp-loan-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px 20px}
.cp-loan-grid>div span{display:block;font-size:10px;font-weight:700;color:#78716c;text-transform:uppercase;letter-spacing:.04em}
.cp-loan-grid>div strong{display:block;margin-top:4px;font-size:14px;font-weight:600;color:#0f172a}
.cp-record-total{
  display:inline-flex;flex-direction:row;align-items:center;justify-content:center;text-align:left;gap:12px;
  margin-top:14px;margin-inline:auto;padding:12px 18px;border-radius:10px;
  background:#86efac;color:#14532d;border:1px solid #4ade80;
  width:fit-content;max-width:100%
}
.cp-record-total-label{display:inline-flex;flex-direction:row;align-items:baseline;gap:8px;flex-wrap:wrap}
.cp-record-total-label span{display:inline;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;opacity:.95;white-space:nowrap;color:#14532d}
.cp-record-total-label small{display:inline;margin-top:0;font-size:11px;font-weight:500;opacity:.9;white-space:nowrap;color:#166534}
.cp-record-total strong{font-size:1.5rem;font-weight:800;letter-spacing:.02em;line-height:1;white-space:nowrap;color:#14532d}
.cp-loan-summary{grid-column:1/-1;padding-top:8px;border-top:1px dashed #e7dfd3}
.cp-loan-summary strong{font-size:15px;color:#0d4f4f}
.cp-loan-total{
  display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-top:14px;padding-top:14px;
  border-top:2px solid #e7e0d5;background:#f5f0e8;border-radius:8px;padding:12px 14px
}
.cp-loan-total-item span{display:block;font-size:10px;font-weight:700;color:#78716c;text-transform:uppercase;letter-spacing:.04em}
.cp-loan-total-item strong{display:block;margin-top:4px;font-size:15px;font-weight:700;color:#0f172a}
.cp-loan-total-sum strong{color:#0d4f4f;font-size:1.1rem}
.cp-total-hint{display:block;margin-top:4px;font-size:9px;font-weight:500;color:#78716c;text-transform:none;letter-spacing:0}

.cp-extra{margin-bottom:14px;font-size:13px;color:#64748b}
.cp-extra summary{cursor:pointer;font-weight:600;padding:6px 0}
.cp-extra-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:8px}

.cp-footer{display:flex;justify-content:flex-end;gap:10px;padding-top:8px;margin-top:4px;border-top:1px solid #f1f5f9}
.cp-btn{min-height:40px;padding:0 22px;border-radius:8px;font-size:14px;font-weight:700;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}
.cp-btn-close{background:#fff;border:1px solid #cbd5e1;color:#0f172a}
.cp-btn-close:hover{background:#f8fafc}
.cp-btn-collect{background:#0d4f4f;border:1px solid #0d4f4f;color:#fff}
.cp-btn-collect:hover{background:#0a3d3d}
.cp-btn-statement{background:#1d4ed8;border:1px solid #1e40af;color:#fff}
.cp-btn-statement:hover{background:#1e3a8a}
.cp-header-actions{display:flex;align-items:flex-start;gap:8px;margin-left:auto}
.highlight-due-field input,
.highlight-due-field #id_due_amount{
  background:linear-gradient(135deg,#fef2f2,#fee2e2)!important;
  border:2px solid #b91c1c!important;
  color:#991b1b!important;
  font-weight:800!important;
  font-size:15px!important;
}
.highlight-due-field label{color:#991b1b!important;font-weight:800!important}
.cp-combined-input,
.cp-combined-display{
  background:linear-gradient(135deg,#ecfdf5,#d1fae5)!important;
  border:2px solid #047857!important;
  color:#065f46!important;
  font-weight:800!important;
  font-size:15px!important;
}
.cp-field-past input,.cp-field-today input{font-weight:650}
.cp-field label{font-size:13px!important}
.cp-field-hint{font-size:11px!important}
.cp-loan-grid>div strong{font-size:15px!important}
.cp-record-total strong{font-size:1.5rem!important}
.cp-btn{font-size:15px!important;min-height:42px!important}

@media(max-width:800px){
  .entry-record-page .cp-header{flex-wrap:wrap;gap:8px}
  .entry-record-page .cp-header-stats{order:3;width:100%;justify-content:flex-start}
  .entry-record-page .cp-header-actions{order:2}
  .cp-payment-row,.cp-payment-row-4,.cp-payment-row-5,.cp-payment-row-6,.cp-loan-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cp-loan-total{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cp-record-total strong{font-size:1.75rem}
  .cp-header{flex-wrap:wrap}
  .cp-header-stats{margin-left:0}
}
.customer-full-table{font-size:12px}
.customer-full-table td{vertical-align:top}
.entry-search-table.customer-full-table{font-size:.9rem}
.ghost-button.danger,.ghost-button.sm.danger{color:#b91c1c;border-color:#fca5a5}
.ghost-button.warn{color:#b45309;border-color:#fcd34d}
