/* =========================================================
   STYLE.CSS - APLIKASI PERMOHONAN KREDIT
   Desain modern, bersih & fresh (non-desktop window look)
   Struktur class dipertahankan agar kompatibel dengan app.js
   ========================================================= */

:root {
  /* Brand — hijau segar bernuansa keuangan */
  --brand-50:  #ecfdf5;
  --brand-100: #d1fae5;
  --brand-200: #a7f3d0;
  --brand-400: #34d399;
  --brand-500: #10b981;
  --brand-600: #059669;
  --brand-700: #047857;
  --brand-800: #065f46;
  --brand-900: #064e3b;

  /* Netral */
  --ink-900: #0f172a;
  --ink-800: #1e293b;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
  --ink-50:  #f8fafc;

  /* Semantik */
  --success-color: #059669;
  --danger-color: #e11d48;
  --warning-color: #d97706;

  /* Alias lama (dipakai app.js / komponen lain) */
  --primary-color: var(--brand-600);
  --primary-hover: var(--brand-700);
  --secondary-color: var(--ink-600);
  --text-main: var(--ink-900);
  --text-muted: var(--ink-500);
  --border-light: var(--ink-200);

  /* Shape & shadow */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 18px -6px rgba(15, 23, 42, 0.15), 0 2px 6px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 50px -18px rgba(15, 23, 42, 0.28);
  --ring: 0 0 0 4px rgba(16, 185, 129, 0.16);

  --font-sans: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'SFMono-Regular', 'Courier New', monospace;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--ink-100);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.app-body {
  background: var(--ink-100);
}

.font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-bold { font-weight: 700; }
.text-muted { color: var(--ink-500); }
.d-none { display: none !important; }
.mt-3 { margin-top: 12px; }
.py-4 { padding-top: 18px; padding-bottom: 18px; }

/* =========================================================
   LOGIN SCREEN
   ========================================================= */
.login-body {
  background: var(--ink-100);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 34px 30px 30px;
  border: 1px solid var(--ink-200);
  animation: cardIn 0.4s ease-out both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
  text-align: center;
  margin-bottom: 26px;
}

.login-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  background: var(--brand-600);
  color: #ffffff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.login-header h2 {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  margin-bottom: 6px;
}

.login-header .subtitle {
  color: var(--ink-500);
  font-size: 13px;
}

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

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
  margin-bottom: 7px;
}

.form-group label i {
  color: var(--brand-600);
  margin-right: 5px;
  font-size: 12px;
}

.form-group input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink-900);
  background: var(--ink-50);
  border: 1.5px solid var(--ink-200);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.form-group input::placeholder {
  color: var(--ink-400);
}

.form-group input:focus {
  background: #ffffff;
  border-color: var(--brand-500);
  box-shadow: var(--ring);
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  padding-right: 46px;
}

.btn-toggle-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--ink-400);
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.btn-toggle-eye:hover {
  color: var(--brand-700);
  background: var(--brand-50);
}

.btn-primary {
  background: var(--brand-600);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  padding: 0 18px;
  height: 46px;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: var(--brand-700);
}

.btn-primary:active {
  transform: none;
}

.btn-primary:active {
  transform: translateY(0) scale(0.995);
}

.btn-primary:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: cardIn 0.25s ease-out both;
}

.alert::before {
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 13px;
}

.alert-error {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
}

.alert-error::before { content: '\f06a'; }

.alert-success {
  background: var(--brand-50);
  color: var(--brand-800);
  border: 1px solid var(--brand-200);
}

.alert-success::before { content: '\f058'; }

.login-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--ink-100);
  text-align: center;
  font-size: 12px;
  color: var(--ink-500);
}

.server-badge {
  background: var(--ink-50);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--ink-200);
  display: inline-block;
  margin-bottom: 8px;
}

.hint-text code {
  background: var(--ink-100);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--brand-700);
  font-family: var(--font-mono);
}

/* =========================================================
   TOP APPLICATION BAR
   ========================================================= */
.app-navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--ink-200);
  color: var(--ink-900);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1240px;
  margin: 0 auto;
  min-height: 64px;
  flex-wrap: wrap;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex-shrink: 0;
}

.brand-logo {
  background: var(--brand-600);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.brand-title h1 {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink-900);
  line-height: 1.3;
  white-space: nowrap;
}

.brand-title span {
  font-size: 11.5px;
  color: var(--ink-500);
  display: block;
  font-weight: 500;
  line-height: 1.3;
}

.nav-tabs {
  display: flex;
  gap: 2px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  flex-shrink: 0;
}

.nav-tab {
  background: transparent;
  color: var(--ink-500);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}

.nav-tab i {
  font-size: 12px;
  opacity: 0.9;
}

.nav-tab:hover {
  color: var(--brand-700);
  background: var(--brand-50);
}

.nav-tab.active {
  background: var(--brand-50);
  color: var(--brand-700);
  box-shadow: none;
}

.nav-tab.active i {
  opacity: 1;
}

.nav-tab .badge {
  background: var(--danger-color);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.5;
}

.nav-tab.active .badge {
  background: var(--brand-600);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-info {
  text-align: right;
  line-height: 1.3;
}

.user-name {
  display: block;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-800);
}

.user-role {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-500);
}

.btn-logout {
  background: #ffffff;
  color: var(--ink-500);
  border: 1px solid var(--ink-200);
  padding: 8px 9px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-logout:hover {
  background: #fff1f2;
  color: var(--danger-color);
  border-color: #fecdd3;
}

/* =========================================================
   MAIN CONTAINER
   ========================================================= */
.main-container {
  max-width: 1080px;
  margin: 24px auto 48px;
  padding: 0 20px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeInUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   FORM CARD (pengganti tampilan window desktop)
   ========================================================= */
.desktop-window {
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--ink-100);
  overflow: hidden;
  max-width: 860px;
  margin: 0 auto;
}

/* Header kartu form (dulu: titlebar ala Windows) */
.window-titlebar {
  background: #ffffff;
  border-bottom: 1px solid var(--ink-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  user-select: none;
}

.window-title-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.window-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-600);
  color: #ffffff;
  font-size: 16px;
  border-radius: 10px;
  flex-shrink: 0;
}

.window-title-block {
  min-width: 0;
}

.window-title-text {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  line-height: 1.3;
}

.window-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
  margin-top: 2px;
}

.window-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  color: var(--brand-700);
  border: 1px solid var(--brand-200);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.window-title-badge i {
  font-size: 11px;
}

/* Body kartu form */
.window-body {
  padding: 22px 24px 24px;
  background: #ffffff;
}

/* --- Baris & kolom form ------------------------------------------------ */
.form-row {
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.form-row.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* .col-nomer removed – no dedicated column for Nomer now */


.col-tanggal {
  width: 200px;
}

.col-full-width {
  width: 100%;
}

.col-nama-group {
  width: 100%;
}

/* --- Label ------------------------------------------------------------- */
.win-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink-600);
  margin-bottom: 6px;
}

.highlight-label {
  color: var(--brand-700);
}

/* --- Input & select ---------------------------------------------------- */
.win-input,
.win-select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 500;
  color: var(--ink-900);
  background-color: var(--ink-50);
  border: 1.5px solid var(--ink-200);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.win-input::placeholder {
  color: var(--ink-400);
  font-weight: 400;
  font-size: 14px;
}

.win-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

.win-input:hover,
.win-select:hover {
  border-color: var(--ink-300);
}

.win-input:focus,
.win-select:focus {
  background-color: #ffffff;
  border-color: var(--brand-500);
  box-shadow: var(--ring);
}

.win-input[readonly] {
  background-color: var(--ink-100);
  color: var(--ink-600);
  border-color: var(--ink-200);
  cursor: default;
}

.win-input[readonly]:focus {
  border-color: var(--brand-500);
  box-shadow: var(--ring);
}

/* Field terkunci (mis. AO otomatis dari akun login) */
.win-select.is-locked,
.win-input.is-locked {
  background-color: var(--ink-100);
  color: var(--ink-700);
  border-color: var(--ink-200);
  cursor: not-allowed;
  opacity: 1;
  -webkit-text-fill-color: var(--ink-700);
}

.win-select.is-locked {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='11' width='16' height='10' rx='2'/><path d='M8 11V7a4 4 0 0 1 8 0v4'/></svg>");
}

.win-select.is-locked:focus,
.win-input.is-locked:focus {
  border-color: var(--ink-200);
  box-shadow: none;
}

.label-lock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-200);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  vertical-align: middle;
}

.label-lock i {
  font-size: 9px;
}

/* Date input icon coloring */
.date-input {
  padding-right: 10px;
}

.date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.55;
}

/* --- Nama / anggota ---------------------------------------------------- */
.nama-inputs-flex {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nama-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nama-field-grow {
  flex: 1 1 auto;
}

/* Keterangan kecil di atas tiap field. Disembunyikan di layar lebar karena
   di sana posisi kiri-kanan sudah jelas dari placeholder. */
.nama-field-caption {
  display: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-500);
  margin-bottom: 4px;
}

.input-noanggota {
  width: 96px;
  flex-shrink: 0;
  flex-grow: 0;
}

.input-namaanggota {
  flex-grow: 1;
  width: 100%;
}

.win-btn-action.btn-anggota {
  height: 46px;
  padding: 0 18px;
  background: var(--brand-50);
  border: 1.5px solid var(--brand-200);
  color: var(--brand-700);
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.16s;
  flex-shrink: 0;
}

.win-btn-action.btn-anggota::before {
  content: '\f0c0';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 12px;
}

.win-btn-action.btn-anggota:hover {
  background: var(--brand-100);
  border-color: var(--brand-400);
  transform: translateY(-1px);
}

/* --- Alamat & telp ----------------------------------------------------- */
.alamat-inputs-flex {
  display: flex;
  gap: 10px;
  align-items: center;
}

.alamat-inputs-flex > .input-alamat,
.alamat-inputs-flex > .input-telp {
  height: 46px;
}

.input-alamat {
  flex: 1 1 60%;
  min-width: 0;
}

.input-telp {
  flex: 0 1 40%;
  min-width: 0;
  max-width: 280px;
}

/* --- Rekening ---------------------------------------------------------- */
.select-editable-wrap {
  display: flex;
  gap: 10px;
}

.select-editable-wrap select {
  flex: 1;
}

.select-editable-wrap input {
  flex: 1;
}

/* --- Detail pinjaman --------------------------------------------------- */
.form-row.three-cols-loan {
  display: grid;
  grid-template-columns: 2fr 1.2fr 2fr;
  gap: 18px;
}

.input-unit-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-unit-wrap input {
  width: 78px;
  text-align: center;
}

.unit-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-500);
  white-space: nowrap;
}

/* --- Bunga ------------------------------------------------------------- */
.bunga-input-group {
  display: flex;
  gap: 10px;
}

.select-jnsbunga {
  width: 140px;
  flex-shrink: 0;
}

.percent-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.percent-input-wrap input {
  width: 100%;
  min-width: 0;
  text-align: right;
}

.denda-wrap {
  max-width: 140px;
}

.materai-wrap {
  display: flex;
}

/* --- Fee (persen + nominal) ------------------------------------------- */
.fee-dual-input {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Kolom persen: lebar tetap, sejajar dengan kolom nominal */
.fee-dual-input .fee-percent {
  flex: 0 0 96px;
  width: 96px;
  min-width: 96px;
  max-width: 96px;
}

.fee-dual-input .fee-percent input {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  text-align: right;
}

.fee-dual-input .fee-percent .unit-label {
  flex-shrink: 0;
  width: 12px;
  text-align: left;
}

.fee-amount {
  flex: 1 1 auto;
  min-width: 0;
}

/* Input angka: sembunyikan spinner agar rapi */
.win-input[type="number"]::-webkit-outer-spin-button,
.win-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.win-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* --- Total terima ------------------------------------------------------ */
.input-totalterima {
  background: #fff1f2;
  font-weight: 700;
  color: #b91c1c;
  font-size: 15px;
  border: 1.5px solid #fecdd3;
  letter-spacing: -0.01em;
}

.input-totalterima.positive {
  background: var(--brand-50);
  color: var(--brand-700);
  border-color: var(--brand-200);
}

.input-totalterima:focus {
  border-color: var(--brand-400);
  box-shadow: var(--ring);
}

/* =========================================================
   RINGKASAN ANGSURAN (highlight card)
   ========================================================= */
.angsuran-summary-box {
  position: relative;
  background: var(--brand-700);
  color: #ffffff;
  padding: 16px 20px;
  margin: 20px 0 18px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  overflow: hidden;
}

.angsuran-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  min-width: 0;
}

.angsuran-item .label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.angsuran-item .value {
  font-weight: 800;
  color: #ffffff;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.angsuran-item.total-bayar .value {
  color: #a7f3d0;
  font-size: 18px;
}

.angsuran-item.total-bayar {
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

/* =========================================================
   ACTION BUTTONS
   ========================================================= */
.form-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 20px;
  border-top: 1px solid var(--ink-100);
  flex-wrap: wrap;
  gap: 12px;
}

.action-buttons-left,
.action-buttons-right {
  display: flex;
  gap: 10px;
}

.btn-win-action {
  height: 44px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1.5px solid var(--ink-200);
  background: #ffffff;
  color: var(--ink-700);
  transition: all 0.16s;
  white-space: nowrap;
}

.btn-win-action:hover {
  border-color: var(--ink-300);
  background: var(--ink-50);
  transform: translateY(-1px);
}

.btn-win-action:active {
  transform: translateY(0);
}

.btn-win-action:disabled {
  opacity: 0.65;
  cursor: progress;
  transform: none;
}

/* Simpan — tombol utama */
.btn-win-simpan {
  background: var(--brand-600);
  border-color: transparent;
  color: #ffffff;
}

.btn-win-simpan:hover {
  background: var(--brand-700);
  border-color: transparent;
  box-shadow: none;
}

/* Cancel */
.btn-win-cancel {
  background: #ffffff;
  border-color: #fecdd3;
  color: #be123c;
}

.btn-win-cancel:hover {
  background: #fff1f2;
  border-color: #fda4af;
}

/* Secondary */
.btn-win-secondary {
  background: #ffffff;
  border-color: var(--ink-200);
  color: var(--ink-700);
}

.btn-win-secondary:hover {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-700);
}

.btn-icon-win {
  font-size: 15px;
  line-height: 1;
}

/* =========================================================
   TABLE VIEW (Daftar Permohonan Kredit)
   ========================================================= */
.table-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--ink-100);
}

.table-card-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--ink-100);
  flex-wrap: wrap;
  gap: 14px;
}

.table-title h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}

.table-title p {
  font-size: 12.5px;
  color: var(--ink-500);
  margin-top: 2px;
}

.table-title .table-owner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-200);
  font-size: 11.5px;
  font-weight: 700;
}

.table-title .table-owner:empty {
  display: none;
}

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

.search-box {
  position: relative;
  width: 270px;
}

.search-box i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
  font-size: 12.5px;
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 36px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink-900);
  background: var(--ink-50);
  border: 1.5px solid var(--ink-200);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.search-box input:focus {
  background: #ffffff;
  border-color: var(--brand-500);
  box-shadow: var(--ring);
}

.btn-secondary {
  background: #ffffff;
  border: 1.5px solid var(--ink-200);
  padding: 0 16px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.16s;
}

.btn-secondary:hover {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-700);
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  background: var(--ink-50);
  color: var(--ink-500);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ink-200);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--ink-100);
  color: var(--ink-700);
  white-space: nowrap;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.14s;
}

.data-table tbody tr:hover {
  background: var(--brand-50);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-bordered .thead-dark th {
  background: var(--ink-800);
  color: #ffffff;
  border-color: var(--ink-700);
}

.badge-tag {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}

.badge-tag.badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.btn-table-action {
  padding: 6px 13px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  border: 1.5px solid var(--brand-200);
  background: var(--brand-50);
  cursor: pointer;
  color: var(--brand-700);
  transition: all 0.16s;
}

.btn-table-action:hover {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #ffffff;
}

/* =========================================================
   MODAL DIALOGS
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: backdropIn 0.2s ease-out both;
}

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

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cardIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal-lg { max-width: 780px; }
.modal-xl { max-width: 980px; }

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--ink-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--ink-50);
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  gap: 9px;
}

.modal-header h3 i {
  color: var(--brand-600);
  font-size: 14px;
}

.btn-close-modal {
  background: var(--ink-100);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 13px;
  color: var(--ink-500);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s;
  flex-shrink: 0;
}

.btn-close-modal:hover {
  background: #fff1f2;
  color: var(--danger-color);
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--ink-100);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--ink-50);
  flex-wrap: wrap;
}

.search-wrap-modal {
  margin-bottom: 14px;
}

.search-wrap-modal input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-900);
  background: var(--ink-50);
  border: 1.5px solid var(--ink-200);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.search-wrap-modal input:focus {
  background: #ffffff;
  border-color: var(--brand-500);
  box-shadow: var(--ring);
}

.modal-table-wrap {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  -webkit-overflow-scrolling: touch;
}

.modal-table-wrap .data-table {
  font-size: 12.5px;
}

.modal-table-wrap .data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal-notice {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--brand-800);
  background: var(--brand-50);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-200);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.modal-notice i {
  margin-top: 2px;
  color: var(--brand-600);
}

/* Simulasi header grid */
.simulasi-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  background: var(--ink-50);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--ink-100);
}

.sim-info-box {
  padding: 10px 12px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-100);
}

.sim-info-box .title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.sim-info-box .val {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}

/* =========================================================
   TOAST ALERTS
   ========================================================= */
.toast {
  position: fixed;
  bottom: 26px;
  right: 26px;
  background: var(--ink-900);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 600;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  border-left: 4px solid var(--brand-400);
  max-width: calc(100vw - 52px);
}

.toast.toast-success {
  background: var(--brand-700);
  border-left-color: var(--brand-400);
}

.toast.toast-error {
  background: #b91c1c;
  border-left-color: #fda4af;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes toastIn {
  from { transform: translateY(18px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* =========================================================
   FLOATING SCROLL TO TOP
   ========================================================= */
.btn-scroll-top {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-600);
  color: #ffffff;
  border: none;
  box-shadow: var(--shadow-md);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: background 0.15s, transform 0.15s;
  touch-action: manipulation;
}

.btn-scroll-top:hover {
  background: var(--brand-700);
  transform: none;
}

.btn-scroll-top:active {
  transform: scale(0.92);
}

/* =========================================================
   PRINT STYLESHEET (Cetak Formulir Permohonan)
   ========================================================= */

/* Ukuran kertas + margin aman printer.
   Margin kecil (10mm) menghemat ruang, tapi tetap di dalam area cetak
   printer supaya tidak memicu halaman ekstra. */
@page {
  size: A4 portrait;
  margin: 10mm 10mm 8mm 10mm;
}

/* Lembar skema angsuran boleh menyamping supaya baris per halaman jauh
   lebih banyak (6 kolom angka lebih pas di orientasi landscape). */
@page simulasi {
  size: A4 landscape;
  margin: 8mm 8mm 6mm 8mm;
}

@media print {
  /* Sembunyikan seluruh aplikasi, lalu hanya tampilkan area cetak aktif. */
  body * {
    visibility: hidden;
  }
  .printable-area,
  .printable-area *,
  #modal-simulasi,
  #modal-simulasi * {
    visibility: visible;
  }
  .no-print {
    display: none !important;
  }

  /* PENTING: `visibility: hidden` menyembunyikan tampilan TAPI kotaknya tetap
     memakan ruang setinggi halaman aplikasi. Itu penyebab utama lembar kosong
     ikut tercetak. Jadi selain disembunyikan, tinggi/overflow body juga
     dikunci ke ukuran kertas. */
  html,
  body {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  /* Wadah aplikasi (header, tab, form, footer) benar-benar dikeluarkan dari
     alur cetak, bukan sekadar disembunyikan. */
  .app-navbar,
  .nav-tabs,
  .main-container,
  .toast,
  .btn-scroll-top,
  .modal-backdrop.d-none {
    display: none !important;
  }

  /* Modal yang tidak jadi target cetak juga dikeluarkan dari alur. */
  body.print-only-cetak #modal-simulasi,
  body.print-only-simulasi #modal-cetak {
    display: none !important;
  }

  /* Paksa warna latar ringkasan tetap tercetak (mis. baris total). */
  .print-form-wrapper,
  .print-table,
  .print-table tr,
  .print-table td,
  #modal-simulasi .data-table {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Jika hanya satu modal yang ditargetkan, sembunyikan modal lainnya. */
  body.print-only-cetak #modal-simulasi,
  body.print-only-cetak #modal-simulasi *,
  body.print-only-simulasi #modal-cetak,
  body.print-only-simulasi #modal-cetak * {
    visibility: hidden !important;
  }
  body.print-only-simulasi #modal-simulasi,
  body.print-only-simulasi #modal-simulasi * {
    visibility: visible;
  }
  body.print-only-cetak .printable-area,
  body.print-only-cetak .printable-area * {
    visibility: visible;
  }

  /* Netralkan efek backdrop/blur/animasi yang membuat halaman cetak kosong. */
  #modal-cetak,
  #modal-cetak *,
  #modal-simulasi,
  #modal-simulasi * {
    animation: none !important;
    transform: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
  }

  /* Lepaskan pembatas ancestor (overflow:hidden, max-height, fixed, z-index)
     supaya seluruh isi formulir/simulasi ikut tercetak, bukan terpotong. */
  #modal-cetak.modal-backdrop,
  #modal-simulasi.modal-backdrop {
    position: static !important;
    inset: auto !important;
    display: block !important;
    background: none !important;
    padding: 0 !important;
    overflow: visible !important;
    z-index: auto !important;
    border-radius: 0 !important;
    /* Cegah backdrop memaksa tinggi minimal viewport. */
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
  }
  #modal-cetak .modal-dialog,
  #modal-simulasi .modal-dialog {
    max-width: none !important;
    max-height: none !important;
    width: 100% !important;
    overflow: visible !important;
    border-radius: 0 !important;
    display: block !important;
    box-shadow: none !important;
  }
  #modal-cetak .modal-body,
  #modal-cetak .printable-area,
  #modal-simulasi .modal-body {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
  }
  /* Tabel simulasi jangan ter-scroll saat cetak. */
  #modal-simulasi .table-responsive {
    overflow: visible !important;
    max-height: none !important;
  }
  #modal-simulasi {
    page: simulasi;
  }

  /* Rapikan tabel simulasi supaya padat: padding & font dikecilkan, batas
     halaman tidak memotong baris di tengah. */
  #modal-simulasi .data-table {
    font-size: 8.5pt;
    border-collapse: collapse;
    width: 100%;
  }
  #modal-simulasi .data-table th,
  #modal-simulasi .data-table td {
    padding: 1.6mm 2mm !important;
    font-size: 8.5pt !important;
    white-space: nowrap;
    line-height: 1.3;
    border: 1px solid #666 !important;
  }
  #modal-simulasi .data-table th {
    background: #e8e8e8 !important;
    color: #000 !important;
    position: static !important;
  }
  #modal-simulasi .data-table tr,
  #modal-simulasi .data-table td,
  #modal-simulasi .data-table th {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  /* Ulangi judul kolom di setiap halaman baru. */
  #modal-simulasi .data-table thead {
    display: table-header-group;
  }
  #modal-simulasi .data-table tfoot {
    display: table-footer-group;
  }

  /* Header info ringkas, bukan kartu-kartu besar 4 kolom. */
  #modal-simulasi .simulasi-info-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0 !important;
    padding: 0 0 2mm 0 !important;
    margin-bottom: 2mm !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    page-break-after: avoid;
    break-after: avoid;
  }
  #modal-simulasi .sim-info-box {
    flex: 1 1 22% !important;
    padding: 0 2mm 0 0 !important;
    border: none !important;
    background: none !important;
    border-radius: 0 !important;
  }
  #modal-simulasi .sim-info-box .title {
    font-size: 7.5pt !important;
    color: #555 !important;
  }
  #modal-simulasi .sim-info-box .val {
    font-size: 9pt !important;
  }

  /* Formulir permohonan cukup satu halaman A4. */
  .print-form-wrapper {
    padding: 0 !important;
    font-size: 9.5pt;
    page-break-inside: avoid;
  }
  .print-header {
    padding-bottom: 2mm;
    margin-bottom: 3mm;
  }
  .print-header h2 {
    font-size: 14pt;
  }
  .print-title {
    margin: 3mm 0;
  }
  .print-table {
    margin-bottom: 3mm;
  }
  .print-table td {
    padding: 1.2mm 2mm;
  }
  .print-table .label-col {
    width: 24%;
  }
  /* Blok tanda tangan tidak boleh terbelah ke halaman berikutnya. */
  .print-signatures {
    margin-top: 8mm;
    page-break-inside: avoid;
    break-inside: avoid;
  }
}

.print-form-wrapper {
  background: white;
  padding: 24px;
  color: #000;
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.print-header {
  text-align: center;
  border-bottom: 2px solid #000;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.print-header h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.print-header p {
  font-size: 12px;
}

.print-title {
  text-align: center;
  margin: 16px 0;
}

.print-title h3 {
  text-decoration: underline;
  font-size: 14px;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.print-table td {
  padding: 5px 8px;
  vertical-align: top;
}

.print-table td.label-col {
  width: 25%;
  font-weight: bold;
}

.print-table td.colon-col {
  width: 2%;
}

.print-signatures {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  text-align: center;
}

.print-sig-box {
  width: 200px;
}

.print-sig-space {
  height: 70px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
  .nav-tabs {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: -1px;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex-shrink: 0;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  /* 1. Navbar Mobile — grid 2 baris: brand | user, lalu tab full-width */
  .app-navbar {
    padding: 0;
  }

  .nav-header-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'brand user'
      'tabs  tabs';
    align-items: center;
    column-gap: 10px;
    row-gap: 0;
    min-height: 0;
    padding: 10px 12px 0;
    flex-wrap: nowrap;
  }

  .nav-brand {
    grid-area: brand;
    gap: 9px;
    min-width: 0;
    flex: initial;
    overflow: hidden;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
    font-size: 14px;
    border-radius: 9px;
  }

  .brand-title {
    min-width: 0;
    overflow: hidden;
  }

  .brand-title h1 {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0;
    line-height: 1.25;
  }

  .brand-title span {
    display: none;
  }

  .nav-user {
    grid-area: user;
    gap: 6px;
    flex-shrink: 0;
    min-width: 0;
  }

  .user-name {
    font-size: 11.5px;
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-role {
    display: none;
  }

  .user-info {
    min-width: 0;
  }

  .btn-logout {
    padding: 7px 8px;
    flex-shrink: 0;
  }

  .nav-tabs {
    grid-area: tabs;
    order: 0;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 2px;
    padding: 6px 0 8px;
    margin: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    padding: 8px 11px;
    font-size: 12.5px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .nav-tab-label {
    display: inline;
  }

  .nav-tab i {
    font-size: 12px;
  }

  /* 2. Container */
  .main-container {
    padding: 0 12px;
    margin: 14px auto 48px;
  }

  .desktop-window {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
  }

  .window-titlebar {
    padding: 16px 16px;
  }

  .window-title-text {
    font-size: 14.5px;
  }

  .window-subtitle {
    font-size: 11.5px;
  }

  .window-title-badge {
    display: none;
  }

  .window-icon {
    width: 38px;
    height: 38px;
    font-size: 15px;
    border-radius: 11px;
  }

  .window-body {
    padding: 16px 14px 20px;
  }

  /* 3. Form layout: satu kolom */
  .form-row {
    margin-bottom: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .form-row.two-cols,
  .form-row.three-cols-loan {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

   .col-tanggal,
   .col-full-width,
   .col-nama-group,
  .form-col {
    width: 100% !important;
  }

  .win-label {
    font-size: 12.5px;
    margin-bottom: 6px;
    color: var(--ink-700);
  }

  /* 4. Input touch-friendly (cegah auto-zoom iOS) */
  .win-input,
  .win-select {
    height: 46px;
    font-size: 16px !important;
    padding: 0 12px;
    border-radius: 10px;
  }

  .win-select {
    padding-right: 34px;
  }

  .nama-inputs-flex {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* Saat bertumpuk, tampilkan keterangan Kode / Nama supaya tidak terlihat
     seperti dua kolom "nama". */
  .nama-field-caption {
    display: block;
  }

  .nama-field {
    width: 100%;
  }

  .input-noanggota {
    width: 100% !important;
  }

  .input-namaanggota {
    width: 100% !important;
  }

  .win-btn-action.btn-anggota {
    height: 46px;
    font-size: 14px;
    width: 100%;
    justify-content: center;
    border-radius: 10px;
  }

  .alamat-inputs-flex {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* Saat bertumpuk, semua field harus selebar kontainer.
     max-width: 280px milik .input-telp perlu dilepas, kalau tidak
     kolom telepon menyusut dan menjorok keluar dari batas form. */
  .input-alamat,
  .input-telp {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: none !important;
  }

  .select-editable-wrap {
    flex-direction: column;
    gap: 8px;
  }

  .input-unit-wrap {
    width: 100%;
    gap: 8px;
  }

  .input-unit-wrap input {
    flex: 1;
    width: 100% !important;
  }

  .unit-label {
    font-size: 14px;
    font-weight: 600;
  }

  .bunga-input-group {
    flex-direction: column;
    gap: 8px;
  }

  .select-jnsbunga {
    width: 100% !important;
  }

  .percent-input-wrap {
    width: 100%;
    gap: 8px;
  }

  .percent-input-wrap input {
    flex: 1;
    width: 100% !important;
  }

  .denda-wrap {
    max-width: none;
  }

  /* Fee tetap sejajar: kolom % kecil di kiri, nominal di kanan */
  .fee-dual-input {
    flex-direction: row;
    gap: 8px;
    align-items: center;
  }

  .fee-dual-input .fee-percent {
    flex: 0 0 88px;
    width: 88px !important;
    min-width: 88px;
    max-width: 88px;
  }

  .fee-dual-input .fee-percent input {
    width: 100% !important;
    min-width: 0;
    padding: 0 8px;
    text-align: right;
  }

  .fee-amount {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
  }

  .input-totalterima {
    font-size: 19px !important;
    height: 54px;
    font-weight: 800;
    text-align: center;
  }

  /* 5. Ringkasan angsuran */
  .angsuran-summary-box {
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    margin: 18px 0 16px;
  }

  .angsuran-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.18);
    padding-bottom: 10px;
  }

  .angsuran-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .angsuran-item.total-bayar {
    padding-left: 0;
    border-left: none;
  }

  .angsuran-item .label {
    font-size: 11.5px;
  }

  .angsuran-item .value {
    font-size: 15px;
  }

  .angsuran-item.total-bayar .value {
    font-size: 18px;
  }

  /* 6. Tombol aksi bawah */
  .form-actions-bar {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    margin-top: 18px;
    padding-top: 18px;
  }

  .action-buttons-left,
  .action-buttons-right {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .btn-win-action {
    height: 48px;
    font-size: 15px;
    justify-content: center;
    border-radius: 10px;
    width: 100%;
  }

  /* 7. Tabel */
  .table-card {
    border-radius: var(--radius-lg);
  }

  .table-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
  }

  .table-actions {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .search-box {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }

  .table-actions .btn-secondary {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .search-box input {
    height: 44px;
    font-size: 15px;
  }

  .btn-secondary {
    height: 44px;
    justify-content: center;
    font-size: 14px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }

  /* 8. Modal: sheet style */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-dialog {
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
  }

  .modal-footer .btn-win-action {
    width: 100%;
  }

  .simulasi-info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .toast {
    left: 14px;
    right: 14px;
    bottom: 14px;
    justify-content: center;
    font-size: 13.5px;
    max-width: none;
  }

  .btn-scroll-top {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
}

/* Di layar sempit, tab menu tadinya bisa di-scroll ke samping (overflow-x: auto)
   sehingga tombol "Simulasi Angsuran" terdorong keluar layar dan tidak bisa
   diklik. Sekarang tab dibungkus ke baris baru supaya semua tombol terjangkau. */
@media (max-width: 560px) {
  .nav-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 6px;
  }

  .nav-tab {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .nav-brand {
    gap: 8px;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
    font-size: 13px;
    border-radius: 8px;
  }

  .brand-title h1 {
    font-size: 11px;
  }

  .user-name {
    max-width: 68px;
    font-size: 11px;
  }

  .nav-tab {
    padding: 8px 10px;
    font-size: 12px;
    gap: 6px;
  }

  .nav-tab-label {
    display: inline;
  }

  .nav-tab i {
    font-size: 12px;
  }

  .window-titlebar {
    padding: 14px;
  }

  .angsuran-item .value {
    font-size: 14px;
  }
}
