/* ============================================================
   PAYO - styles.css  |  Diseño Glassmorphism Azul Claro
   Todas las clases funcionales preservadas sin cambios de lógica
   ============================================================ */

/* Nunito removido — usa fuente del sistema para soporte offline */

/* Variables */
:root {
  --primary-color:     #2196f3;
  --primary-dark:      #1565c0;
  --primary-light:     #6cb7e6;
  --accent-color:      #eab308;
  --accent-secondary:  #ff9f1c;
  --teal:              #17b6a0;
  --bg:                #d8eef8;
  --surface:           rgba(255,255,255,0.72);
  --surface-hover:     rgba(255,255,255,0.90);
  --border:            rgba(255,255,255,0.65);
  --shadow:            0 4px 24px rgba(33,150,243,0.12);
  --shadow-sm:         0 2px 12px rgba(33,150,243,0.09);
  --text-color:        #1a2e42;
  --text-muted:        #5a7a96;
  --card-bg:           rgba(255,255,255,0.72);
  --border-radius:     16px;
  --header-bg-dark:    #0d47a1;
}

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

html {
  background: linear-gradient(160deg, #b8d8f0 0%, #d0ecfb 50%, #e0f4fd 100%);
  min-height: 100%;
}

body {
  font-family: 'Nunito', 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  max-width: 414px;
  margin: 0 auto;
  background: linear-gradient(170deg, #cce8f8 0%, #ddf3fc 50%, #eaf7fe 100%);
  min-height: 100vh;
  box-shadow: 0 0 40px rgba(21,101,192,0.18);
  position: relative;
  padding-bottom: 70px;
}

header {
  background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(21,101,192,0.22);
}

header.header-dark {
  background: linear-gradient(135deg, #0d1e2c 0%, #1a2e42 100%);
}

header h1 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.header-icons { display: flex; gap: 10px; align-items: center; }

.icon-button {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 10px;
  color: #fff;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .18s;
  backdrop-filter: blur(6px);
}
.icon-button:hover { background: rgba(255,255,255,0.30); }
.icon-button svg   { width: 18px; height: 18px; fill: #fff; }
.diamond-icon      { fill: #facc15 !important; }

.back-button {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 10px; color: #fff;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .18s;
}
.back-button:hover { background: rgba(255,255,255,0.28); }
.back-button svg   { width: 18px; height: 18px; fill: #fff; }

/* Overflow menu */
.overflow-menu { position: relative; }
.overflow-menu-items {
  display: none; position: absolute;
  top: calc(100% + 6px); right: 0;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(12px);
  color: #333; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  width: 160px; z-index: 200; overflow: hidden;
}
.overflow-menu-items.show { display: block; }
.overflow-menu-item {
  padding: 11px 16px; cursor: pointer;
  border-bottom: 1px solid #eee; font-size: 0.9rem;
  font-weight: 600; color: var(--text-color); transition: background .15s;
}
.overflow-menu-item:last-child { border-bottom: none; }
.overflow-menu-item:hover { background: rgba(33,150,243,0.08); }

main { padding: 16px; margin-bottom: 10px; }

/* Dashboard summary */
.dashboard-summary {
  background: var(--surface); backdrop-filter: blur(14px);
  border: 1.5px solid var(--border); border-radius: var(--border-radius);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.dashboard-summary-label  { font-size: 12px; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.dashboard-summary-amount { font-size: 28px; font-weight: 900; color: var(--primary-color); letter-spacing: -1px; }
.sparkline { width: 100px; height: 44px; }
.sparkline path   { fill: none; stroke: var(--primary-color); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.sparkline circle { fill: var(--primary-color); }

.section-label {
  font-size: 13px; font-weight: 800; color: var(--teal);
  text-align: center; margin: 6px 0 12px; letter-spacing: 0.2px;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.card {
  background: var(--surface); backdrop-filter: blur(14px);
  border: 1.5px solid var(--border); border-radius: var(--border-radius);
  box-shadow: var(--shadow); padding: 20px 14px 16px;
  text-align: center; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .18s;
}
.card:hover  { background: var(--surface-hover); transform: translateY(-3px); box-shadow: 0 8px 28px rgba(33,150,243,0.18); }
.card:active { transform: scale(0.97); }
.card svg    { width: 32px; height: 32px; fill: var(--primary-color); }
.card .card-text { font-size: 12px; font-weight: 800; color: var(--primary-color); line-height: 1.2; }

.config-card { grid-column: span 2; }

/* Stats wide card */
.stats-wide-card {
  grid-column: span 2;
  background: var(--surface); backdrop-filter: blur(14px);
  border: 1.5px solid var(--border); border-radius: var(--border-radius);
  box-shadow: var(--shadow); padding: 18px 16px 14px;
  cursor: pointer; transition: transform .2s, background .18s;
}
.stats-wide-card:hover { background: var(--surface-hover); transform: translateY(-2px); }
.stats-bars-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 10px; }
.bars-group     { display: flex; align-items: flex-end; gap: 3px; flex: 1; }
.bar-item       { flex: 1; border-radius: 4px 4px 0 0; min-width: 5px; background: linear-gradient(180deg, rgba(33,150,243,.5) 0%, rgba(33,150,243,.12) 100%); transition: height .3s; }
.bar-item.hi    { background: linear-gradient(180deg, var(--primary-color) 0%, rgba(33,150,243,.45) 100%); }
.stats-center-icon { width: 50px; height: 50px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.stats-center-icon svg { width: 44px; height: 44px; }
.stats-wide-label { text-align: center; font-size: 12px; font-weight: 800; color: var(--text-color); }

/* Footer nav */
.footer-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  margin: 0 auto; width: 100%; max-width: 414px;
  background: rgba(255,255,255,0.90); backdrop-filter: blur(18px);
  border-top: 1.5px solid rgba(255,255,255,0.75);
  padding: 8px 0 10px; display: flex; justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(33,150,243,0.10); z-index: 100;
}
.nav-button {
  background: none; border: none; color: var(--text-muted);
  font-size: 0.7rem; cursor: pointer; font-weight: 800;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 10px; border-radius: 10px; transition: color .18s;
  font-family: 'Nunito', 'Segoe UI', Roboto, Arial, sans-serif;
}
.nav-button svg    { width: 20px; height: 20px; fill: var(--text-muted); transition: fill .18s; }
.nav-button.active { color: var(--primary-color); }
.nav-button.active svg { fill: var(--primary-color); }
.nav-button:hover  { color: var(--primary-color); }
.nav-button:hover svg { fill: var(--primary-color); }

/* Lists */
.list {
  background: var(--surface); backdrop-filter: blur(14px);
  border-radius: var(--border-radius); box-shadow: var(--shadow);
  border: 1.5px solid var(--border); list-style: none;
}
.list-item {
  padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.5);
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: inherit; cursor: pointer; transition: background .15s;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover  { background: rgba(33,150,243,0.06); }
.list-item svg    { width: 20px; height: 20px; fill: var(--primary-color); }
.list-item-text-green { color: var(--primary-color); font-weight: 700; }

.round-icon-list { background: transparent; box-shadow: none; border: none; }
.round-icon-list-item {
  background: var(--surface); backdrop-filter: blur(14px);
  border: 1.5px solid var(--border); border-radius: var(--border-radius);
  padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: inherit; cursor: pointer;
  transition: transform .18s, background .18s;
}
.round-icon-list-item:hover { background: var(--surface-hover); transform: translateY(-2px); }
.round-icon-container {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent-color);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; flex-shrink: 0;
}
.round-icon-list-item-text { flex-grow: 1; font-weight: 700; color: var(--primary-color); }

.loan-list-item { justify-content: space-between; }
.loan-id {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--accent-secondary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 800; flex-shrink: 0;
}
.loan-details  { display: flex; flex-direction: column; align-items: flex-end; }
.loan-status   { font-size: 0.78rem; color: var(--teal); font-weight: 700; }
.loan-amount   { font-weight: 900; font-size: 0.9rem; color: var(--text-color); }

/* Summary card (stats page) */
.summary-card {
  background: var(--surface); backdrop-filter: blur(14px);
  border: 1.5px solid var(--border); border-radius: var(--border-radius);
  padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.summary-title { font-size: 0.85rem; color: var(--text-muted); font-weight: 700; text-align: center; margin-bottom: 14px; }
.summary-data  { list-style: none; }
.summary-data-item { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 0.9rem; }
.summary-data-item .label { color: var(--text-muted); }
.summary-data-item .value { font-weight: 800; color: var(--text-color); }
.summary-data-item .value-green { color: var(--primary-color); font-weight: 800; }

/* Profile */
.profile-header {
  background: linear-gradient(135deg, #1565c0 0%, #2196f3 100%);
  color: #fff; text-align: center;
  padding: 40px 20px 60px;
  border-bottom-left-radius: 50% 18px; border-bottom-right-radius: 50% 18px;
  margin-bottom: -40px;
}
.profile-pic {
  width: 82px; height: 82px; border-radius: 50%;
  background: var(--accent-color);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; border: 4px solid #fff;
  color: #fff; font-size: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* FAB */
.fab {
  position: fixed; bottom: 80px; right: calc(50% - 207px + 16px);
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-color), #f59e0b);
  color: #fff; border: none; font-size: 1.5rem; cursor: pointer;
  box-shadow: 0 4px 14px rgba(234,179,8,0.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s;
}
.fab:hover { transform: scale(1.08); }

/* Search */
.search-bar { display: flex; gap: 10px; margin-bottom: 14px; }
.search-input {
  flex-grow: 1; padding: 11px 14px; border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface); backdrop-filter: blur(10px);
  font-family: 'Nunito', 'Segoe UI', Roboto, Arial, sans-serif; font-size: 0.95rem;
  color: var(--text-color); outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.search-input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(33,150,243,0.12); }

/* Sync */
.sync-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 70vh; gap: 20px; text-align: center;
}
.sync-icon   { width: 80px; height: 80px; fill: var(--primary-color); }
.sync-button {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: #fff; border: none; padding: 13px 28px; border-radius: 12px;
  font-weight: 800; font-size: 0.95rem; cursor: pointer;
  box-shadow: 0 4px 12px rgba(33,150,243,0.3); transition: transform .18s;
  font-family: 'Nunito', 'Segoe UI', Roboto, Arial, sans-serif;
}
.sync-button:hover { transform: translateY(-2px); }

/* Forms */
.form-icon-header { background: linear-gradient(135deg, #1565c0, #2196f3); display: flex; justify-content: center; padding-bottom: 20px; }
.form-main-icon   { width: 100px; height: 100px; background: #ffb703; border: 4px solid white; }
.form-container   { padding: 10px 20px 40px; }
.input-group      { margin-bottom: 24px; }
.input-group input {
  width: 100%; border: none; border-bottom: 2px solid #c8ddf0;
  padding: 10px 0; font-size: 1rem; outline: none;
  background: transparent; color: var(--text-color);
  font-family: 'Nunito', 'Segoe UI', Roboto, Arial, sans-serif; transition: border-color .25s;
}
.input-group input:focus { border-bottom: 2px solid var(--primary-color); }
.form-section-title { font-size: 0.9rem; color: var(--text-muted); margin: 28px 0 18px; font-weight: 800; }

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: #fff; border: none; padding: 14px; font-size: 1rem; font-weight: 800;
  border-radius: 12px; margin-top: 10px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(33,150,243,0.28);
  font-family: 'Nunito', 'Segoe UI', Roboto, Arial, sans-serif; transition: transform .18s, box-shadow .18s;
}
.btn-primary:hover  { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(33,150,243,0.36); }
.btn-primary:active { transform: scale(0.98); }

.input-label { display: block; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 2px; font-weight: 600; }
.custom-select {
  width: 100%; border: none; border-bottom: 2px solid #c8ddf0;
  padding: 10px 0; font-size: 1rem; background: transparent; outline: none;
  appearance: auto; -webkit-appearance: auto; -moz-appearance: auto;
  cursor: pointer; color: var(--text-color); font-family: 'Nunito', 'Segoe UI', Roboto, Arial, sans-serif;
}
.custom-select:focus { border-bottom-color: var(--primary-color); }
.with-button { display: flex; align-items: flex-end; gap: 10px; }
.side-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: #fff; border: none; width: 46px; height: 46px;
  border-radius: 10px; font-size: 1.2rem;
  display: flex; justify-content: center; align-items: center;
  cursor: pointer; flex-shrink: 0;
}
.switch-group { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; padding: 10px 0; border-bottom: 1px solid rgba(33,150,243,0.1); }
.switch { position: relative; display: inline-block; width: 50px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; transition: .35s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; transition: .35s; }
input:checked + .slider { background: var(--primary-color); }
input:checked + .slider:before { transform: translateX(26px); }
.slider.round { border-radius: 24px; }
.slider.round:before { border-radius: 50%; }
.double-btn-container { display: flex; gap: 10px; margin-top: 18px; }
.double-btn-container .btn-primary { flex: 1; margin-top: 0; }
.date-input {
  width: 100%; border: none; border-bottom: 2px solid #c8ddf0;
  padding: 10px 0; font-size: 1rem; background: transparent;
  outline: none; color: var(--text-color); font-family: 'Nunito', 'Segoe UI', Roboto, Arial, sans-serif;
}
.date-input::-webkit-calendar-picker-indicator {
  background: transparent; bottom: 0; color: transparent; cursor: pointer;
  height: auto; left: 0; position: absolute; right: 0; top: 0; width: auto;
}

/* Modal */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 1000;
  justify-content: center; align-items: center; backdrop-filter: blur(3px);
}
.modal-content {
  background: rgba(255,255,255,0.96); backdrop-filter: blur(16px);
  padding: 22px; border-radius: 20px; width: 85%; max-width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.16); border: 1.5px solid var(--border);
}
.modal-title    { font-size: 1.05rem; font-weight: 800; color: var(--text-color); margin-bottom: 8px; }
.modal-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 14px; }
.modal-input {
  width: 100%; border: none; border-bottom: 2px solid #c8ddf0;
  padding: 8px 0; font-size: 1rem; margin-bottom: 18px; outline: none;
  background: transparent; font-family: 'Nunito', 'Segoe UI', Roboto, Arial, sans-serif;
}
.modal-input:focus { border-bottom-color: var(--primary-color); }
.modal-actions { display: flex; justify-content: flex-end; gap: 20px; }
.modal-btn { background: none; border: none; color: var(--accent-color); font-weight: 800; font-size: 0.9rem; cursor: pointer; font-family: 'Nunito', 'Segoe UI', Roboto, Arial, sans-serif; }

/* Loan detail */
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; row-gap: 18px; }
.detail-item  { display: flex; flex-direction: column; }
.detail-label { font-weight: 800; color: var(--text-color); font-size: 0.88rem; margin-bottom: 2px; }
.detail-value { color: #facc15; font-size: 0.93rem; font-weight: 700; }

/* Payment */
.radio-list  { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.radio-item  { display: flex; align-items: center; cursor: pointer; }
.radio-item input[type="radio"] { display: none; }
.radio-custom { width: 20px; height: 20px; border: 2px solid #aaa; border-radius: 50%; margin-right: 10px; position: relative; flex-shrink: 0; }
.radio-item input[type="radio"]:checked + .radio-custom { border-color: #facc15; }
.radio-item input[type="radio"]:checked + .radio-custom::after { content: ''; position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; background: #facc15; border-radius: 50%; }
.radio-label { flex-grow: 1; font-size: 1rem; color: var(--text-color); }
.radio-value { color: var(--text-muted); font-size: 1rem; }
.total-row { display: flex; justify-content: space-between; align-items: center; font-size: 1.2rem; color: var(--text-muted); margin: 22px 0 18px; border-bottom: 1px solid #dde; padding-bottom: 10px; }

/* Bottom sheet */
.bottom-sheet { background: rgba(255,255,255,0.95); backdrop-filter: blur(16px); width: 100%; max-width: 414px; border-top-left-radius: 20px; border-top-right-radius: 20px; padding: 10px 0; box-shadow: 0 -4px 24px rgba(0,0,0,0.12); animation: slideUp .28s ease-out; border-top: 1.5px solid var(--border); }
.bottom-sheet-item { padding: 14px 20px; font-size: 1rem; color: var(--text-color); cursor: pointer; border-bottom: 1px solid #f0f0f0; font-weight: 600; transition: background .15s; }
.bottom-sheet-item:last-child { border-bottom: none; }
.bottom-sheet-item:hover { background: rgba(33,150,243,0.06); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Amortization table */
.amortization-table { width: 100%; border-collapse: collapse; border-radius: 12px; overflow: hidden; }
.amortization-table th { background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)); color: #fff; padding: 12px 14px; font-size: 0.92rem; text-align: left; font-weight: 800; }
.amortization-table td { padding: 11px 14px; font-size: 0.92rem; color: #555; }
.amortization-table tr:nth-child(even) { background: rgba(33,150,243,0.07); }
.amortization-table tr:nth-child(odd)  { background: #fff; }

/* Payments received */
.payment-item { padding: 14px 18px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.payment-info { display: flex; flex-direction: column; }
.payment-date { font-size: 0.88rem; color: var(--text-muted); }
.payment-status { font-size: 1rem; color: var(--text-color); font-weight: 700; }
.payment-amount-container { display: flex; align-items: center; gap: 14px; }
.payment-amount { font-size: 1.25rem; color: var(--primary-color); font-weight: 900; }

/* Receipt */
.receipt-bg { min-height: calc(100vh - 120px); padding: 28px 14px; display: flex; justify-content: center; align-items: flex-start; }
.thermal-receipt { background: #fff; width: 100%; max-width: 370px; padding: 24px 24px 32px; color: #222; font-family: 'Courier New', monospace; box-shadow: 0 6px 20px rgba(0,0,0,0.18); border-radius: 4px; }
.receipt-brand         { text-align: center; font-size: 1.7rem; color: #555; margin: 8px 0 14px; }
.receipt-title-thermal { text-align: center; font-size: 1rem; font-weight: bold; margin: 8px 0; }
.receipt-divider       { border: none; border-top: 1.5px solid #333; margin: 8px 0; }
.r-left                { text-align: left; font-size: 0.93rem; line-height: 1.6; margin-bottom: 22px; }
.r-center-block        { margin-left: 20%; margin-right: 5%; font-size: 0.93rem; line-height: 1.6; margin-bottom: 22px; }
.r-row, .r-flex-row    { display: flex; justify-content: space-between; }
.r-flex-block          { font-size: 0.93rem; line-height: 1.6; margin: 14px 0; }
.r-footer              { font-size: 0.88rem; line-height: 1.5; margin-top: 14px; }
.btn-action { flex: 1; background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)); color: #fff; border: none; padding: 14px; font-size: 1rem; font-weight: 800; border-radius: 12px; display: flex; justify-content: center; align-items: center; gap: 10px; cursor: pointer; box-shadow: 0 4px 14px rgba(33,150,243,0.28); font-family: 'Nunito', 'Segoe UI', Roboto, Arial, sans-serif; transition: transform .18s; }
.btn-action:hover { transform: translateY(-2px); }
.receipt-actions     { display: flex; gap: 14px; justify-content: center; }
.receipt-container   { display: flex; flex-direction: column; }
.receipt-title       { text-align: center; font-size: 1.4rem; font-weight: 600; color: #333; margin: 8px 0 18px; padding-bottom: 18px; border-bottom: 1px solid #ddd; }
.receipt-client-info { font-size: 1rem; color: #666; line-height: 1.6; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid #ddd; }
.receipt-details     { display: flex; flex-direction: column; gap: 11px; margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid #ddd; }
.receipt-row         { display: flex; justify-content: space-between; }
.receipt-label       { color: #666; font-size: 1rem; }
.receipt-value       { color: #666; font-size: 1rem; }
.receipt-row .bold   { font-weight: 800; color: #555; }

/* Stats/Resumen page */
.summary-card-title { text-align: center; color: var(--text-muted); font-size: 0.85rem; font-weight: 800; letter-spacing: 0.5px; margin-bottom: 18px; }
.summary-row   { display: flex; justify-content: space-between; margin-bottom: 11px; font-size: 1rem; }
.summary-label { color: var(--text-muted); font-weight: 600; }
.summary-value { color: var(--text-color); font-weight: 800; }
.summary-value.text-green { color: var(--primary-color); }

/* Splash */
.splash-body { background: linear-gradient(160deg, #c8e8f8 0%, #ddf3fc 50%, #e8f7fe 100%); background-image: radial-gradient(rgba(33,150,243,0.12) 1.5px, transparent 1.5px); background-size: 28px 28px; margin: 0 auto; max-width: 414px; box-shadow: 0 0 40px rgba(21,101,192,0.18); height: 100vh; display: flex; flex-direction: column; }
.splash-header { background: linear-gradient(135deg, #1565c0, #2196f3); color: #fff; padding: 18px 20px; text-align: left; box-shadow: 0 2px 10px rgba(21,101,192,0.2); }
.splash-header h1 { margin: 0; font-size: 1.35rem; font-weight: 900; letter-spacing: 0.5px; }
.splash-main { flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 30px 24px 40px; }
.splash-center { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.splash-logo { background: linear-gradient(135deg, #1976d2, #42a5f5); width: 160px; height: 160px; border-radius: 50%; display: flex; justify-content: center; align-items: center; border: 4px solid #fff; box-shadow: 0 6px 24px rgba(33,150,243,0.3); margin-bottom: 24px; }
.splash-title    { font-size: 2.6rem; color: #1a2e42; margin: 0 0 4px; font-weight: 400; }
.splash-subtitle { font-size: 1.1rem; color: var(--text-muted); margin: 0; }
.splash-buttons  { display: flex; flex-direction: column; gap: 14px; }
.splash-btn { background: linear-gradient(135deg, var(--primary-light), var(--primary-color)); color: #fff; border: none; padding: 15px; font-size: 1.1rem; font-weight: 800; border-radius: 14px; cursor: pointer; box-shadow: 0 4px 14px rgba(33,150,243,0.3); text-align: center; letter-spacing: 0.3px; font-family: 'Nunito', 'Segoe UI', Roboto, Arial, sans-serif; transition: transform .18s; }
.splash-btn:hover  { transform: translateY(-2px); }
.splash-btn:active { background: linear-gradient(135deg, #5ba3d2, #1976d2); }

/* Helpers */
.text-green { color: var(--primary-color) !important; font-weight: 800; }

/* Animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.card, .round-icon-list-item, .summary-card, .stats-wide-card { animation: fadeUp .35s ease both; }

/* Print */
@media print {
  .footer-nav, header, .back-button { display: none !important; }
  body { background: #fff !important; }
  .receipt-bg { padding: 0; min-height: auto; }
  .thermal-receipt { box-shadow: none; max-width: 100%; padding: 0; }
}

@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }

/* ============================================================
   MEJORA 1 — MODAL DE CONFIRMACIÓN PERSONALIZADO
   ============================================================ */
.pf-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
}
.pf-modal-overlay.visible {
  opacity: 1; pointer-events: all;
}
.pf-modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 20px;
  max-width: 320px; width: 90%;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
  transform: scale(.9) translateY(10px);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
  text-align: center;
}
.pf-modal-overlay.visible .pf-modal-box {
  transform: scale(1) translateY(0);
}
.pf-modal-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: #fff3cd;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.pf-modal-icon.danger { background: #fde8e8; }
.pf-modal-title {
  font-size: 17px; font-weight: 900; color: #1a2e42;
  margin-bottom: 8px;
}
.pf-modal-msg {
  font-size: 14px; color: #64748b;
  line-height: 1.5; margin-bottom: 24px;
}
.pf-modal-actions {
  display: flex; gap: 10px;
}
.pf-btn-cancel {
  flex: 1; padding: 12px;
  border: 1.5px solid #e2e8f0; border-radius: 12px;
  background: #f8fafc; color: #64748b;
  font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.pf-btn-cancel:active { background: #e2e8f0; }
.pf-btn-confirm {
  flex: 1; padding: 12px;
  border: none; border-radius: 12px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff; font-size: 14px; font-weight: 800;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 14px rgba(239,68,68,.35);
  transition: opacity .15s;
}
.pf-btn-confirm:active { opacity: .85; }

/* ============================================================
   MEJORA 2 — CHIPS DE FILTRO EN PRÉSTAMOS
   ============================================================ */
.filter-chips {
  display: flex; gap: 8px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.chip {
  padding: 6px 16px; border-radius: 20px;
  font-size: 13px; font-weight: 700;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc; color: #64748b;
  cursor: pointer; transition: all .15s;
  font-family: inherit;
}
.chip.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 3px 10px rgba(33,150,243,.3);
}

/* ============================================================
   MEJORA 3 — SPLASH SCREEN ANIMADO
   ============================================================ */
#pf-splash {
  position: fixed; inset: 0; z-index: 99999;
  background: linear-gradient(150deg, #0d47a1 0%, #1565c0 55%, #17b6a0 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0;
  transition: opacity .5s ease, transform .5s ease;
}
#pf-splash.hiding {
  opacity: 0; transform: scale(1.04);
  pointer-events: none;
}
.splash-ring {
  width: 110px; height: 110px; border-radius: 32px;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center;
  animation: splashPop .55s cubic-bezier(.34,1.56,.64,1) both;
  backdrop-filter: blur(8px);
}
.splash-name {
  font-size: 34px; font-weight: 900; color: #fff;
  letter-spacing: -.5px; margin-top: 20px;
  animation: splashFade .5s .3s ease both;
}
.splash-tagline {
  font-size: 13px; color: rgba(255,255,255,.65);
  margin-top: 6px;
  animation: splashFade .5s .45s ease both;
}
.splash-dots {
  display: flex; gap: 7px; margin-top: 48px;
  animation: splashFade .5s .6s ease both;
}
.splash-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.4);
  animation: dotPulse 1.2s .7s ease-in-out infinite;
}
.splash-dot:nth-child(2) { animation-delay: .85s; }
.splash-dot:nth-child(3) { animation-delay: 1.0s; }

@keyframes splashPop {
  from { opacity: 0; transform: scale(.65); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes splashFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes dotPulse {
  0%,100% { background: rgba(255,255,255,.35); transform: scale(1); }
  50%      { background: rgba(255,255,255,.9);  transform: scale(1.3); }
}

/* ============================================================
   DARK MODE — [data-theme="dark"]
   ============================================================ */
[data-theme="dark"] {
  --bg:        #0f172a;
  --surface:   #1e293b;
  --card-bg:   #1e293b;
  --border:    #334155;
  --text-color:#e2e8f0;
  --text-muted:#94a3b8;
  --shadow:    0 4px 24px rgba(0,0,0,0.35);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.25);
}

[data-theme="dark"] body {
  background: #0f172a;
  color: #e2e8f0;
}

/* Cards y superficies */
[data-theme="dark"] .card,
[data-theme="dark"] .summary-card,
[data-theme="dark"] .stats-wide-card,
[data-theme="dark"] .round-icon-list-item,
[data-theme="dark"] .aj-card,
[data-theme="dark"] .login-card,
[data-theme="dark"] .modal-sheet,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .pf-modal-box {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

/* Textos principales */
[data-theme="dark"] .aj-name,
[data-theme="dark"] .pf-modal-title,
[data-theme="dark"] .login-card-title,
[data-theme="dark"] .card-text,
[data-theme="dark"] .round-icon-list-item-text,
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3 {
  color: #e2e8f0;
}
[data-theme="dark"] .aj-desc,
[data-theme="dark"] .pf-modal-msg,
[data-theme="dark"] .loan-amount,
[data-theme="dark"] .text-muted { color: #94a3b8; }

/* Inputs y formularios */
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="date"]):not([type="range"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}
[data-theme="dark"] input::placeholder { color: #475569; }
[data-theme="dark"] .custom-select { background-color: #0f172a; color: #e2e8f0; }
[data-theme="dark"] .date-input { color: #e2e8f0; }

/* Separadores y filas */
[data-theme="dark"] .aj-row { border-bottom-color: #334155; }
[data-theme="dark"] .aj-row:active { background: #273549; }

/* Body general en páginas internas */
[data-theme="dark"] main { background-color: transparent !important; }
[data-theme="dark"] .form-container { background: transparent; }

/* Loan list items */
[data-theme="dark"] .loan-list-item { background: #1e293b; }
[data-theme="dark"] .round-icon-list-item-text span { color: #e2e8f0; }
[data-theme="dark"] .loan-id { color: #94a3b8; }

/* Input groups / labels */
[data-theme="dark"] .input-label { color: #94a3b8; }
[data-theme="dark"] .input-group { border-bottom-color: #334155; }

/* Navigation bar */
[data-theme="dark"] .footer-nav { background: #1e293b; border-top-color: #334155; }
[data-theme="dark"] .nav-button { color: #64748b; }
[data-theme="dark"] .nav-button.active { color: var(--primary-color); }

/* Search bar */
[data-theme="dark"] #inputBusqueda,
[data-theme="dark"] #inputBusquedaPrestamo {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

/* Chip filtros */
[data-theme="dark"] .chip {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

/* Summary / dashboard */
[data-theme="dark"] .dashboard-summary-amount { color: var(--primary-color); }

/* Readonly inputs */
[data-theme="dark"] input[readonly] { background: #0f172a !important; color: #94a3b8; }

/* Modal overlay de confirmación */
[data-theme="dark"] .pf-btn-cancel {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

/* Secciones de ajustes */
[data-theme="dark"] .aj-section { color: #475569; }

/* Form icon header */
[data-theme="dark"] .form-icon-header { background: linear-gradient(135deg,#1565c0,#1976d2); }

/* Recibo térmico */
[data-theme="dark"] .thermal-receipt { background: #1e293b; color: #e2e8f0; }
[data-theme="dark"] .receipt-divider { border-color: #334155; }

/* Scrollbar */
[data-theme="dark"] ::-webkit-scrollbar-track { background: #0f172a; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; }

/* ============================================================
   TRANSICIONES DE PÁGINA — Fade suave
   ============================================================ */
body {
  opacity: 0;
  transition: opacity 0.22s ease;
}
body.pf-ready { opacity: 1; }
body.pf-exit  { opacity: 0; transition: opacity 0.18s ease; }

/* ============================================================
   BADGE DE ALERTA — Usado en el card de Cuotas Atrasadas
   ============================================================ */
.badge-alerta {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  border-radius: 11px;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
  z-index: 2;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5),
                0 0 0 0 rgba(239, 68, 68, 0.6);
  }
  50% {
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5),
                0 0 0 8px rgba(239, 68, 68, 0);
  }
}

[data-theme="dark"] .badge-alerta {
  border-color: #1e293b;
}

/* ============================================================
   BANNERS DE PLAN (Trial / Free / Premium) en dashboard
   ============================================================ */
.pf-plan-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}
.pf-plan-banner:active { transform: scale(0.98); }

.pf-banner-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.pf-banner-text {
  flex: 1;
  line-height: 1.3;
}
.pf-banner-text b { font-weight: 800; }

.pf-banner-arrow {
  font-size: 22px;
  font-weight: 300;
  opacity: 0.7;
}
.pf-banner-cta {
  background: rgba(255,255,255,0.25);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Trial: amarillo/naranja suave */
.pf-banner-trial {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #78350f;
  border-left: 4px solid #f59e0b;
}

/* Free: azul informativo */
.pf-banner-free {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  border-left: 4px solid #1565c0;
}
.pf-banner-free .pf-banner-cta {
  background: #1565c0;
  color: #fff;
}

/* Premium: dorado sutil */
.pf-banner-premium {
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  color: #713f12;
  border-left: 4px solid #eab308;
}

/* Dark mode */
[data-theme="dark"] .pf-banner-trial {
  background: linear-gradient(135deg, #422006 0%, #451a03 100%);
  color: #fde68a;
  border-left-color: #f59e0b;
}
[data-theme="dark"] .pf-banner-free {
  background: linear-gradient(135deg, #172554 0%, #1e3a8a 100%);
  color: #bfdbfe;
  border-left-color: #3b82f6;
}
[data-theme="dark"] .pf-banner-premium {
  background: linear-gradient(135deg, #422006 0%, #78350f 100%);
  color: #fde68a;
  border-left-color: #eab308;
}
