:root {
  --primary: #0f2b5c;
  --secondary: #1a4480;
  --gold: #d4af37;
  --light: #f8fafc;
  --dark: #1e293b;
  --border: #e2e8f0;
  --muted: #64748b;
  --label: #475569;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: var(--light);
  margin: 0;
  padding: 20px;
  color: var(--dark);
}

body.login-page {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-shell {
  max-width: 1400px;
  margin: 0 auto;
}

/* —— Login —— */
.login-container {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-container h2 {
  color: #1e3c72;
  margin: 0 0 5px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 25px;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.login-form .input-group {
  margin-bottom: 20px;
  text-align: left;
}

.login-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--label);
}

.login-form input {
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 16px;
}

.login-btn {
  width: 100%;
  padding: 12px;
  background: #1e3c72;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.login-btn:hover {
  background: #2a5298;
}

/* —— Site header —— */
.site-header {
  background: white;
  padding: 20px 30px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(15, 43, 92, 0.08);
  margin-bottom: 25px;
  border-left: 5px solid var(--gold);
  flex-wrap: wrap;
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-box {
  position: relative;
  width: 55px;
  height: 55px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(15, 43, 92, 0.3);
  border: 2px solid var(--gold);
}

.logo-shield {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  text-shadow: 1px 2px 0 var(--gold);
}

.logo-reg {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 8px;
  color: var(--gold);
  font-weight: bold;
}

.brand-info h1 {
  margin: 0;
  color: var(--primary);
  font-size: 26px;
  font-weight: 700;
}

.brand-info p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.header-user {
  color: var(--label);
  font-weight: 600;
}

.header-logout {
  color: var(--secondary);
  font-weight: 700;
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--gold);
  border-radius: 8px;
}

.header-logout:hover {
  background: var(--gold);
  color: #fff;
}

.header-create-loan {
  font: inherit;
  cursor: pointer;
  color: #fff;
  font-weight: 700;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #1a4a8a);
  box-shadow: 0 2px 8px rgba(15, 43, 92, 0.2);
}

.header-create-loan:hover {
  filter: brightness(1.06);
}

.header-overdue {
  font: inherit;
  cursor: pointer;
  color: var(--primary);
  font-weight: 700;
  padding: 8px 16px;
  border: 2px solid #b91c1c;
  border-radius: 8px;
  background: #fff;
}

.header-overdue:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--secondary);
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}

.back-link:hover {
  text-decoration: underline;
}

/* —— Layout —— */
.main-container {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 25px;
  margin-bottom: 25px;
}

.main-container--full {
  grid-template-columns: 1fr;
}

.card-table--expanded {
  width: 100%;
}

.card {
  background: white;
  padding: 25px;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
}

.card-title {
  margin: 0 0 18px;
  color: var(--primary);
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 12px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f1f5f9;
}

.card-title-bar .card-title {
  margin: 0;
  padding-bottom: 0;
  border-bottom: none;
  flex: 1 1 220px;
}

.table-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: flex-end;
}

.prefix-filters,
.due-day-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.prefix-filters {
  border-left: 3px solid var(--primary);
}

.due-day-filters {
  border-left: 3px solid var(--gold);
}

.prefix-filter-btn,
.due-day-btn {
  font: inherit;
  cursor: pointer;
  min-width: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--label);
  font-weight: 700;
  font-size: 14px;
}

.prefix-filter-btn:hover,
.due-day-btn:hover {
  border-color: var(--gold);
  color: var(--primary);
}

.prefix-filter-btn.is-active,
.due-day-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.collection-view-caption {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.collection-emi-cell {
  vertical-align: top;
}

.collection-emi-total {
  display: block;
  font-weight: 700;
}

.collection-emi-meta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.collection-outstanding-total {
  display: block;
  font-weight: 600;
}

.ledger-paid-cell {
  vertical-align: top;
}

.ledger-paid-ratio {
  display: block;
  font-weight: 600;
}

.ledger-overdue-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #b91c1c;
  line-height: 1.3;
}

.data-table tfoot.data-table-foot-total td,
.data-table tfoot .data-table-foot-total td {
  border-top: 2px solid var(--border);
  background: #f8fafc;
  font-weight: 700;
}

.ledger-foot-count {
  font-weight: 600;
  color: var(--muted);
}

.data-table-serial-head,
.data-table-serial {
  width: 3.25rem;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.data-table-serial {
  font-weight: 600;
}

.is-hidden {
  display: none !important;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-badge--paid {
  background: #dcfce7;
  color: #166534;
}

.status-badge--pending {
  background: #fef9c3;
  color: #854d0e;
}

.status-badge--overdue {
  background: #fee2e2;
  color: #991b1b;
}

.edit-card {
  max-width: 560px;
}

/* —— Forms —— */
.form-group {
  margin-bottom: 18px;
}

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

.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.field-error {
  margin: 6px 0 0;
  font-size: 12px;
  color: #c0392b;
  font-weight: 600;
  line-height: 1.4;
}

.form-group.has-error input,
.form-group.has-error select {
  border-color: #c0392b;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.15);
}

.form-banner-error {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fdecea;
  border: 1px solid #c0392b;
  color: #922b21;
  font-size: 13px;
  font-weight: 600;
}

.form-group.is-ok input {
  border-color: #27ae60;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--secondary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 68, 128, 0.15);
}

.form-group input[readonly] {
  background: #f1f5f9;
  color: var(--dark);
}

.id-group {
  display: flex;
  gap: 10px;
}

.id-group select {
  flex: 0 0 42%;
}

.id-group input {
  flex: 1;
  font-weight: 700;
  text-align: center;
}

.inline-custom-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.inline-custom-row > select {
  flex: 1 1 55%;
  min-width: 0;
}

.inline-custom-field {
  flex: 1 1 45%;
  min-width: 100px;
}

.inline-custom-field.is-hidden {
  display: none;
}

.inline-custom-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
}

.emi-preview-wrap.is-hidden {
  display: none;
}

.emi-preview-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--secondary);
}

.emi-preview-meta {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  padding: 13px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  width: 100%;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(15, 43, 92, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 43, 92, 0.3);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.form-actions .btn {
  flex: 1;
}

.form-actions .print-btn {
  flex: 0 0 auto;
  align-self: center;
}

/* —— Alerts —— */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

/* —— Tables —— */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background-color: #f1f5f9;
  color: var(--primary);
  font-weight: 700;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

.loan-list-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.print-btn {
  background: #fff;
  border: 1px solid var(--gold);
  color: var(--dark);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  font-family: inherit;
}

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

.print-btn-danger {
  color: #b91c1c;
  border-color: #fecaca;
}

.inline-form {
  display: inline;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

/* DataTables */
.card-table .dt-container {
  margin-top: 8px;
}

.card-table .dt-search input,
.card-table .dt-length select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

.card-table .dt-paging .dt-paging-button.current {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

/* —— Collection summary —— */
.collection-summary-section {
  margin-bottom: 24px;
}

.collection-summary-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.collection-summary-header .card-title {
  margin-bottom: 0;
  border: none;
  padding-bottom: 0;
}

.collection-month-form {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.collection-month-form label {
  font-weight: 600;
  color: var(--label);
}

.collection-month-form input[type='month'] {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.collection-pending-today {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
}

.collection-pending-today-amount {
  font-size: 22px;
  font-weight: 700;
  color: #b91c1c;
}

.collection-pending-today-label,
.collection-pending-today-meta {
  font-size: 13px;
  color: var(--label);
}

.collection-summary-sub {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.collection-amount {
  display: block;
  font-weight: 700;
  color: #b91c1c;
  font-size: 13px;
}

.collection-summary-table tfoot td {
  background: #f1f5f9;
  font-weight: 700;
}

.collection-pending-footnote {
  display: block;
  font-size: 11px;
  font-weight: normal;
  color: var(--muted);
}

/* —— Loan schedule page —— */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-box {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-box .label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.stat-box .value {
  font-size: 18px;
  color: var(--primary);
  font-weight: 700;
  margin-top: 4px;
}

.schedule-card h2 {
  margin: 0 0 8px;
  text-align: center;
  color: var(--primary);
  font-size: 20px;
}

.schedule-meta {
  text-align: center;
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
}

.schedule-card .card-title {
  justify-content: center;
  border: none;
}

.months-panel {
  background: #f1f5f9;
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.months-panel > label {
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
}

.months-panel-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
}

.months-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
}

.month-cell {
  min-width: 0;
}

.month-btn {
  width: 100%;
  padding: 10px 8px;
  border: 1px solid var(--secondary);
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.month-btn.is-paid {
  background: #15803d;
  color: #fff;
  border-color: #15803d;
}

.month-btn.is-paid.is-delayed {
  background: #b91c1c;
  border-color: #b91c1c;
}

.month-btn-form {
  margin: 0;
}

.badge-paid {
  color: #15803d;
  font-weight: 700;
}

.badge-paid-delayed {
  color: #b91c1c;
  font-weight: 700;
}

.badge-pending {
  color: var(--muted);
  font-weight: 600;
}

.data-table tr.row-delayed td {
  background: #fef2f2;
}

.schedule-print-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.schedule-print-actions .btn {
  width: auto;
  min-width: 140px;
}

.export-letterhead {
  background: #fff;
  padding: 16px 20px;
  border-radius: 14px;
  border-left: 5px solid var(--gold);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 4px 20px rgba(15, 43, 92, 0.08);
}

.export-letterhead .logo-area {
  justify-content: center;
  flex-wrap: wrap;
}

.export-letterhead .brand-info {
  text-align: center;
}

.export-letterhead .brand-info h1 {
  font-size: 22px;
}

.export-letterhead-subtitle {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  width: 100%;
  max-width: 720px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.export-letterhead-title {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--primary);
}

.export-letterhead-meta {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.export-letterhead .header-tagline {
  font-size: 13px;
  color: var(--muted);
}

.schedule-footnote {
  font-size: 13px;
  margin-top: 16px;
  color: var(--label);
  line-height: 1.5;
}

.loan-create-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.loan-create-dialog::backdrop {
  background: rgba(15, 43, 92, 0.45);
}

.loan-create-dialog-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}

.loan-create-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 12px;
  border-bottom: 2px solid #f1f5f9;
}

.loan-create-dialog-title {
  margin: 0;
  color: var(--primary);
  font-size: 18px;
}

.loan-create-dialog-close {
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0 4px;
}

.loan-create-dialog-close:hover {
  color: var(--primary);
}

.loan-create-dialog-body {
  padding: 8px 22px 4px;
  overflow-y: auto;
}

.loan-create-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

.loan-create-dialog-actions .btn {
  width: auto;
  padding: 10px 18px;
  font-size: 14px;
}

.overdue-dialog {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: none;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(15, 43, 92, 0.25);
}

.overdue-dialog::backdrop {
  background: rgba(15, 43, 92, 0.45);
}

.overdue-dialog-body {
  padding: 20px 24px 0;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.overdue-print-root {
  display: none;
}

body.overdue-print-document {
  margin: 0;
  padding: 12mm;
  background: #fff;
}

body.overdue-print-document .export-letterhead {
  margin-bottom: 12px;
  box-shadow: none;
}

body.overdue-print-document .overdue-defaulters-table {
  width: 100%;
  font-size: 11px;
}

body.overdue-print-document .overdue-dialog-table-wrap {
  overflow: visible !important;
}

@media print {
  body.overdue-print-document {
    padding: 0;
  }

  body.overdue-print-document .logo-box {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.overdue-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.overdue-dialog-title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--primary);
}

.overdue-dialog-meta {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.overdue-dialog-table-wrap {
  margin-bottom: 8px;
}

.overdue-dialog-empty {
  margin: 0 0 12px;
}

.overdue-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 0 0 12px 12px;
}

.emi-pay-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 360px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.emi-pay-dialog::backdrop {
  background: rgba(15, 43, 92, 0.4);
}

.emi-pay-dialog form {
  padding: 22px;
}

.emi-pay-dialog h4 {
  margin: 0 0 8px;
  color: var(--primary);
}

.emi-pay-due-line {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
}

.emi-pay-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.emi-pay-dialog-actions .btn {
  width: auto;
  padding: 10px 18px;
  font-size: 14px;
}

.warning-text {
  color: var(--muted);
  font-size: 12px;
  margin-top: 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  line-height: 1.5;
}

body.is-exporting-pdf .no-print {
  display: none !important;
}

.print-only {
  display: none;
}

@media print {
  .print-only {
    display: block !important;
  }
}

body.is-exporting-pdf .print-only {
  display: block !important;
}

body.is-exporting-pdf {
  padding: 0 !important;
  background: #fff !important;
}

body.is-exporting-pdf #scheduleExportRoot {
  margin: 0;
  padding: 0;
}

body.is-exporting-pdf .export-letterhead {
  margin-bottom: 8px;
}

body.is-exporting-pdf .table-container,
body.is-exporting-pdf .schedule-export-table-wrap {
  overflow: visible !important;
}

.schedule-print-summary {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.schedule-print-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 16px;
  font-size: 12px;
}

.schedule-print-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
}

.schedule-print-months {
  margin-bottom: 12px;
}

.schedule-print-months-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.months-grid--print {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}

.month-chip {
  display: block;
  text-align: center;
  padding: 6px 2px;
  border: 1px solid var(--secondary);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: #fff;
  line-height: 1.2;
}

.month-chip--paid {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}

.month-chip--late {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

@media (max-width: 960px) {
  .main-container {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  body {
    padding: 12px;
  }

  .inline-custom-row,
  .id-group {
    flex-direction: column;
  }

  .id-group select {
    flex: 1 1 auto;
    width: 100%;
  }
}

@media print {
  @page {
    margin: 10mm;
  }

  body {
    background: #fff;
    padding: 0;
  }

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

  .alert {
    display: none !important;
  }

  .flash-messages {
    display: none !important;
  }

  .site-header,
  .back-link,
  .warning-text {
    display: none !important;
  }

  .app-shell {
    max-width: none;
    margin: 0;
  }

  #scheduleExportRoot {
    margin: 0;
    padding: 0;
  }

  body.is-printing-overdue .site-header,
  body.is-printing-overdue .main-container,
  body.is-printing-overdue .warning-text,
  body.is-printing-overdue .alert,
  body.is-printing-overdue dialog,
  body.is-printing-overdue template {
    display: none !important;
  }

  body.is-printing-overdue #overduePrintRoot {
    display: block !important;
    padding: 0;
    max-height: none;
    overflow: visible;
  }

  body.is-printing-overdue .export-letterhead {
    margin-bottom: 12px;
    box-shadow: none;
  }

  body.is-printing-overdue .export-letterhead .brand-info h1 {
    font-size: 20px;
  }

  body.is-printing-overdue .overdue-defaulters-table {
    font-size: 11px;
    width: 100%;
  }

  body.is-printing-overdue .overdue-dialog-table-wrap {
    overflow: visible !important;
  }

  .export-letterhead {
    margin-bottom: 8px;
  }

  .table-container,
  .schedule-export-table-wrap {
    overflow: visible !important;
  }

  .schedule-export-table {
    width: 100% !important;
    font-size: 11px;
  }

  .schedule-export-table th,
  .schedule-export-table td {
    padding: 6px 8px !important;
    overflow: visible !important;
    white-space: normal !important;
  }

  .card {
    box-shadow: none;
    border: none;
    padding: 0;
  }
}
