@font-face {
  font-family: "Sora";
  src: url("/assets/fonts/Sora-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

/* Iteración pedagógica: Datos, Flujo, créditos y estados */
.flow-reading-guide {
  margin-bottom: 15px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(230px, 1.15fr) repeat(3, minmax(170px, 1fr));
  align-items: stretch;
  gap: 10px;
  background: linear-gradient(145deg, #fff, #fff9fa);
}

.flow-guide-intro,
.flow-guide-step {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.flow-guide-intro > span,
.flow-guide-step > i {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--green), var(--forest));
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.flow-guide-intro .icon { width: 19px; height: 19px; }
.flow-guide-intro small,
.flow-guide-intro h2,
.flow-guide-intro p,
.flow-guide-step small,
.flow-guide-step strong,
.flow-guide-step span { display: block; }
.flow-guide-intro small { color: var(--green); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.flow-guide-intro h2 { margin: 3px 0; font-size: 17px; }
.flow-guide-intro p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }

.flow-guide-step {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.flow-guide-step > .icon {
  position: absolute;
  right: -17px;
  z-index: 2;
  width: 16px;
  height: 16px;
  color: #a5aeb5;
  transform: rotate(-90deg);
}
.flow-guide-step small { color: var(--muted); font-size: 9px; }
.flow-guide-step strong { margin-top: 3px; font-size: 11px; line-height: 1.35; }
.flow-guide-step span { margin-top: 4px; color: var(--green); font-size: 9px; font-weight: 750; }
.flow-guide-step.income > i { background: linear-gradient(145deg, #159b65, #0f704c); }
.flow-guide-step.outflow > i { background: linear-gradient(145deg, #dc6c52, #ad0f2f); }
.flow-guide-step.balance > i { color: #553406; background: linear-gradient(145deg, #ffd98b, #ee9b32); }

.guided-plan-card {
  padding: 0;
  overflow: hidden;
  border-color: rgba(173, 15, 47, .13);
}

.guided-plan-heading {
  padding: 22px 24px 17px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(145deg, #fff, #fff9fa);
}

.guided-plan-heading h2 { margin: 5px 0 6px; font-size: clamp(19px, 2vw, 26px); }
.guided-plan-heading p { max-width: 720px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.guided-plan-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.guided-plan-legend span { padding: 6px 9px; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.guided-plan-legend .editable { color: #7a4a03; background: #fff3d4; }
.guided-plan-legend .calculated { color: #52606a; background: #edf2f6; }
.guided-plan-legend .result { color: #12734d; background: #e5f5ed; }

.guided-plan-path {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-block: 1px solid var(--line);
  color: var(--muted);
  background: #fbfcfc;
}
.guided-plan-path > span { margin-right: 3px; font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.guided-plan-path > div { display: flex; align-items: center; gap: 7px; }
.guided-plan-path i { width: 22px; height: 22px; border-radius: 8px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); font-size: 9px; font-style: normal; font-weight: 850; }
.guided-plan-path strong { color: var(--ink); font-size: 10px; }
.guided-plan-path .icon { width: 14px; height: 14px; margin-left: 3px; transform: rotate(-90deg); color: #a6afb5; }

.plan-month-nav-wrap {
  padding: 15px 20px 10px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
}
.plan-month-nav { display: grid; grid-template-columns: repeat(12, minmax(42px, 1fr)); gap: 5px; overflow-x: auto; padding: 3px; scrollbar-width: thin; }
.plan-month-pill,
.plan-month-arrow {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  transition: transform 180ms ease, color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.plan-month-pill span { display: block; margin-bottom: 2px; color: #9aa4ab; font-size: 7px; }
.plan-month-pill:hover,
.plan-month-arrow:hover { transform: translateY(-2px); color: var(--green); border-color: rgba(173, 15, 47, .24); }
.plan-month-pill.active { color: #fff; border-color: transparent; background: linear-gradient(145deg, var(--green), var(--forest)); box-shadow: 0 7px 17px rgba(49, 9, 20, .18); }
.plan-month-pill.active span { color: var(--lime); }
.plan-month-arrow { display: grid; place-items: center; }
.plan-month-arrow .icon { width: 16px; height: 16px; }
.plan-month-arrow.previous .icon { transform: rotate(90deg); }
.plan-month-arrow.next .icon { transform: rotate(-90deg); }

.guided-month-panels { padding: 8px 24px 22px; }
.guided-month-panel { max-width: 860px; margin: 0 auto; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 14px 35px rgba(65, 17, 30, .08); }
.guided-month-panel[hidden] { display: none; }
.guided-month-panel.active { animation: guidedMonthIn 340ms cubic-bezier(.16, 1, .3, 1) both; }
@keyframes guidedMonthIn { from { opacity: 0; transform: translateX(12px) scale(.99); } to { opacity: 1; transform: translateX(0) scale(1); } }
.guided-month-panel > header { padding: 17px 19px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 34px; align-items: center; gap: 11px; color: #fff; background: radial-gradient(circle at 100% 0, rgba(255, 189, 89, .22), transparent 38%), linear-gradient(145deg, var(--forest), var(--forest-2)); }
.guided-month-number,
.guided-month-calendar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--lime); background: rgba(255, 255, 255, .1); font-size: 10px; font-weight: 850; }
.guided-month-calendar { width: 34px; height: 34px; color: rgba(255,255,255,.8); }
.guided-month-calendar .icon { width: 17px; height: 17px; }
.guided-month-panel header small { color: rgba(255,255,255,.62); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.guided-month-panel header h3 { margin: 3px 0 0; font-size: 18px; }
.guided-month-fields { padding: 16px 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.guided-month-row { min-width: 0; min-height: 72px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f7f9fa; }
.guided-month-row.editable-row { border-color: #efcf87; background: #fffaf0; }
.guided-month-row.result-row { border-color: #b9ddcb; background: #eff8f3; }
.guided-row-copy small,
.guided-row-copy strong,
.guided-row-copy em { display: block; }
.guided-row-copy small { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.guided-row-copy strong { margin-top: 3px; font-size: 11px; }
.guided-row-copy em { margin-top: 3px; color: var(--muted); font-size: 8px; font-style: normal; }
.guided-month-value { color: var(--ink); font-size: 14px; white-space: nowrap; }
.guided-month-input { min-width: 145px; height: 42px; display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; border: 1px solid #e8bc5f; border-radius: 11px; overflow: hidden; background: #fff; }
.guided-month-input i { display: grid; place-items: center; height: 100%; color: #7a4a03; background: #fff1ce; font-size: 10px; font-style: normal; font-weight: 850; }
.guided-month-input input { width: 100%; height: 100%; border: 0; outline: 0; padding: 0 10px; text-align: right; color: var(--ink); background: transparent; font: inherit; font-size: 12px; font-weight: 750; }
.guided-month-input:focus-within { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(238, 155, 50, .14); }
.guided-month-tip { margin: 0 18px 16px; padding: 10px 12px; border-radius: 11px; display: flex; align-items: center; gap: 8px; color: #4e5c66; background: #edf2f6; font-size: 10px; line-height: 1.45; }
.guided-month-tip .icon { width: 16px; height: 16px; flex: 0 0 auto; }

.annual-overview { border-top: 1px solid var(--line); background: #fbfcfc; }
.annual-overview summary { padding: 14px 24px; list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.annual-overview summary::-webkit-details-marker { display: none; }
.annual-overview summary > span { display: grid; grid-template-columns: 24px auto; align-items: center; column-gap: 8px; }
.annual-overview summary .icon { width: 18px; height: 18px; color: var(--green); }
.annual-overview summary > .icon { transition: transform 180ms ease; }
.annual-overview[open] summary > .icon { transform: rotate(180deg); }
.annual-overview summary strong,
.annual-overview summary small { display: block; }
.annual-overview summary strong { font-size: 11px; }
.annual-overview summary small { grid-column: 2; margin-top: 2px; color: var(--muted); font-size: 8px; }
.annual-overview-grid { min-height: 145px; padding: 10px 20px 20px; display: grid; grid-template-columns: repeat(12, minmax(48px, 1fr)); gap: 7px; align-items: end; overflow-x: auto; }
.annual-overview-item { min-width: 48px; padding: 7px 4px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; }
.annual-overview-item:hover { background: #fff; box-shadow: 0 7px 16px rgba(65,17,30,.07); }
.annual-overview-item span,
.annual-overview-item strong { display: block; font-size: 8px; }
.annual-overview-item i { height: 72px; margin: 5px auto; display: flex; align-items: end; justify-content: center; }
.annual-overview-item b { width: 12px; min-height: 4px; border-radius: 5px 5px 2px 2px; background: linear-gradient(to top, var(--forest), var(--green)); box-shadow: 4px 3px 0 rgba(49, 9, 20, .12); transition: height 400ms cubic-bezier(.16,1,.3,1); }
.annual-overview-item strong { color: var(--ink); white-space: nowrap; }

.institution-identity-control { position: relative; }
.institution-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.loan-identity-trigger { min-height: 34px; padding: 0 9px 0 8px; border: 0; border-radius: 11px; display: inline-flex; align-items: center; gap: 6px; color: #fff; cursor: pointer; box-shadow: 0 5px 13px rgba(49, 9, 20, .18); font-size: 9px; font-weight: 800; transition: transform 180ms ease, box-shadow 180ms ease; }
.loan-identity-trigger:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(49, 9, 20, .24); }
.loan-identity-trigger .icon { width: 15px; height: 15px; }
.loan-identity-trigger .icon:last-child { width: 11px; height: 11px; transition: transform 180ms ease; }
.loan-identity-trigger[aria-expanded="true"] .icon:last-child { transform: rotate(180deg); }
.loan-identity-popover { position: absolute; z-index: 35; top: 42px; right: 0; width: min(440px, calc(100vw - 54px)); padding: 14px; border: 1px solid rgba(173, 15, 47, .16); border-radius: 18px; color: var(--ink); background: rgba(255,255,255,.98); box-shadow: 0 24px 55px rgba(49, 9, 20, .22); backdrop-filter: blur(14px); }
.loan-identity-popover[hidden] { display: none; }
.loan-identity-popover.open { animation: identityMenuIn 220ms cubic-bezier(.16,1,.3,1) both; }
@keyframes identityMenuIn { from { opacity: 0; transform: translateY(-7px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.loan-identity-popover-head { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.loan-identity-popover-head strong,
.loan-identity-popover-head small { display: block; }
.loan-identity-popover-head strong { font-size: 12px; }
.loan-identity-popover-head small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.loan-identity-popover-head button { width: 32px; height: 32px; border: 0; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: var(--surface-soft); cursor: pointer; }
.loan-identity-popover-head button .icon { width: 15px; height: 15px; }
.loan-identity-section-label { display: block; margin: 10px 0 7px; color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.loan-identity-popover .loan-icons-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.loan-identity-popover .loan-icon-btn { min-height: 50px; padding: 6px 3px; }
.loan-identity-popover .loan-icon-btn-text { font-size: 8px; }
.loan-identity-popover .loan-color-row { justify-content: space-between; }

.loan-rate-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.loan-rate-unlock { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.loan-rate-unlock input { position: absolute; opacity: 0; pointer-events: none; }
.loan-rate-unlock span { width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center; color: #6f7b83; background: #e9eef1; transition: color 180ms ease, background 180ms ease; }
.loan-rate-unlock span .icon { width: 13px; height: 13px; }
.loan-rate-unlock small { color: var(--muted); font-size: 8px; font-weight: 750; }
.loan-rate-unlock input:checked + span { color: #fff; background: var(--green); }
.protected-rate[readonly] { color: #5d6870; background: #edf2f4; cursor: not-allowed; }
.protected-rate.is-editable { border-color: #edc36d; color: var(--ink); background: #fffaf0; }

.view-only-badge { min-height: 32px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; color: #53616b; background: #edf2f6; font-size: 9px; font-weight: 800; white-space: nowrap; }
.view-only-badge .icon { width: 14px; height: 14px; }
.comparison-depth-chart { overflow: visible; filter: drop-shadow(0 10px 18px rgba(49,9,20,.055)); }
.comparison-area { pointer-events: none; animation: comparisonAreaIn 700ms ease both; }
.comparison-depth-chart .chart-line-sim { stroke-dasharray: 1; stroke-dashoffset: 1; animation: comparisonLineIn 800ms cubic-bezier(.16,1,.3,1) forwards; }
@keyframes comparisonLineIn { to { stroke-dashoffset: 0; } }
@keyframes comparisonAreaIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.comparison-depth-chart .entity-dot { filter: drop-shadow(2px 4px 2px rgba(49,9,20,.2)); }

.report-reading-guide { margin-bottom: 15px; padding: 15px 18px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 10px; }
.report-reading-guide > div { min-height: 58px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 14px; display: flex; align-items: center; gap: 10px; background: #fff; }
.report-reading-guide > i { color: #a5aeb5; }
.report-reading-guide > i .icon { width: 16px; height: 16px; transform: rotate(-90deg); }
.report-reading-guide > div > span { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); }
.report-reading-guide > div > span .icon { width: 17px; height: 17px; }
.report-reading-guide p,
.position-reading-guide p { margin: 0; }
.report-reading-guide small,
.report-reading-guide strong { display: block; }
.report-reading-guide small { color: var(--muted); font-size: 8px; }
.report-reading-guide strong { margin-top: 3px; font-size: 11px; }
.report-reading-guide .result { border-color: #b9ddcb; background: #eff8f3; }
.statement-section-label { padding: 11px 0 6px; color: var(--green); font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .09em; }
.statement-section-label:first-child { padding-top: 0; }
.position-reading-guide { margin-bottom: 15px; padding: 17px 20px; display: flex; align-items: center; gap: 12px; background: linear-gradient(145deg, #fff, #f2f8f5); }
.position-reading-guide > span { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 13px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); }
.position-reading-guide > span .icon { width: 19px; height: 19px; }
.position-reading-guide strong { display: block; font-size: 13px; }
.position-reading-guide p { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.position-summary > div small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; }
.tax-equation-guide { margin-bottom: 15px; padding: 17px 20px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 12px; text-align: center; }
.tax-equation-guide > div { padding: 11px; border-radius: 13px; background: var(--surface-soft); }
.tax-equation-guide > div.result { color: #0f704c; background: #e8f7f0; }
.tax-equation-guide small,
.tax-equation-guide strong { display: block; }
.tax-equation-guide small { color: var(--muted); font-size: 9px; }
.tax-equation-guide strong { margin-top: 5px; font-size: 15px; }
.tax-equation-guide > i { color: var(--green); font-size: 20px; font-style: normal; font-weight: 700; }

@media (max-width: 1050px) {
  .flow-reading-guide { grid-template-columns: 1fr 1fr; }
  .flow-guide-step:nth-last-child(2) > .icon { display: none; }
  .guided-month-fields { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .flow-reading-guide { grid-template-columns: 1fr; }
  .flow-guide-step > .icon { display: none; }
  .guided-plan-heading { align-items: stretch; flex-direction: column; padding: 18px; }
  .guided-plan-legend { justify-content: flex-start; }
  .guided-plan-path { padding: 12px 18px; align-items: flex-start; flex-direction: column; }
  .guided-plan-path > div { width: 100%; }
  .guided-plan-path .icon { margin-left: auto; }
  .plan-month-nav-wrap { padding-inline: 10px; grid-template-columns: 34px minmax(0, 1fr) 34px; }
  .plan-month-nav { grid-template-columns: repeat(12, 48px); }
  .guided-month-panels { padding: 6px 12px 16px; }
  .guided-month-fields { padding: 12px; }
  .guided-month-row { align-items: stretch; flex-direction: column; }
  .guided-month-input { width: 100%; min-width: 0; }
  .guided-month-tip { margin-inline: 12px; }
  .annual-overview summary { padding-inline: 16px; }
  .annual-overview-grid { grid-template-columns: repeat(12, 52px); padding-inline: 12px; }
  .loan-identity-trigger span { display: none; }
  .loan-identity-popover { position: absolute; z-index: 120; top: 42px; right: 0; bottom: auto; left: 0; width: 100%; max-height: min(70vh, 620px); overflow-y: auto; }
  .loan-identity-popover .loan-icons-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .report-reading-guide,
  .tax-equation-guide { grid-template-columns: 1fr; }
  .report-reading-guide > i .icon { transform: none; }
  .tax-equation-guide > i { line-height: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .guided-month-panel.active,
  .loan-identity-popover.open,
  .comparison-area,
  .comparison-depth-chart .chart-line-sim { animation: none !important; }
}

:root {
  color-scheme: light;
  --ink: #2b171d;
  --muted: #78686d;
  --line: #e8dce0;
  --surface: #ffffff;
  --surface-soft: #faf5f6;
  --canvas: #f5f1f2;
  --forest: #310914;
  --forest-2: #520d21;
  --green: #ad0f2f;
  --green-dark: #870923;
  --green-soft: #fbe9ed;
  --lime: #ffbd59;
  --amber: #ee9b32;
  --amber-soft: #fff2dc;
  --red: #c23d3d;
  --red-soft: #fdebed;
  --blue: #4285c5;
  --blue-soft: #e6f1fb;
  --success: #277a5a;
  --success-soft: #e8f5ef;
  --shadow: 0 18px 50px rgba(65, 17, 30, 0.09);
  --shadow-sm: 0 8px 24px rgba(65, 17, 30, 0.07);
  --radius: 22px;
  --radius-sm: 14px;
  --sidebar: 248px;
  font-family: "Sora", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(173, 15, 47, 0.24);
  outline-offset: 2px;
}

.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
              background 200ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1),
              color 200ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 200ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 80%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-25deg);
  transition: left 650ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.btn:hover::before {
  left: 150%;
}

.btn-ghost::before,
.btn-soft::before {
  display: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(1px) scale(0.975);
  transition-duration: 75ms;
}

.btn .icon {
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover .icon {
  transform: scale(1.08);
}

.btn:active .icon {
  transform: scale(0.94);
}

.btn-primary {
  background: linear-gradient(180deg, #be1437 0%, var(--green) 100%);
  color: white;
  box-shadow: 0 8px 22px rgba(173, 15, 47, 0.26);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #cb173c 0%, var(--green-dark) 100%);
  box-shadow: 0 12px 28px rgba(173, 15, 47, 0.38), 0 2px 6px rgba(173, 15, 47, 0.18);
}

.btn-primary:active {
  box-shadow: 0 4px 12px rgba(173, 15, 47, 0.24);
}

.btn-dark {
  background: linear-gradient(180deg, #420f1e 0%, var(--forest) 100%);
  color: white;
  box-shadow: 0 8px 22px rgba(49, 9, 20, 0.24);
}

.btn-dark:hover {
  background: linear-gradient(180deg, #501224 0%, #25070f 100%);
  box-shadow: 0 12px 28px rgba(49, 9, 20, 0.36);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  background: rgba(43, 23, 29, 0.06);
  color: var(--forest);
}

.btn-soft {
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-soft:hover {
  background: #f4ecf0;
  border-color: rgba(173, 15, 47, 0.22);
  color: var(--forest);
  box-shadow: 0 6px 18px rgba(65, 17, 30, 0.06);
}

.btn-soft:active {
  box-shadow: 0 2px 6px rgba(65, 17, 30, 0.04);
}

.btn-danger-soft {
  background: var(--red-soft);
  color: #a93636;
}

.btn-danger-soft:hover {
  background: #fad7dc;
  color: #902626;
  box-shadow: 0 6px 18px rgba(194, 61, 61, 0.15);
}

.btn-logout {
  background: #fff0f3;
  color: #9f1239;
  border: 1px solid #fecdd3;
  font-weight: 700;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-logout:hover {
  background: #e11d48;
  color: #ffffff;
  border-color: #be123c;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.28);
  transform: translateY(-2px);
}

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

.btn-logout .icon {
  width: 15px;
  height: 15px;
  transition: transform 200ms ease;
}

.btn-logout:hover .icon {
  transform: translateX(2px);
}

.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 13px;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
              background 180ms ease,
              color 180ms ease;
}

.btn-icon:hover {
  transform: scale(1.08);
}

.btn-icon:active {
  transform: scale(0.93);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none !important;
  box-shadow: none !important;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1.08fr);
  background: #fbf8f9;
}

.auth-panel {
  padding: clamp(28px, 6vw, 84px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  isolation: isolate;
}

.auth-visual {
  --spot-x: 68%;
  --spot-y: 34%;
  margin: 18px;
  border-radius: 28px;
  min-height: calc(100vh - 36px);
  padding: clamp(36px, 6vw, 76px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background:
    radial-gradient(circle at 86% 4%, rgba(255, 189, 89, 0.45), transparent 32%),
    radial-gradient(circle at 14% 54%, rgba(173, 15, 47, 0.48), transparent 34%),
    linear-gradient(145deg, #651128 0%, #310914 76%);
  color: white;
}

.auth-glow {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle 220px at var(--spot-x) var(--spot-y), rgba(255, 209, 137, 0.3), transparent 74%);
  transition: background 420ms ease-out;
}

.auth-triangle-grid {
  position: absolute;
  z-index: 0;
  inset: -12%;
  display: grid;
  grid-template-columns: repeat(8, minmax(48px, 1fr));
  gap: 5px;
  opacity: 0.34;
  transform: rotate(-7deg) scale(1.08);
  mask-image: linear-gradient(135deg, transparent 4%, black 35%, rgba(0, 0, 0, 0.58) 72%, transparent 98%);
  pointer-events: none;
}

.auth-triangle-grid i {
  aspect-ratio: 1;
  clip-path: polygon(50% 4%, 98% 92%, 2% 92%);
  background: linear-gradient(145deg, rgba(255, 189, 89, 0.28), rgba(173, 15, 47, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-triangle-grid i:nth-child(3n) {
  transform: rotate(180deg);
  opacity: 0.48;
}

.auth-triangle-grid i:nth-child(5n + 1) {
  opacity: 0.18;
}

.auth-visual::before,
.auth-visual::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  z-index: 1;
}

.auth-visual::before {
  width: 420px;
  height: 420px;
  right: -130px;
  top: 90px;
}

.auth-visual::after {
  width: 620px;
  height: 620px;
  right: -220px;
  top: -10px;
}

.visual-copy {
  position: relative;
  z-index: 2;
  max-width: 560px;
}

.visual-copy h2 {
  margin: 18px 0;
  max-width: 520px;
  font-family: "Sora", ui-sans-serif, sans-serif;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.98;
  font-weight: 690;
  letter-spacing: -0.045em;
}

.visual-copy p {
  max-width: 480px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 17px;
  line-height: 1.6;
}

.visual-pill,
.eyebrow {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.visual-pill {
  background: rgba(255, 255, 255, 0.1);
  color: #ffe3b8;
}

.eyebrow {
  padding: 0;
  color: var(--green-dark);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-weight: 900;
  letter-spacing: -0.05em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.brand-name {
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.auth-brand {
  position: absolute;
  z-index: 4;
  top: 32px;
  left: clamp(28px, 6vw, 84px);
}

.demo-access {
  position: absolute;
  z-index: 30;
  top: 28px;
  right: clamp(28px, 4vw, 64px);
}

.demo-access-trigger {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 24px rgba(65, 17, 30, 0.08);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.demo-access-trigger .icon {
  width: 17px;
  height: 17px;
}

.demo-access-trigger .icon:last-child {
  width: 15px;
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.demo-access-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(65, 17, 30, 0.13);
}

.demo-access.open .demo-access-trigger {
  color: white;
  background: var(--forest);
}

.demo-access.open .demo-access-trigger .icon:last-child {
  transform: rotate(180deg);
}

.demo-access-menu {
  width: min(390px, calc(100vw - 40px));
  max-height: calc(100vh - 90px);
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  overflow: auto;
  border: 1px solid rgba(232, 220, 224, 0.95);
  border-radius: 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 70px rgba(13, 36, 24, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  transition: opacity 180ms ease, visibility 180ms ease, transform 320ms cubic-bezier(0.2, 0.85, 0.2, 1);
}

.demo-access.open .demo-access-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.demo-menu-head {
  padding: 20px;
  border-radius: 19px 19px 0 0;
  color: white;
  background:
    radial-gradient(circle at 88% 6%, rgba(255, 189, 89, 0.26), transparent 42%),
    var(--forest);
}

.demo-menu-head span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--lime);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.demo-menu-head span .icon {
  width: 15px;
  height: 15px;
}

.demo-menu-head strong,
.demo-menu-head small {
  display: block;
}

.demo-menu-head strong {
  margin-top: 10px;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.demo-menu-head small {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}

.demo-account-list {
  padding: 10px;
  display: grid;
  gap: 7px;
}

.demo-account {
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 15px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: var(--surface-soft);
  opacity: 0;
  transform: translateY(-7px);
  transition: border-color 170ms ease, background 170ms ease, opacity 220ms ease, transform 320ms cubic-bezier(0.2, 0.85, 0.2, 1);
}

.demo-access.open .demo-account {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(60ms + var(--item-index) * 45ms);
}

.demo-account:hover,
.demo-account:focus-within {
  border-color: #cfe3d6;
  background: #f8fbf8;
}

.demo-role-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  background: var(--green-soft);
}

.demo-role-icon .icon {
  width: 18px;
  height: 18px;
}

.demo-account-copy {
  min-width: 0;
}

.demo-account-copy strong,
.demo-account-copy span,
.demo-account-copy code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-account-copy strong {
  font-size: 12px;
}

.demo-account-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.demo-account-copy code {
  margin-top: 4px;
  color: #526159;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 10px;
}

.demo-account-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.demo-copy,
.demo-enter {
  min-height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 760;
}

.demo-copy {
  width: 34px;
  color: var(--green-dark);
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
}

.demo-copy .icon {
  width: 16px;
  height: 16px;
}

.demo-copy.copied {
  color: white;
  background: var(--green);
  box-shadow: none;
  animation: copied-pop 360ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes copied-pop {
  0% { transform: scale(0.72) rotate(-10deg); }
  68% { transform: scale(1.12) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}

.demo-enter {
  padding: 0 10px;
  gap: 5px;
  color: white;
  background: var(--green-dark);
  font-size: 10px;
}

.demo-enter .icon {
  width: 14px;
  height: 14px;
}

.demo-menu-note {
  margin: 0;
  padding: 4px 18px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.demo-menu-note .icon {
  width: 14px;
  height: 14px;
}

.auth-card {
  width: min(100%, 430px);
  margin: 28px auto 0;
}

.auth-mode-switch {
  margin-bottom: 28px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  background: var(--surface-soft);
}

.auth-mode-button {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.auth-mode-button .icon {
  width: 17px;
  height: 17px;
}

.auth-mode-button:hover {
  color: var(--ink);
}

.auth-mode-button.active {
  color: white;
  background: var(--forest);
  box-shadow: 0 8px 18px rgba(49, 9, 20, 0.16);
}

.auth-mode-button:active {
  transform: scale(0.985);
}

.auth-form-stage {
  animation: auth-stage-in 260ms cubic-bezier(0.2, 0.82, 0.2, 1);
}

@keyframes auth-stage-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-card h1 {
  margin: 14px 0 10px;
  font-size: clamp(32px, 4vw, 46px);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.auth-card > p,
.auth-form-stage > p {
  margin: 0 0 30px;
  color: var(--muted);
  line-height: 1.55;
}

.form-stack {
  display: grid;
  gap: 17px;
}

.guided-form {
  position: relative;
  isolation: isolate;
}

.guided-form > .field,
.guided-form > .btn {
  position: relative;
  z-index: 1;
}

.focus-guide {
  --guide-y: 0px;
  --guide-height: 47px;
  position: absolute;
  z-index: 0;
  top: 0;
  left: -10px;
  right: -10px;
  height: var(--guide-height);
  border: 1px solid rgba(173, 15, 47, 0.13);
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(173, 15, 47, 0.07), rgba(255, 189, 89, 0.1));
  box-shadow: 0 10px 30px rgba(173, 15, 47, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(var(--guide-y)) scale(0.98);
  transition: height 260ms ease, opacity 180ms ease, transform 380ms cubic-bezier(0.2, 0.84, 0.2, 1);
}

.focus-guide.active,
.guided-form:focus-within .focus-guide {
  opacity: 1;
  transform: translateY(var(--guide-y)) scale(1);
}

.glow-action {
  --pointer-x: 50%;
  --pointer-y: 50%;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle 130px at var(--pointer-x) var(--pointer-y), rgba(205, 255, 126, 0.45), transparent 58%),
    linear-gradient(135deg, var(--green), var(--green-dark));
  box-shadow: 0 11px 25px rgba(173, 15, 47, 0.23), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.glow-action::after {
  content: "";
  position: absolute;
  inset: -40% -20%;
  z-index: -1;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.2) 48%, transparent 61%);
  transform: translateX(-70%);
  transition: transform 680ms cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.glow-action:hover {
  background:
    radial-gradient(circle 150px at var(--pointer-x) var(--pointer-y), rgba(205, 255, 126, 0.55), transparent 60%),
    linear-gradient(135deg, var(--green), var(--green-dark));
}

.glow-action:hover::after {
  transform: translateX(70%);
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.field-label {
  font-size: 13px;
  font-weight: 750;
  color: #46524b;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 13px;
  color: var(--ink);
  background: white;
  transition: border 160ms ease, box-shadow 160ms ease;
}

.input,
.select {
  height: 47px;
}

.textarea {
  min-height: 112px;
  padding-block: 12px;
  resize: vertical;
  line-height: 1.5;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #b8c4bd;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(173, 15, 47, 0.1);
  outline: 0;
}

.input::placeholder {
  color: #a6aea9;
}

.input-prefix {
  position: relative;
}

.input-prefix > span {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

.input-prefix .input {
  padding-left: 38px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-footnote {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 24px 17px;
  display: flex;
  flex-direction: column;
  background: var(--forest);
  color: white;
}

.sidebar .brand {
  padding: 0 10px 24px;
}

.sidebar .brand-mark {
  background: var(--lime);
  color: var(--forest);
}

.sidebar-subtitle {
  padding: 16px 12px 8px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav-list {
  display: grid;
  gap: 5px;
}

.nav-item {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  color: rgba(255, 255, 255, 0.66);
  cursor: pointer;
  text-align: left;
  font-weight: 670;
  font-size: 14px;
  transition: color 200ms cubic-bezier(0.16, 1, 0.3, 1),
              background 200ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(3px);
}

.nav-item:active {
  transform: scale(0.97) translateX(2px);
}

.nav-item.active {
  color: white;
  background: rgba(255, 189, 89, 0.16);
  box-shadow: inset 3px 0 0 var(--lime);
}

.nav-item .icon {
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), color 200ms ease;
}

.nav-item:hover .icon {
  transform: scale(1.12);
}

.nav-item.active .icon {
  color: var(--lime);
  transform: scale(1.06);
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-chip {
  margin-top: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip .user-info {
  min-width: 0;
  flex: 1;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: var(--lime);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
  flex-shrink: 0;
}

.user-chip strong,
.user-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 13px;
}

.user-chip small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.btn-sidebar-logout {
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 120, 140, 0.35);
  background: rgba(225, 29, 72, 0.18);
  color: #ffe4e8;
  font-weight: 750;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.16);
  transition: all 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-sidebar-logout:hover {
  background: #e11d48;
  color: #ffffff;
  border-color: rgba(255, 180, 200, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(225, 29, 72, 0.42);
}

.btn-sidebar-logout:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.25);
}

.btn-sidebar-logout .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.app-shell.sidebar-collapsed .sidebar-footer {
  align-items: center;
}

.app-shell.sidebar-collapsed .user-chip {
  padding: 4px;
  justify-content: center;
  background: transparent;
}

.app-shell.sidebar-collapsed .user-info {
  display: none;
}

.app-shell.sidebar-collapsed .btn-sidebar-logout {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  justify-content: center;
}

.app-shell.sidebar-collapsed .btn-sidebar-logout span {
  display: none;
}

.main-area {
  min-width: 0;
}

.topbar {
  height: 78px;
  padding: 0 clamp(20px, 4vw, 52px);
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(245, 241, 242, 0.88);
  backdrop-filter: blur(18px);
}

.topbar-title strong {
  display: block;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.topbar-title span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.mobile-brand {
  display: none;
}

.content {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 18px clamp(20px, 4vw, 52px) 52px;
  animation: pageReveal 440ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes pageReveal {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(14px) scale(0.995);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

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

.page-header {
  margin: 5px 0 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.page-header h1 {
  margin: 6px 0 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.page-header p {
  max-width: 600px;
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.card {
  border: 1px solid rgba(232, 220, 224, 0.92);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 240ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 240ms ease;
}

.kpi-card {
  min-height: 154px;
  padding: 21px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation: cardEntrance 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, box-shadow;
}

.kpi-grid .kpi-card:nth-child(1) { animation-delay: 30ms; }
.kpi-grid .kpi-card:nth-child(2) { animation-delay: 80ms; }
.kpi-grid .kpi-card:nth-child(3) { animation-delay: 130ms; }
.kpi-grid .kpi-card:nth-child(4) { animation-delay: 180ms; }

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(65, 17, 30, 0.11);
}

.kpi-card.highlight {
  border-color: transparent;
  background: var(--forest);
  color: white;
}

.kpi-card.highlight:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 42px rgba(49, 9, 20, 0.32);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.highlight .kpi-top {
  color: rgba(255, 255, 255, 0.58);
}

.kpi-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-tools .info-tip {
  width: 30px;
  height: 30px;
}

.highlight .kpi-tools .info-tip {
  color: white;
  background: rgba(255, 255, 255, 0.09);
}

.kpi-icon {
  width: 35px;
  height: 35px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--green-dark);
  transition: transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1),
              background 240ms ease;
}

.kpi-card:hover .kpi-icon {
  transform: scale(1.14) rotate(-3deg);
}

.highlight .kpi-icon {
  color: var(--lime);
  background: rgba(255, 255, 255, 0.09);
}

.kpi-value {
  margin-top: 16px;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 830;
  letter-spacing: -0.045em;
  transition: color 200ms ease;
}

.kpi-caption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.highlight .kpi-caption {
  color: rgba(255, 255, 255, 0.48);
}

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

.dashboard-grid {
  margin-top: 15px;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 15px;
}

.chart-card,
.panel-card {
  padding: 22px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card-heading > div > .eyebrow {
  display: flex;
  margin-bottom: 6px;
}

.card-heading h2,
.card-heading h3 {
  margin: 0;
  letter-spacing: -0.025em;
}

.card-heading h2 {
  font-size: 18px;
}

.card-heading h3 {
  font-size: 16px;
}

.card-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.chart-wrap {
  height: 260px;
  margin-top: 18px;
  position: relative;
}

.chart-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-gridline {
  stroke: #efe4e7;
  stroke-width: 1;
}

.chart-axis-label {
  fill: #89928d;
  font-size: 10px;
}

.chart-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 4px 8px rgba(173, 15, 47, 0.22));
  animation: chart-draw 950ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.chart-area {
  fill: url(#areaGradient);
  opacity: 0;
  animation: chart-area-in 750ms cubic-bezier(0.22, 1, 0.36, 1) 260ms forwards;
}

.chart-dot {
  fill: white;
  stroke: var(--green);
  stroke-width: 2.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: dot-pop 460ms cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--dot-index, 0) * 42ms + 280ms) both;
  transition: r 240ms cubic-bezier(0.34, 1.56, 0.64, 1),
              stroke-width 240ms ease,
              filter 240ms ease,
              fill 240ms ease,
              stroke 240ms ease;
  cursor: pointer;
}

.chart-dot:hover {
  r: 7;
  stroke-width: 3.5;
  stroke: var(--green-dark);
  fill: var(--lime);
  filter: drop-shadow(0 0 9px rgba(173, 15, 47, 0.55));
}

.chart-dot.selected {
  r: 7.5;
  stroke-width: 3.5;
  stroke: var(--green-dark);
  fill: var(--lime);
  filter: drop-shadow(0 0 11px rgba(173, 15, 47, 0.7));
  animation: selected-dot-pulse 1.8s ease-in-out infinite;
}

@keyframes selected-dot-pulse {
  0%, 100% { r: 7.5; filter: drop-shadow(0 0 11px rgba(173, 15, 47, 0.7)); }
  50% { r: 8.5; filter: drop-shadow(0 0 16px rgba(173, 15, 47, 0.9)); }
}

@keyframes dot-pop {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.mini-bars {
  height: 224px;
  margin-top: 20px;
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.mini-bars:hover .bar-group:not(:hover) {
  opacity: 0.65;
}

.mini-bars.has-selection .bar-group:not(.selected) {
  opacity: 0.28;
  filter: grayscale(0.2);
}

.bar-group {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-rows: 1fr 18px;
  align-items: end;
  gap: 6px;
  cursor: pointer;
  transition: opacity 260ms ease, transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-group:hover {
  transform: translateY(-3px);
}

.bar-group.selected {
  transform: translateY(-4px);
}

.bar-columns {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.bar {
  width: min(13px, 44%);
  min-height: 2px;
  border-radius: 6px 6px 2px 2px;
  transform: scaleY(0);
  transform-origin: center bottom;
  animation: chart-bar-in 600ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--bar-index, 0) * 35ms) forwards;
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1), filter 240ms ease, box-shadow 240ms ease;
}

.bar-group:hover .bar {
  filter: brightness(1.12);
}

.bar-group.selected .bar {
  filter: brightness(1.18);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.bar-group:hover .bar.income,
.bar-group.selected .bar.income {
  box-shadow: 0 5px 14px rgba(39, 122, 90, 0.42);
}

.bar-group:hover .bar.outflow,
.bar-group.selected .bar.outflow {
  box-shadow: 0 5px 14px rgba(173, 15, 47, 0.42);
}

.bar-group.selected .bar-label {
  color: var(--ink);
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes chart-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes chart-area-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes chart-bar-in {
  0% {
    transform: scaleY(0);
    opacity: 0.2;
  }
  70% {
    transform: scaleY(1.03);
    opacity: 1;
  }
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.chart-inspector {
  margin-top: 16px;
  padding: 14px 18px;
  border: 1px solid #e2ece5;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f6faf7 100%);
  box-shadow: 0 4px 18px rgba(20, 40, 29, 0.06);
  animation: inspector-slide-up 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes inspector-slide-up {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e9f0eb;
}

.inspector-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}

.inspector-badge .icon {
  width: 16px;
  height: 16px;
  color: var(--green);
}

.inspector-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #edf3ee;
  color: var(--muted);
  cursor: pointer;
  transition: all 160ms ease;
}

.inspector-close:hover {
  background: #e2ede4;
  color: var(--ink);
  transform: scale(1.1);
}

.inspector-close .icon {
  width: 14px;
  height: 14px;
}

.inspector-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.inspector-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: white;
  border: 1px solid #e8f0ea;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.inspector-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.inspector-item small {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.inspector-item small .icon {
  width: 13px;
  height: 13px;
}

.inspector-item strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.inspector-item.income strong { color: var(--success); }
.inspector-item.outflow strong { color: var(--green); }
.inspector-item.net strong { color: var(--ink); }
.inspector-item.net.negative strong { color: var(--red); }
.inspector-item.balance strong { color: var(--green-dark); }
.inspector-item.balance.negative strong { color: var(--red); }
.inspector-item.igv strong { color: var(--green); }
.inspector-item.renta strong { color: var(--amber); }
.inspector-item.aportes strong { color: var(--blue); }
.inspector-item.pension strong { color: #6366f1; }

.chart-hint-pill {
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #f1f6f2;
  border: 1px dashed #d1e2d6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #4b6b55;
  animation: hint-fade-in 400ms ease both;
}

.chart-hint-pill .icon {
  width: 14px;
  height: 14px;
  color: var(--green);
  animation: hint-sparkle 2.4s ease-in-out infinite;
}

@keyframes hint-sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.2) rotate(12deg); opacity: 1; }
}

@keyframes hint-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}


.bar.income {
  background: linear-gradient(180deg, #329971 0%, var(--success) 100%);
}

.bar.outflow {
  background: linear-gradient(180deg, #be1437 0%, var(--green) 100%);
}

.bar-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.insight-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.insight {
  padding: 14px;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  background: var(--surface-soft);
}

.insight.success {
  background: var(--green-soft);
}

.insight.warning {
  background: var(--amber-soft);
}

.insight.info {
  background: var(--blue-soft);
}

.insight-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.7);
}

.insight strong {
  display: block;
  font-size: 13px;
}

.insight p {
  margin: 4px 0 0;
  color: #57645d;
  font-size: 12px;
  line-height: 1.45;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.section-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-card {
  padding: 22px;
}

.settings-card + .settings-card,
.table-card {
  margin-top: 15px;
}

.field-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.switch-row {
  min-height: 47px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: white;
}

.switch-copy strong,
.switch-copy small {
  display: block;
}

.switch-copy strong {
  font-size: 13px;
}

.switch-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.switch {
  width: 42px;
  height: 24px;
  padding: 3px;
  border-radius: 999px;
  background: #cfd7d2;
  cursor: pointer;
  transition: background 160ms ease;
}

.switch::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.14);
  transition: transform 160ms ease;
}

.switch.on {
  background: var(--green);
}

.switch.on::after {
  transform: translateX(18px);
}

.inline-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  gap: 9px;
  color: #506158;
  background: var(--surface-soft);
  font-size: 12px;
  line-height: 1.5;
}

.table-card {
  overflow: hidden;
}

.table-toolbar {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.table-toolbar h2,
.table-toolbar h3 {
  margin: 0;
  letter-spacing: -0.025em;
}

.table-toolbar h2 {
  font-size: 18px;
}

.table-toolbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.table-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
}

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

.data-table th {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #68746d;
  background: #f8faf8;
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf0ee;
  vertical-align: middle;
}

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

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

.data-table .number {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table .total-row td {
  border-top: 2px solid var(--ink);
  background: #f8faf8;
  font-weight: 800;
}

.month-input {
  width: 112px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0 9px;
  text-align: right;
  background: #f4f7f4;
  font-variant-numeric: tabular-nums;
}

.month-input:hover,
.month-input:focus {
  border-color: var(--green);
  background: white;
  outline: 0;
}

.month-name {
  min-width: 96px;
  font-weight: 720;
}

.auto-badge {
  display: block;
  margin-top: 3px;
  color: var(--green-dark);
  font-size: 9px;
  font-weight: 750;
}

.sticky-actions {
  margin-top: 16px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  position: sticky;
  bottom: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.save-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.loan-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(310px, 0.72fr) minmax(0, 1.28fr);
  gap: 15px;
  align-items: start;
}

.loan-form-card,
.loan-preview-card {
  min-width: 0;
  padding: 22px;
}

.loan-form-card {
  position: sticky;
  top: 96px;
}

.loan-form-card .form-stack,
.loan-form-card .field {
  min-width: 0;
}

.summary-strip {
  margin-top: 19px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.summary-cell {
  padding: 13px;
  border-radius: 13px;
  background: var(--surface-soft);
}

.summary-cell span,
.summary-cell strong {
  display: block;
}

.summary-cell span {
  color: var(--muted);
  font-size: 10px;
}

.summary-cell strong {
  margin-top: 6px;
  font-size: 15px;
}

.saved-loans {
  margin-top: 15px;
  display: grid;
  gap: 10px;
}

.loan-chip {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.loan-chip strong,
.loan-chip span {
  display: block;
}

.loan-chip strong {
  font-size: 13px;
}

.loan-chip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.tabs {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 15px;
  padding: 4px;
  border-radius: 13px;
  display: flex;
  gap: 3px;
  overflow-x: auto;
  background: #dfe5e1;
}

.tab {
  min-height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.tab .icon {
  width: 16px;
  height: 16px;
}

.tab.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 3px 9px rgba(20, 40, 29, 0.08);
}

.statement-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 15px;
}

.report-visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 15px;
  align-items: stretch;
}

.report-visual-card {
  min-width: 0;
  padding: 22px;
  overflow: hidden;
}

.report-chart-stage {
  min-height: 330px;
  display: grid;
  align-items: end;
}

.report-line-chart {
  height: 300px;
}

.report-metric-stack {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 15px;
}

.report-metric {
  min-width: 0;
  padding: 18px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 12px;
}

.report-metric > span {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  background: var(--green-soft);
}

.report-metric small,
.report-metric strong {
  display: block;
}

.report-metric small {
  color: var(--muted);
  font-size: 10px;
}

.report-metric strong {
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 17px;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.report-metric .info-tip {
  width: 28px;
  height: 28px;
}

.report-bars {
  height: 270px;
  padding-top: 20px;
  display: flex;
  align-items: stretch;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 66px, rgba(173, 15, 47, 0.06) 67px);
}

.report-bars:hover .report-bar-group:not(:hover) {
  opacity: 0.55;
}

.report-bars.has-selection .report-bar-group:not(.selected) {
  opacity: 0.28;
}

.report-bar-group {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-rows: 1fr 24px;
  align-items: end;
  gap: 7px;
  cursor: pointer;
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.report-bar-group:hover {
  transform: translateY(-2px);
}

.report-bar-group.selected {
  transform: translateY(-4px);
}

.report-bar-group.selected .report-bar {
  filter: brightness(1.15);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.report-bar-group.selected > span {
  color: var(--ink);
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.report-bar-group > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
  transition: color 200ms ease, font-weight 200ms ease;
}

.report-bar-group:hover > span {
  color: var(--ink);
  font-weight: 800;
}

.report-bar-columns {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.report-bar {
  width: min(10px, 30%);
  height: var(--bar-height);
  border-radius: 5px 5px 2px 2px;
  transform: scaleY(0);
  transform-origin: center bottom;
  animation: chart-bar-in 540ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--bar-index, 0) * 38ms) forwards;
  transition: filter 200ms ease, box-shadow 200ms ease;
}

.report-bar-group:hover .report-bar {
  filter: brightness(1.12);
}

.report-bar.igv,
.report-legend i.igv {
  background: var(--green);
}

.report-bar-group:hover .report-bar.igv {
  box-shadow: 0 4px 12px rgba(173, 15, 47, 0.35);
}

.report-bar.renta,
.report-legend i.renta {
  background: var(--amber);
}

.report-bar-group:hover .report-bar.renta {
  box-shadow: 0 4px 12px rgba(238, 155, 50, 0.35);
}

.report-bar.aportes,
.report-legend i.aportes {
  background: var(--blue);
}

.report-bar-group:hover .report-bar.aportes {
  box-shadow: 0 4px 12px rgba(66, 133, 197, 0.35);
}

.report-legend {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
  font-size: 10px;
}

.report-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.report-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.result-bars {
  min-height: 290px;
  display: grid;
  align-content: center;
  gap: 22px;
}

.result-bar-row {
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.result-bar-row:hover {
  transform: translateX(3px);
}

.result-bar-row > div:first-child {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  font-size: 12px;
}

.result-bar-track {
  height: 13px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-soft);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.result-bar-track i {
  width: var(--bar-width);
  height: 100%;
  border-radius: inherit;
  display: block;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
  transform: scaleX(0);
  transform-origin: left center;
  animation: report-result-in 650ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--bar-index, 0) * 90ms) forwards;
  transition: filter 200ms ease;
}

.result-bar-row:hover .result-bar-track i {
  filter: brightness(1.1);
}

.result-bar-track i.gross {
  background: linear-gradient(90deg, #8f1d38, #d54a66);
}

.result-bar-track i.pretax {
  background: linear-gradient(90deg, #b96b19, var(--amber));
}

.result-bar-track i.net {
  background: linear-gradient(90deg, #18593e, var(--success));
}

.result-bar-track i.negative {
  background: linear-gradient(90deg, #7e1227, var(--red));
}

@keyframes report-result-in {
  0% { transform: scaleX(0); }
  85% { transform: scaleX(1.02); }
  100% { transform: scaleX(1); }
}

.statement-list {
  margin-top: 14px;
}

.statement-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  font-size: 13px;
}

.statement-row > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.statement-row > span:first-child .icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
  opacity: 0.85;
  flex-shrink: 0;
}

.statement-row.indent span:first-child {
  padding-left: 16px;
  color: var(--muted);
}

.statement-row.total {
  border-top: 2px solid var(--ink);
  border-bottom: 0;
  font-weight: 850;
}

.statement-row strong {
  font-variant-numeric: tabular-nums;
}

.search-box {
  width: min(360px, 100%);
  position: relative;
}

.search-box .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-box .input {
  padding-left: 42px;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-cell .avatar {
  width: 36px;
  height: 36px;
  background: var(--green-soft);
  color: var(--green-dark);
}

.user-cell strong,
.user-cell small {
  display: block;
}

.user-cell small {
  margin-top: 3px;
  color: var(--muted);
}

.badge {
  padding: 6px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.active,
.badge.usuario {
  color: var(--green-dark);
  background: var(--green-soft);
}

.badge.inactive {
  color: #8f4949;
  background: var(--red-soft);
}

.badge.master {
  color: #80591a;
  background: var(--amber-soft);
}

.badge.gestor {
  color: #2d6696;
  background: var(--blue-soft);
}

.support-badge {
  padding: 7px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 760;
  white-space: nowrap;
}

.support-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.support-badge.pending {
  color: #8a5b18;
  background: var(--amber-soft);
}

.support-badge.in_progress {
  color: #2d6696;
  background: var(--blue-soft);
}

.support-badge.resolved {
  color: var(--success);
  background: var(--success-soft);
}

.actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

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

.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 13px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  background: var(--green-soft);
}

.empty-state h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.empty-state p {
  max-width: 420px;
  margin: 7px auto 0;
  font-size: 12px;
  line-height: 1.5;
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--forest);
  color: white;
}

.loading-inner {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.loading-inner .brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--lime);
  color: var(--forest);
  animation: pulse 1.3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.92); opacity: 0.7; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(10, 24, 17, 0.62);
  backdrop-filter: blur(8px);
  animation: modalBackdropIn 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.modal {
  width: min(100%, 500px);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  border-radius: 24px;
  padding: 24px;
  background: white;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  animation: modalContentIn 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modalBackdropIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(8px); }
}

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

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.modal-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.modal .form-stack {
  margin-top: 22px;
}

.modal-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.import-modal {
  width: min(100%, 720px);
}

.import-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.import-summary > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  background: var(--surface-soft);
}

.import-summary span {
  grid-row: 1 / 3;
  color: var(--green-dark);
}

.import-summary strong,
.import-summary small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-summary strong {
  font-size: 14px;
}

.import-summary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.import-summary .income span {
  color: var(--success);
}

.import-summary .expense span {
  color: var(--red);
}

.import-preview {
  max-height: 260px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.import-preview .data-table th:first-child,
.import-preview .data-table td:first-child {
  padding-left: 14px;
}

.type-badge {
  padding: 5px 8px;
  border-radius: 999px;
  display: inline-flex;
  font-size: 10px;
  font-weight: 800;
}

.type-badge.income {
  color: var(--success);
  background: var(--success-soft);
}

.type-badge.expense {
  color: var(--green-dark);
  background: var(--green-soft);
}

.import-more {
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 9px;
}

.toast {
  width: min(360px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: white;
  background: var(--forest);
  box-shadow: 0 18px 40px rgba(8, 25, 16, 0.28);
  animation: toast-in 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.toast.error {
  background: #8b3030;
}

.toast.success {
  background: var(--green-dark);
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  font-size: 13px;
}

.toast span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.auth-partners {
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-partners img {
  width: min(205px, 42%);
  height: 66px;
  padding: 10px 12px;
  border-radius: 16px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(26, 2, 9, 0.18);
}

.auth-partners img:first-child {
  width: min(180px, 38%);
}

.sidebar-head {
  min-height: 50px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-head .brand {
  min-width: 0;
  padding: 0 0 20px 4px;
}

.sidebar-toggle {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.56);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.sidebar-toggle:hover {
  color: white;
  background: rgba(255, 255, 255, 0.13);
  transform: scale(1.04);
}

.sidebar-project {
  margin: 8px 4px 0;
  padding: 9px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.055);
  font-size: 10px;
  line-height: 1.35;
}

.sidebar-project img {
  width: 52px;
  height: 28px;
  padding: 4px;
  border-radius: 7px;
  object-fit: contain;
  background: white;
}

.app-shell,
.sidebar {
  transition: grid-template-columns 300ms cubic-bezier(0.2, 0.8, 0.2, 1), padding 300ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 82px minmax(0, 1fr);
}

.sidebar-collapsed .sidebar {
  padding-inline: 13px;
}

.sidebar-collapsed .sidebar-head {
  justify-content: center;
}

.sidebar-collapsed .sidebar-head .brand,
.sidebar-collapsed .sidebar-subtitle,
.sidebar-collapsed .nav-item span,
.sidebar-collapsed .sidebar-project,
.sidebar-collapsed .user-chip > div:nth-child(2),
.sidebar-collapsed .user-chip .btn-icon,
.sidebar-collapsed .user-chip .btn-chip-logout {
  display: none;
}

.sidebar-collapsed .sidebar-toggle {
  margin-top: 4px;
}

.sidebar-collapsed .nav-item {
  padding: 0;
  justify-content: center;
}

.sidebar-collapsed .user-chip {
  display: flex;
  justify-content: center;
  padding-inline: 0;
}

.title-with-tip,
.label-with-tip,
.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-heading h2,
.table-toolbar h2,
.title-with-tip h1,
.title-with-tip h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card-heading h2 .icon,
.table-toolbar h2 .icon,
.title-with-tip h1 .icon,
.title-with-tip h2 .icon {
  width: 20px;
  height: 20px;
  color: var(--green);
  flex-shrink: 0;
}

.info-tip {
  width: 31px;
  height: 31px;
  padding: 0;
  border-radius: 10px;
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--green-dark);
  background: var(--green-soft);
  cursor: help;
}

.info-tip .icon {
  width: 16px;
  height: 16px;
}

.floating-tooltip {
  width: max-content;
  max-width: min(340px, calc(100vw - 16px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  position: fixed;
  z-index: 10000;
  left: 8px;
  top: 8px;
  color: white;
  background: rgba(49, 9, 20, 0.98);
  box-shadow: 0 20px 55px rgba(27, 3, 10, 0.34);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(5px) scale(0.98);
  transform-origin: center bottom;
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  font-size: 11px;
  font-weight: 520;
  line-height: 1.5;
  text-align: left;
}

.floating-tooltip[data-placement="bottom"] {
  transform-origin: center top;
}

.floating-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.tooltip-copy + .tooltip-formulas {
  margin-top: 10px;
}

.tooltip-formulas {
  display: grid;
  gap: 8px;
}

.tooltip-formulas > div {
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
}

.tooltip-formulas span,
.tooltip-formulas small {
  display: block;
  color: rgba(255, 255, 255, 0.64);
  font-size: 9px;
}

.tooltip-formulas math {
  margin-top: 4px;
  color: white;
  font-family: "Cambria Math", "STIX Two Math", serif;
  font-size: 17px;
}

.tooltip-formulas small {
  padding-inline: 2px;
}

.btn-income,
.btn-expense {
  min-height: 52px;
  color: white;
  position: relative;
  overflow: hidden;
  font-weight: 750;
  letter-spacing: -0.01em;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1),
              filter 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-income {
  background: linear-gradient(135deg, #2e906a 0%, var(--success) 100%);
  box-shadow: 0 10px 24px rgba(39, 122, 90, 0.28);
}

.btn-income:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #35a479 0%, #20674c 100%);
  box-shadow: 0 14px 32px rgba(39, 122, 90, 0.42), 0 3px 8px rgba(39, 122, 90, 0.2);
  filter: brightness(1.03);
}

.btn-income:active {
  transform: translateY(1px) scale(0.975);
  box-shadow: 0 4px 12px rgba(39, 122, 90, 0.25);
}

.btn-expense {
  background: linear-gradient(135deg, #be1437 0%, var(--green) 100%);
  box-shadow: 0 10px 24px rgba(173, 15, 47, 0.28);
}

.btn-expense:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #cc183c 0%, var(--green-dark) 100%);
  box-shadow: 0 14px 32px rgba(173, 15, 47, 0.42), 0 3px 8px rgba(173, 15, 47, 0.2);
  filter: brightness(1.03);
}

.btn-expense:active {
  transform: translateY(1px) scale(0.975);
  box-shadow: 0 4px 12px rgba(173, 15, 47, 0.25);
}

.action-pulse {
  position: relative;
  isolation: isolate;
}

.action-pulse::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border: 1px solid currentColor;
  border-radius: inherit;
  opacity: 0;
  animation: action-ring 2.8s ease-out infinite;
}

@keyframes action-ring {
  0%, 45% { transform: scale(1); opacity: 0; }
  55% { opacity: 0.34; }
  90%, 100% { transform: scale(1.13, 1.32); opacity: 0; }
}

.chart-switch {
  padding: 4px;
  border-radius: 13px;
  display: flex;
  gap: 3px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.chart-switch button {
  min-height: 35px;
  padding: 0 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-switch button:hover:not(.active) {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.chart-switch button:active {
  transform: scale(0.96);
}

.chart-switch button.active {
  color: white;
  background: var(--green);
  box-shadow: 0 5px 14px rgba(173, 15, 47, 0.22);
  transform: scale(1.02);
}

.chart-switch .icon {
  width: 15px;
  height: 15px;
  transition: transform 200ms ease;
}

.chart-switch button:hover .icon {
  transform: scale(1.1);
}

.dashboard-chart-stage {
  min-height: 260px;
  animation: chartStageIn 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.movement-quick-entry {
  position: relative;
  margin-bottom: 15px;
  padding: clamp(20px, 3vw, 30px);
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 0, rgba(238, 155, 50, 0.13), transparent 30%),
    linear-gradient(145deg, #fff, #fff9fa);
}

.movement-quick-entry::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -145px;
  top: -145px;
  border: 28px solid rgba(173, 15, 47, 0.035);
  border-radius: 50%;
  pointer-events: none;
}

.movement-quick-intro {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.movement-quick-intro h2 {
  margin: 6px 0 7px;
  font-size: clamp(20px, 2.5vw, 30px);
  letter-spacing: -0.035em;
}

.movement-quick-intro p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.movement-quick-groups {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.movement-quick-group {
  padding: 16px;
  border: 1px solid rgba(24, 119, 82, 0.14);
  border-radius: 20px;
  background: rgba(244, 251, 247, 0.72);
}

.movement-quick-group.expense {
  border-color: rgba(173, 15, 47, 0.13);
  background: rgba(255, 246, 248, 0.78);
}

.movement-quick-heading {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.movement-quick-heading-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--success);
  background: #fff;
  box-shadow: 0 8px 18px rgba(27, 108, 77, 0.1);
}

.movement-quick-group.expense .movement-quick-heading-icon {
  color: var(--green);
  box-shadow: 0 8px 18px rgba(173, 15, 47, 0.1);
}

.movement-quick-heading-icon .icon {
  width: 19px;
  height: 19px;
}

.movement-quick-heading strong,
.movement-quick-heading small {
  display: block;
}

.movement-quick-heading strong {
  font-size: 14px;
}

.movement-quick-heading small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.movement-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.movement-category-card {
  min-width: 0;
  min-height: 68px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--category-color) 22%, white);
  border-radius: 15px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 6px 16px rgba(65, 17, 30, 0.045);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
  animation: quickCategoryIn 420ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--category-index, 0) * 45ms + 80ms) both;
}

.movement-category-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--category-color) 52%, white);
  background: color-mix(in srgb, var(--category-color) 4%, white);
  box-shadow: 0 14px 28px color-mix(in srgb, var(--category-color) 13%, transparent);
}

.movement-category-card:active {
  transform: translateY(-1px) scale(0.985);
}

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

.movement-category-icon,
.movement-category-arrow {
  display: grid;
  place-items: center;
  color: var(--category-color);
}

.movement-category-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--category-color) 11%, white);
}

.movement-category-icon .icon {
  width: 19px;
  height: 19px;
}

.movement-category-arrow {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--category-color) 8%, white);
  transition: transform 180ms ease;
}

.movement-category-card:hover .movement-category-arrow {
  transform: rotate(90deg) scale(1.06);
}

.movement-category-arrow .icon {
  width: 14px;
  height: 14px;
}

.movement-category-copy,
.movement-category-copy strong,
.movement-category-copy small {
  min-width: 0;
  display: block;
}

.movement-category-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.movement-category-empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 10px;
}

.movement-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.movement-summary {
  min-height: 104px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 19px;
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  background: white;
  box-shadow: var(--shadow-sm);
  text-align: left;
}

button.movement-summary {
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

button.movement-summary:hover {
  transform: translateY(-2px);
  border-color: #d4b6bf;
  box-shadow: var(--shadow);
}

.movement-summary-icon,
.movement-icon,
.audit-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.movement-summary.income .movement-summary-icon {
  color: var(--success);
  background: var(--success-soft);
}

.movement-summary.expense .movement-summary-icon {
  color: var(--green);
  background: var(--green-soft);
}

.movement-summary.balance .movement-summary-icon,
.movement-summary.category-action .movement-summary-icon {
  color: #7c4c10;
  background: var(--amber-soft);
}

.movement-summary small,
.movement-summary strong {
  display: block;
}

.movement-summary small {
  color: var(--muted);
  font-size: 10px;
}

.movement-summary strong {
  margin-top: 6px;
  font-size: clamp(14px, 1.5vw, 19px);
  letter-spacing: -0.03em;
}

.movement-layout {
  margin-top: 15px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
  gap: 15px;
  align-items: start;
}

.movement-list-card {
  overflow: hidden;
}

.movement-chart-card {
  padding: 22px;
  position: sticky;
  top: 96px;
}

.movement-chart-heading {
  align-items: center;
}

.movement-chart-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.compact-select {
  width: auto;
  min-width: 112px;
  height: 38px;
  padding: 0 32px 0 11px;
  font-size: 11px;
  font-weight: 750;
}

.movement-toolbar {
  padding-block: 14px;
}

.sheet-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.user-sheet-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.sheet-action {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink);
  background: white;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms ease;
}

.sheet-action:hover {
  color: var(--green-dark);
  border-color: rgba(173, 15, 47, 0.3);
  background: var(--green-soft);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(173, 15, 47, 0.1);
}

.sheet-action:active {
  transform: translateY(1px) scale(0.97);
}

.sheet-action .icon {
  width: 16px;
  height: 16px;
}

.excel-action {
  color: #176b43;
}

.excel-action .icon + .icon {
  width: 12px;
  height: 12px;
  margin-left: -4px;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-pill {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  transition: color 180ms ease, background 180ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms ease;
}

.filter-pill:hover {
  color: var(--ink);
  background: #f0e6e9;
  transform: translateY(-1px);
}

.filter-pill:active {
  transform: translateY(1px) scale(0.97);
}

.filter-pill.active {
  color: white;
  background: var(--forest);
  box-shadow: 0 4px 12px rgba(49, 9, 20, 0.22);
}

.filter-pill .icon {
  width: 15px;
  height: 15px;
}

.count-pill {
  min-width: 34px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 800;
}

.movement-list {
  display: grid;
}

.movement-row {
  min-width: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 12px;
  transition: background 180ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
  animation: rowSlideIn 320ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--row-index, 0) * 28ms) both;
}

.movement-row:hover {
  background: #fcf6f8;
  transform: translateX(4px);
}

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

.movement-icon {
  color: var(--category-color);
  background: color-mix(in srgb, var(--category-color) 13%, white);
}

.movement-copy,
.movement-copy strong,
.movement-copy span {
  min-width: 0;
  display: block;
}

.movement-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.movement-copy span {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.movement-amount {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.movement-amount.income {
  color: var(--success);
}

.movement-amount.expense {
  color: var(--green-dark);
}

.row-action {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.row-action:hover {
  color: var(--green-dark);
  background: var(--green-soft);
}

.donut-layout {
  margin-top: 22px;
  display: grid;
  justify-items: center;
  gap: 18px;
}

.donut-scene {
  position: relative;
  width: min(210px, 75%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  perspective: 760px;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.donut-scene:hover {
  transform: translateY(-5px) scale(1.025);
}

.donut {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  background: conic-gradient(var(--donut));
  box-shadow: 0 22px 30px rgba(49, 9, 20, 0.18), inset 0 3px 4px rgba(255, 255, 255, 0.38);
  transform: rotateX(48deg) rotateZ(-9deg);
  transform-style: preserve-3d;
  animation: donut-in 650ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: #6d2638;
  transform: translateZ(-15px) translateY(13px);
  filter: saturate(0.82);
}

.donut-center {
  z-index: 2;
  width: 54%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-content: center;
  color: var(--ink);
  background: linear-gradient(145deg, #fff, #f8f3f4);
  text-align: center;
  box-shadow: 0 8px 24px rgba(49, 9, 20, 0.12), inset 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.donut-scene:hover .donut-center {
  transform: scale(1.035);
}

.donut-center strong,
.donut-center span {
  display: block;
}

.donut-center strong {
  font-size: 14px;
}

.donut-center span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

@keyframes donut-in {
  from { opacity: 0; transform: rotateX(58deg) rotateZ(-45deg) scale(0.72); }
  to { opacity: 1; transform: rotateX(48deg) rotateZ(-9deg) scale(1); }
}

.donut-scene.has-selection {
  animation: donut-pulse 2.2s ease-in-out infinite;
}

@keyframes donut-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.donut-legend {
  width: 100%;
  display: grid;
  gap: 9px;
}

.donut-legend > button {
  width: 100%;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 180ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1), border-color 180ms ease, box-shadow 180ms ease;
}

.donut-legend > button:hover {
  background: var(--surface-soft);
  transform: translateX(4px);
}

.donut-legend > button.selected {
  background: #f1f7f3;
  border-color: #c7ded0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transform: translateX(6px);
}

.donut-legend > button.selected strong {
  color: var(--green-dark);
}

.donut-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.donut-legend span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.category-drilldown {
  width: 100%;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--category-color) 22%, var(--line));
  border-radius: 15px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--category-color) 6%, white), white);
  animation: categoryDrilldownIn 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.category-drilldown-head,
.category-mini-kpis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.category-drilldown-head strong,
.category-drilldown-head span,
.category-mini-kpis small,
.category-mini-kpis strong {
  display: block;
}

.category-drilldown-head strong {
  margin-top: 3px;
  font-size: 13px;
}

.category-drilldown-head > span {
  color: var(--muted);
  font-size: 9px;
}

.category-mini-bars {
  height: 92px;
  margin: 15px 0 12px;
  display: flex;
  align-items: end;
  gap: 4px;
}

.category-mini-bars > span {
  height: 100%;
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 13px;
  align-items: end;
  gap: 4px;
}

.category-mini-bars i {
  width: 100%;
  min-height: 2px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(to top, color-mix(in srgb, var(--category-color) 78%, #38121e), var(--category-color));
  animation: miniBarGrow 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.category-mini-bars small {
  color: var(--muted);
  font-size: 7px;
  text-align: center;
}

.category-mini-kpis {
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--category-color) 16%, transparent);
}

.category-mini-kpis > span:last-child {
  text-align: right;
}

.category-mini-kpis small { color: var(--muted); font-size: 8px; }
.category-mini-kpis strong { margin-top: 3px; font-size: 11px; }

@keyframes categoryDrilldownIn {
  from { opacity: 0; transform: translateY(9px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes miniBarGrow {
  from { transform: scaleY(0); transform-origin: bottom; }
  to { transform: scaleY(1); transform-origin: bottom; }
}

.empty-state.compact {
  padding: 28px 14px;
}

.movement-modal {
  width: min(100%, 760px);
  max-height: min(92vh, 760px);
  overflow-y: auto;
}

.movement-type-switch {
  padding: 5px;
  border-radius: 15px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  background: var(--surface-soft);
}

.movement-type-switch button {
  min-height: 45px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 760;
}

.movement-type-switch button.active {
  color: white;
}

.movement-type-switch button.income {
  background: var(--success);
}

.movement-type-switch button.expense {
  background: var(--green);
}

.movement-category-field {
  gap: 9px;
}

.movement-category-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.movement-category-option {
  min-width: 0;
  min-height: 58px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  column-gap: 9px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  animation: quickCategoryIn 340ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--category-index, 0) * 38ms) both;
}

.movement-category-option > span {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--category-color);
  background: color-mix(in srgb, var(--category-color) 11%, white);
}

.movement-category-option > span .icon {
  width: 17px;
  height: 17px;
}

.movement-category-option strong {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movement-category-option strong {
  font-size: 12px;
}

.movement-category-option:hover,
.movement-category-option.active {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--category-color) 52%, white);
  background: color-mix(in srgb, var(--category-color) 5%, white);
  box-shadow: 0 9px 20px color-mix(in srgb, var(--category-color) 11%, transparent);
}

.movement-category-option.active {
  outline: 2px solid color-mix(in srgb, var(--category-color) 42%, transparent);
  outline-offset: 1px;
}

.movement-category-option.empty {
  grid-template-columns: 34px minmax(0, 1fr);
  --category-color: var(--green);
}

.movement-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(190px, 0.65fr);
  align-items: end;
  gap: 12px;
}

.movement-amount-field {
  gap: 7px;
}

.movement-date-input {
  height: 66px;
  font-size: 14px;
  font-weight: 720;
}

.movement-category-explanation {
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--category-color) 20%, var(--line));
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: color-mix(in srgb, var(--category-color) 5%, white);
  animation: categoryDrilldownIn 240ms ease both;
}

.movement-category-explanation > span {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--category-color);
  background: color-mix(in srgb, var(--category-color) 12%, white);
}

.movement-category-explanation strong,
.movement-category-explanation p {
  display: block;
  margin: 0;
}

.movement-category-explanation strong { font-size: 11px; }
.movement-category-explanation p { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.movement-category-explanation.empty { color: var(--muted); --category-color: var(--green); font-size: 10px; }

.amount-field {
  height: 66px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  box-shadow: inset 0 0 0 4px var(--surface-soft);
}

.amount-field span {
  color: var(--green-dark);
  font-size: 23px;
  font-weight: 800;
}

.amount-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 780;
  letter-spacing: -0.06em;
}

.amount-field input::placeholder {
  color: #d7c9cd;
}

.optional {
  color: var(--muted);
  font-size: 9px;
  font-weight: 550;
}

.color-input {
  width: 100%;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 5px;
  background: white;
}

.bank-field {
  gap: 9px;
}

.institution-input {
  position: relative;
}

.institution-input > .icon {
  position: absolute;
  z-index: 1;
  left: 14px;
  top: 50%;
  width: 19px;
  height: 19px;
  color: var(--green-dark);
  transform: translateY(-50%);
  pointer-events: none;
}

.institution-input .input {
  padding-left: 45px;
  font-weight: 700;
}

.label-with-tip {
  justify-content: space-between;
}

.label-with-tip .info-tip {
  width: 27px;
  height: 27px;
}

.bank-picker {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: 208px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: grid;
  gap: 4px;
  overflow-y: auto;
  background: var(--surface-soft);
  scrollbar-width: thin;
}

.bank-option {
  width: 100%;
  min-width: 0;
  min-height: 47px;
  padding: 5px 8px;
  border-radius: 11px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
}

.bank-option:hover {
  background: white;
}

.bank-option.selected {
  color: var(--green-dark);
  background: white;
  box-shadow: 0 4px 12px rgba(65, 17, 30, 0.08);
}

.bank-option > .icon {
  width: 16px;
  height: 16px;
}

.bank-option > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  background: linear-gradient(145deg, var(--forest-2), var(--green));
  font-size: 9px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.bank-caja-cusco {
  color: #591522;
  background: linear-gradient(145deg, #ffd35e, #f2a42f);
}

.bank-bcp,
.bank-bbva {
  background: linear-gradient(145deg, #174ea6, #2979d6);
}

.bank-interbank {
  background: linear-gradient(145deg, #057448, #23b676);
}

.bank-mibanco {
  background: linear-gradient(145deg, #74226f, #ba4aad);
}

.bank-context {
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.bank-context .bank-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.loan-chip {
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.audit-card {
  margin-top: 15px;
  padding: 22px;
}

.tour-admin-card {
  margin-bottom: 15px;
  min-height: 190px;
  padding: 22px 26px 22px 18px;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  border-color: rgba(173, 15, 47, 0.17);
  background:
    radial-gradient(circle at 8% 42%, rgba(255, 189, 89, 0.2), transparent 25%),
    linear-gradient(135deg, #fff 0%, #fff8fa 56%, #fbe9ed 100%);
}

.tour-admin-card::after {
  content: "";
  width: 260px;
  height: 260px;
  position: absolute;
  z-index: -1;
  right: -110px;
  top: -130px;
  border-radius: 50%;
  border: 34px solid rgba(173, 15, 47, 0.05);
}

.tour-admin-visual {
  min-height: 146px;
  position: relative;
  display: grid;
  place-items: center;
}

.tour-admin-visual img {
  width: 152px;
  height: 152px;
  position: relative;
  z-index: 1;
  object-fit: contain;
  filter: drop-shadow(0 16px 18px rgba(93, 12, 31, 0.2));
}

.tour-admin-halo {
  width: 132px;
  height: 132px;
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 189, 89, 0.23);
  box-shadow: 0 0 0 16px rgba(173, 15, 47, 0.055);
}

.tour-admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.tour-admin-copy h2 {
  margin: 7px 0 6px;
  font-size: clamp(20px, 2.4vw, 29px);
  letter-spacing: -0.035em;
}

.tour-admin-copy p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.tour-status {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 800;
}

.tour-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.tour-status.active {
  color: var(--success);
  background: var(--success-soft);
}

.tour-status.paused {
  color: #9b661b;
  background: var(--amber-soft);
}

.tour-admin-actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.guided-tour-open {
  overscroll-behavior: none;
}

.guided-tour-layer {
  position: fixed;
  z-index: 20000;
  inset: 0;
  touch-action: none;
}

.guided-tour-spotlight {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  border: 3px solid rgba(255, 189, 89, 0.96);
  border-radius: 17px;
  background: transparent;
  box-shadow:
    0 0 0 9999px rgba(31, 8, 16, 0.77),
    0 0 0 7px rgba(255, 189, 89, 0.18),
    0 14px 36px rgba(0, 0, 0, 0.28);
  transition: top 260ms cubic-bezier(0.16, 1, 0.3, 1),
              left 260ms cubic-bezier(0.16, 1, 0.3, 1),
              width 260ms cubic-bezier(0.16, 1, 0.3, 1),
              height 260ms cubic-bezier(0.16, 1, 0.3, 1);
  animation: guidedSpotlightPulse 1.9s ease-in-out infinite;
}

@keyframes guidedSpotlightPulse {
  0%, 100% {
    border-color: rgba(255, 189, 89, 0.92);
  }
  50% {
    border-color: #ffffff;
  }
}

.guided-tour-bubble {
  width: min(470px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 22px;
  position: fixed;
  z-index: 2;
  overflow: auto;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 5px 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  outline: none;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 26px 70px rgba(23, 4, 10, 0.38);
  animation: guidedBubbleIn 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.guided-tour-close {
  width: 38px;
  height: 38px;
  padding: 0;
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
  background: var(--surface-soft);
}

.guided-tour-close:hover {
  color: var(--green-dark);
  background: var(--green-soft);
}

.guided-tour-mascot {
  min-height: 116px;
  position: relative;
  display: grid;
  place-items: center;
}

.guided-tour-mascot span {
  width: 90px;
  height: 90px;
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 189, 89, 0.34), rgba(173, 15, 47, 0.08));
}

.guided-tour-mascot img {
  width: 122px;
  height: 122px;
  position: relative;
  z-index: 1;
  object-fit: contain;
  filter: drop-shadow(0 12px 13px rgba(93, 12, 31, 0.2));
}

.guided-tour-copy {
  padding-right: 22px;
}

.guided-tour-progress {
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.guided-tour-copy h2 {
  margin: 7px 0 7px;
  font-size: 21px;
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.guided-tour-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.62;
}

.guided-tour-footer {
  margin-top: 12px;
  padding-top: 13px;
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.guided-tour-nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.audit-list {
  margin-top: 15px;
  display: grid;
}

.audit-event {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.audit-icon {
  width: 40px;
  height: 40px;
  color: var(--green-dark);
  background: var(--green-soft);
}

.audit-event strong,
.audit-event span {
  display: block;
}

.audit-event strong {
  font-size: 12px;
}

.audit-event span,
.audit-event time {
  color: var(--muted);
  font-size: 10px;
}

.audit-event span {
  margin-top: 3px;
}

@keyframes toast-in {
  0% { transform: translateY(22px) scale(0.92); opacity: 0; }
  75% { transform: translateY(-3px) scale(1.02); }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.mobile-nav {
  display: none;
}

.negative {
  color: var(--red) !important;
}

.positive {
  color: var(--green-dark) !important;
}

.muted {
  color: var(--muted);
}

.text-right {
  text-align: right !important;
}

.nowrap {
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-grid.three,
  .field-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .movement-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar: 82px;
  }

  .sidebar {
    padding-inline: 13px;
  }

  .sidebar .brand {
    justify-content: center;
    padding-inline: 0;
  }

  .sidebar .brand-name,
  .sidebar-subtitle,
  .nav-item span,
  .sidebar-project,
  .sidebar-toggle,
  .user-chip .user-info,
  .btn-sidebar-logout span {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

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

  .user-chip {
    display: flex;
    justify-content: center;
    padding: 0;
    background: transparent;
  }

  .btn-sidebar-logout {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    justify-content: center;
  }

  .dashboard-grid,
  .statement-layout,
  .report-visual-grid {
    grid-template-columns: 1fr;
  }

  .report-metric-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .loan-layout {
    grid-template-columns: 1fr;
  }

  .loan-form-card {
    position: static;
  }

  .movement-layout {
    grid-template-columns: 1fr;
  }

  .movement-chart-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }

  .auth-panel {
    min-height: 100vh;
    padding: 96px 24px 34px;
  }

  .auth-brand {
    top: 26px;
    left: 24px;
  }

  .demo-access {
    top: 24px;
    right: 24px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    height: 68px;
    padding-inline: 17px;
  }

  .topbar-title {
    display: none;
  }

  .mobile-brand {
    display: inline-flex;
  }

  .mobile-brand .brand-mark {
    width: 37px;
    height: 37px;
    border-radius: 12px;
  }

  .content {
    padding: 14px 16px 96px;
  }

  .page-header {
    margin-top: 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .page-header .btn {
    width: 100%;
  }

  .page-actions {
    width: 100%;
  }

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

  .kpi-grid,
  .section-grid,
  .section-grid.three,
  .field-grid,
  .field-grid.three,
  .field-grid.four {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    gap: 10px;
  }

  .movement-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .movement-summary {
    min-height: 92px;
    padding: 13px;
    gap: 9px;
  }

  .movement-summary-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .movement-row {
    padding: 13px;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .movement-row .row-action {
    display: none;
  }

  .movement-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .movement-amount {
    font-size: 11px;
  }

  .filter-pills {
    width: 100%;
    overflow-x: auto;
  }

  .filter-pill {
    flex: 1 0 auto;
    justify-content: center;
  }

  .sheet-actions {
    width: 100%;
    justify-content: stretch;
  }

  .user-sheet-actions {
    width: 100%;
    justify-content: stretch;
  }

  .sheet-action {
    min-width: 0;
    flex: 1;
  }

  .report-metric-stack {
    grid-template-columns: 1fr;
  }

  .report-chart-switch span {
    display: none;
  }

  .sheet-actions .count-pill {
    flex: 0 0 auto;
  }

  .import-summary {
    grid-template-columns: 1fr;
  }

  .chart-switch button span {
    display: none;
  }

  .chart-switch button {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .kpi-card {
    min-height: 132px;
  }

  .chart-card,
  .panel-card,
  .settings-card,
  .loan-form-card,
  .loan-preview-card {
    padding: 18px;
  }

  .chart-wrap {
    height: 220px;
  }

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

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .table-toolbar .search-box,
  .table-toolbar .btn {
    width: 100%;
  }

  .sticky-actions {
    bottom: 72px;
  }

  .sticky-actions .save-status {
    display: none;
  }

  .sticky-actions .btn {
    width: 100%;
  }

  .mobile-nav {
    position: fixed;
    z-index: 40;
    left: 10px;
    right: 10px;
    bottom: 10px;
    min-height: 60px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 19px;
    display: flex;
    justify-content: space-around;
    gap: 3px;
    background: rgba(49, 9, 20, 0.96);
    box-shadow: 0 16px 45px rgba(49, 9, 20, 0.3);
    backdrop-filter: blur(18px);
  }

  .mobile-nav .nav-item {
    min-width: 0;
    height: 48px;
    min-height: 48px;
    display: grid;
    place-items: center;
  }

  .mobile-nav .nav-item span {
    display: none;
  }

  .mobile-nav .nav-item.active {
    background: rgba(255, 189, 89, 0.17);
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: end;
  }

  .modal {
    width: 100%;
    max-height: 90vh;
    border-radius: 24px 24px 14px 14px;
  }

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

  .bank-picker {
    max-height: 168px;
  }

  .audit-event {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .audit-event time {
    display: none;
  }

  .tour-admin-card {
    padding: 18px;
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
  }

  .tour-admin-visual,
  .tour-admin-visual img {
    width: 86px;
    min-height: 86px;
    height: 86px;
  }

  .tour-admin-halo {
    width: 70px;
    height: 70px;
    box-shadow: 0 0 0 9px rgba(173, 15, 47, 0.055);
  }

  .tour-admin-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .tour-admin-copy h2 {
    margin-top: 5px;
    font-size: 21px;
  }

  .tour-admin-copy p,
  .tour-admin-actions {
    grid-column: 1 / -1;
  }

  .tour-admin-card {
    grid-template-rows: auto auto auto;
  }

  .tour-admin-copy {
    display: contents;
  }

  .tour-admin-heading,
  .tour-admin-copy h2 {
    grid-column: 2;
  }

  .tour-admin-copy p {
    margin-top: 3px;
  }

  .tour-admin-actions .btn {
    flex: 1 1 170px;
  }

  .guided-tour-bubble {
    max-height: calc(100vh - 104px);
    padding: 16px;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 4px 10px;
    border-radius: 20px;
  }

  .guided-tour-close {
    width: 34px;
    height: 34px;
    top: 8px;
    right: 8px;
  }

  .guided-tour-mascot {
    min-height: 82px;
  }

  .guided-tour-mascot span {
    width: 62px;
    height: 62px;
  }

  .guided-tour-mascot img {
    width: 86px;
    height: 86px;
  }

  .guided-tour-copy {
    padding-right: 18px;
  }

  .guided-tour-copy h2 {
    font-size: 17px;
  }

  .guided-tour-copy p {
    font-size: 11px;
  }

  .guided-tour-footer {
    align-items: stretch;
  }

  .guided-tour-footer .btn {
    min-height: 42px;
    padding-inline: 12px;
  }
}

@media (max-width: 430px) {
  .sheet-action span {
    display: none;
  }

  .sheet-action .icon {
    width: 18px;
    height: 18px;
  }

  .demo-access-trigger {
    width: 42px;
    padding: 0;
  }

  .demo-access-trigger > span,
  .demo-access-trigger .icon:last-child {
    display: none;
  }

  .demo-access-menu {
    width: calc(100vw - 32px);
    right: -8px;
  }

  .demo-account {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .demo-account-actions {
    grid-column: 2;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 122px;
  }

  .page-header h1 {
    font-size: 31px;
  }

  .topbar-actions .btn span {
    display: none;
  }

  .topbar-actions .btn {
    width: 42px;
    padding: 0;
  }
}

/* Proyección financiera basada en la plantilla del taller */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.information-hero {
  position: relative;
  min-height: 250px;
  padding: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 28px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 189, 89, 0.24), transparent 30%),
    linear-gradient(135deg, var(--forest), var(--forest-2));
}

.information-hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -90px;
  bottom: -150px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.information-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.information-hero .eyebrow {
  color: var(--lime);
}

.information-hero h2 {
  max-width: 720px;
  margin: 8px 0 12px;
  font-size: clamp(25px, 3.2vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.information-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
}

.information-legend {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.information-legend > span {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.07);
  font-size: 10px;
  font-weight: 750;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-swatch.editable { background: var(--lime); }
.legend-swatch.calculated { background: #b8c8d8; }
.legend-swatch.review { background: #66d2a5; }

.information-hero-mark {
  position: relative;
  z-index: 1;
  width: 190px;
  height: 190px;
  justify-self: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.06);
}

.information-hero-mark .icon {
  width: 34px;
  height: 34px;
  color: var(--lime);
}

.information-hero-mark strong {
  margin-top: 5px;
  font-size: 52px;
  line-height: 1;
}

.information-hero-mark span {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.information-steps {
  margin-top: 15px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 15px;
}

.information-step {
  position: relative;
  min-height: 210px;
  padding: 24px;
  overflow: hidden;
}

.information-step-number {
  position: absolute;
  right: 16px;
  top: 5px;
  color: rgba(82, 13, 33, 0.06);
  font-size: 74px;
  font-weight: 850;
}

.information-step-icon,
.information-note-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
}

.information-step-icon .icon,
.information-note-icon .icon {
  width: 21px;
  height: 21px;
}

.information-step h2,
.information-note h2 {
  margin: 16px 0 7px;
  font-size: 16px;
}

.information-step p,
.information-note p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.information-grid {
  margin-top: 15px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.information-note {
  padding: 22px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 15px;
}

.information-note h2 {
  margin-top: 0;
}

.information-note.important {
  border-color: rgba(238, 155, 50, 0.38);
  background: linear-gradient(145deg, #fffaf2, #fff);
}

.information-note.important .information-note-icon {
  color: #a45c00;
  background: var(--amber-soft);
}

.information-next {
  margin-top: 15px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.information-next strong,
.information-next span {
  display: block;
}

.information-next span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.flow-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.flow-kpi {
  padding: 19px;
}

.flow-kpi > span,
.flow-kpi > strong {
  display: flex;
  align-items: center;
}

.flow-kpi > span {
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.flow-kpi > span .icon {
  width: 16px;
  height: 16px;
  color: var(--green);
}

.flow-kpi > strong {
  margin-top: 10px;
  font-size: clamp(18px, 2vw, 27px);
  letter-spacing: -0.03em;
}

.flow-chart-card {
  margin: 15px 0;
  padding: 24px;
}

.flow-overview-grid {
  margin: 15px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.7fr);
  gap: 15px;
  align-items: start;
}

.flow-overview-grid .flow-chart-card {
  min-width: 0;
  margin: 0;
}

.flow-signals-card {
  padding: 22px;
}

.flow-commitments {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.flow-commitments > .eyebrow {
  display: block;
  margin-bottom: 9px;
}

.flow-commitments .statement-row {
  padding-block: 10px;
}

.flow-main-chart {
  min-height: 300px;
}

.flow-readonly-note {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4e5c66;
  background: #edf2f6;
  font-size: 11px;
}

.flow-readonly-note .icon {
  width: 17px;
  height: 17px;
}

.plan-context-card {
  padding: 22px;
}

.plan-hub-wrap {
  margin-bottom: 15px;
  padding: clamp(21px, 3vw, 30px);
  border: 1px solid rgba(173, 15, 47, 0.11);
  border-radius: 25px;
  background:
    radial-gradient(circle at 0 0, rgba(173, 15, 47, 0.075), transparent 27%),
    radial-gradient(circle at 100% 100%, rgba(238, 155, 50, 0.1), transparent 30%),
    #fff;
  box-shadow: var(--shadow-sm);
}

.plan-hub-copy {
  margin-bottom: 20px;
}

.plan-hub-copy h2 {
  margin: 6px 0 7px;
  font-size: clamp(21px, 2.5vw, 30px);
  letter-spacing: -0.035em;
}

.plan-hub-copy p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.plan-hub {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.plan-tab {
  position: relative;
  min-width: 0;
  min-height: 116px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 19px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 26px;
  align-items: start;
  gap: 11px;
  overflow: hidden;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 7px 18px rgba(65, 17, 30, 0.045);
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1), border-color 220ms ease, box-shadow 220ms ease, color 220ms ease, background 220ms ease;
  animation: planTabIn 430ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--tab-index, 0) * 45ms) both;
}

.plan-tab::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -52px;
  bottom: -54px;
  border: 16px solid rgba(173, 15, 47, 0.045);
  border-radius: 50%;
  transition: transform 300ms ease;
}

.plan-tab:hover {
  transform: translateY(-5px);
  border-color: rgba(173, 15, 47, 0.3);
  box-shadow: 0 16px 34px rgba(65, 17, 30, 0.11);
}

.plan-tab:hover::after {
  transform: scale(1.2);
}

.plan-tab:active {
  transform: translateY(-2px) scale(0.985);
}

.plan-tab.active {
  border-color: transparent;
  color: #fff;
  background:
    radial-gradient(circle at 100% 0, rgba(238, 155, 50, 0.22), transparent 34%),
    linear-gradient(145deg, var(--forest), var(--forest-2));
  box-shadow: 0 18px 36px rgba(49, 9, 20, 0.22);
}

.plan-tab-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.plan-tab.active .plan-tab-icon {
  color: var(--lime);
  background: rgba(255, 255, 255, 0.11);
}

.plan-tab:hover .plan-tab-icon {
  transform: rotate(-4deg) scale(1.08);
}

.plan-tab-icon .icon,
.plan-tab-arrow .icon {
  width: 20px;
  height: 20px;
}

.plan-tab-copy,
.plan-tab-copy small,
.plan-tab-copy strong,
.plan-tab-copy span {
  min-width: 0;
  display: block;
}

.plan-tab-copy small {
  color: var(--green);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.plan-tab.active .plan-tab-copy small {
  color: var(--lime);
}

.plan-tab-copy strong {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.25;
}

.plan-tab-arrow {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  transform: rotate(-90deg);
}

.plan-tab-arrow .icon {
  width: 14px;
  height: 14px;
}

.plan-tab.active .plan-tab-arrow {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}

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

.plan-panel[hidden] {
  display: none;
}

.plan-panel.active {
  animation: panelReveal 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes panelReveal {
  from { opacity: 0; transform: translateY(6px) scale(0.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.compact-settings {
  margin-bottom: 15px;
  padding: 20px 22px;
}

.assumption-field .input[readonly] {
  border-color: #edc36d;
  color: #6b4611;
  background: #fff7df;
  cursor: cell;
}

.assumption-field .input.is-editing {
  border-color: var(--amber);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(238, 155, 50, 0.16);
}

.edit-hint {
  display: block;
  margin-top: 5px;
  color: #9b6c29;
  font-size: 9px;
}

.table-help {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.plan-table-scroll {
  max-width: 100%;
}

.plan-matrix {
  min-width: 1320px;
}

.plan-matrix th:first-child,
.plan-matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 180px;
  background: #fff;
}

.plan-matrix thead th:first-child {
  z-index: 3;
  background: var(--forest-2);
}

.plan-matrix th:not(:first-child),
.plan-matrix td:not(:first-child) {
  min-width: 88px;
}

.plan-matrix td {
  height: 52px;
}

.plan-matrix .editable-row td {
  background: #fffcf4;
}

.plan-matrix .editable-row td:first-child {
  background: #fff8e7;
}

.plan-matrix .calculated-row td {
  background: #f5f7f8;
}

.plan-matrix .calculated-row td:first-child {
  background: #eef2f4;
}

.plan-matrix .result-row td {
  background: #edf7f2;
}

.plan-matrix .result-row td:first-child {
  background: #e4f2eb;
}

.plan-input-cell {
  padding: 6px !important;
}

.plan-input-cell .month-input {
  width: 100%;
  min-width: 76px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid #edc36d;
  border-radius: 9px;
  text-align: right;
  color: #3a2610;
  background: #fffaf0;
}

.plan-input-cell .month-input:focus {
  border-color: var(--amber);
  outline: 3px solid rgba(238, 155, 50, 0.14);
}

.matrix-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
}

.monthly-blocks {
  padding: 0 20px 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.month-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 7px 18px rgba(65, 17, 30, 0.05);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms ease, border-color 220ms ease;
  animation: monthBlockIn 430ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--month-index, 0) * 34ms) both;
}

.month-block:hover {
  transform: translateY(-4px);
  border-color: rgba(173, 15, 47, 0.25);
  box-shadow: 0 15px 30px rgba(65, 17, 30, 0.1);
}

@keyframes monthBlockIn {
  from { opacity: 0; transform: translateY(13px) scale(0.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.month-block > header {
  min-height: 64px;
  padding: 12px 13px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  color: #fff;
  background:
    radial-gradient(circle at 100% 0, rgba(238, 155, 50, 0.22), transparent 45%),
    linear-gradient(145deg, var(--forest), var(--forest-2));
}

.month-block > header > span {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--lime);
  background: rgba(255, 255, 255, 0.1);
  font-size: 10px;
  font-weight: 850;
}

.month-block > header small,
.month-block > header strong {
  display: block;
}

.month-block > header small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.month-block > header strong {
  margin-top: 3px;
  font-size: 12px;
}

.month-block > header .icon {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.7);
}

.month-block-body {
  padding: 12px 13px;
  display: grid;
  gap: 8px;
}

.month-block-row {
  padding: 8px 9px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  background: var(--surface-soft);
}

.month-block-row span {
  min-width: 0;
  color: var(--muted);
  font-size: 8px;
}

.month-block-row strong {
  color: var(--ink);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.month-block-row.calculated-row {
  background: #f1f4f6;
}

.month-block-row.result-row {
  background: #eaf6ef;
}

.month-block-row.result-row strong {
  color: var(--success);
}

.month-block-input {
  display: grid;
  gap: 5px;
}

.month-block-input > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.month-block-input-box {
  min-height: 40px;
  padding: 0 9px;
  border: 1px solid #edc36d;
  border-radius: 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  background: #fffaf0;
}

.month-block-input-box:focus-within {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(238, 155, 50, 0.14);
}

.month-block-input-box i {
  color: #9b6c29;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.month-block-input-box .month-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0;
  border: 0;
  outline: 0;
  color: #3a2610;
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  text-align: right;
}

.month-block.annual-total {
  border-color: rgba(238, 155, 50, 0.35);
  background: #fffaf1;
}

.month-block.annual-total > header {
  background:
    radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.18), transparent 45%),
    linear-gradient(145deg, #a85e00, #d0831e);
}

.loan-core-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.loan-principal-field {
  grid-column: 1 / -1;
}

.loan-core-field {
  position: relative;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.loan-core-field .input-prefix,
.loan-core-field .input,
.loan-month-field .select {
  width: 100%;
  min-width: 0;
}

.loan-core-icon {
  width: 30px;
  height: 30px;
  margin-bottom: 9px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
}

.loan-core-icon .icon {
  width: 16px;
  height: 16px;
}

.loan-formula-card {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid #dfe6ea;
  border-radius: 18px;
  background: linear-gradient(145deg, #f8fafb, #fff);
}

.loan-formula-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.loan-formula-head h3 {
  margin: 4px 0 0;
  font-size: 15px;
}

.loan-formula-parameters {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.loan-formula-parameters > span {
  padding: 10px;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(49, 9, 20, 0.05);
}

.loan-formula-parameters small,
.loan-formula-parameters strong {
  display: block;
}

.loan-rate-conversion {
  margin-top: 11px;
  padding: 9px 11px;
  border-radius: 11px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #5c4a2f;
  background: #fff8e9;
  font-size: 9px;
  line-height: 1.5;
}

.loan-rate-conversion .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: #b36b0c;
}

.loan-formula-parameters small {
  color: var(--muted);
  font-size: 8px;
}

.loan-formula-parameters strong {
  margin-top: 4px;
  font-size: 11px;
}

.loan-equation {
  margin-top: 14px;
  padding: 14px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow-x: auto;
  color: #3f2730;
  background: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.loan-equation > i {
  color: var(--muted);
  font-style: normal;
}

.loan-equation > strong {
  padding: 7px 10px;
  border-radius: 10px;
  color: #fff;
  background: var(--green);
}

.equation-label {
  font-weight: 850;
}

.formula-fraction {
  display: inline-grid;
  grid-template-rows: auto auto;
  text-align: center;
}

.formula-fraction b {
  padding: 2px 8px;
  font-weight: 650;
}

.formula-fraction b:first-child {
  border-bottom: 1px solid currentColor;
}

.credit-detail-tabs {
  margin: 16px 0 10px;
  padding: 4px;
  border-radius: 12px;
  display: inline-flex;
  gap: 3px;
  background: #eef1f3;
}

.credit-detail-tabs button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

.credit-detail-tabs button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 3px 9px rgba(49, 9, 20, 0.08);
}

.credit-detail-tabs .icon {
  width: 15px;
  height: 15px;
}

.loan-schedule-scroll {
  margin-top: 8px;
  max-height: 510px;
}

.loan-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(210px, 0.75fr);
  gap: 14px;
  align-items: stretch;
}

.loan-chart-panel {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, #fff, #fbf8f9);
}

.loan-balance-panel {
  grid-column: 1 / -1;
}

.loan-chart-title {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.loan-chart-title strong,
.loan-chart-title .eyebrow {
  display: block;
}

.loan-chart-title strong {
  margin-top: 3px;
  font-size: 13px;
}

.loan-chart-title > .icon {
  width: 20px;
  height: 20px;
  color: var(--green);
}

.loan-balance-chart {
  min-width: 0;
  padding: 8px;
  border-radius: 13px;
  background: linear-gradient(180deg, #fff, #fafcfc);
}

.loan-balance-chart svg {
  width: 100%;
  height: auto;
  min-height: 240px;
}

.loan-balance-area {
  fill: rgba(173, 15, 47, 0.1);
}

.loan-balance-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.loan-cost-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: grid;
  justify-items: center;
  align-content: start;
  background: linear-gradient(145deg, #fff9ef, #fff);
}

.loan-cost-card .loan-chart-title {
  width: 100%;
}

.loan-payment-mix-card {
  display: flex;
  flex-direction: column;
}

.loan-payment-mix {
  min-height: 180px;
  padding: 12px 6px 0;
  display: flex;
  align-items: end;
  gap: 8px;
  flex: 1;
}

.loan-payment-mix > span {
  height: 100%;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  align-items: stretch;
  position: relative;
  padding-bottom: 20px;
}

.loan-payment-mix > span > i {
  min-height: 3px;
  display: block;
  animation: miniBarGrow 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.loan-payment-mix > span > i.principal {
  border-radius: 4px 4px 1px 1px;
  background: var(--green);
}

.loan-payment-mix > span > i.interest {
  border-radius: 1px 1px 4px 4px;
  background: var(--amber);
}

.loan-payment-mix small {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  color: var(--muted);
  font-size: 8px;
  text-align: center;
}

.loan-mix-legend {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: var(--muted);
  font-size: 9px;
}

.loan-mix-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.loan-mix-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.loan-mix-legend i.principal { background: var(--green); }
.loan-mix-legend i.interest { background: var(--amber); }

.loan-cost-ring {
  width: 116px;
  height: 116px;
  margin: 14px 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background: radial-gradient(circle at center, var(--surface-soft) 0 53%, transparent 54%), conic-gradient(var(--amber) calc(var(--interest-share) * 1%), var(--green) 0);
}

.loan-cost-ring strong,
.loan-cost-ring span {
  display: block;
}

.loan-cost-ring strong { font-size: 20px; }
.loan-cost-ring span { color: var(--muted); font-size: 8px; }

.loan-cost-legend {
  width: 100%;
  display: grid;
  gap: 8px;
}

.loan-cost-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
}

.loan-cost-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.loan-cost-legend i.interest { background: var(--amber); }

.financial-report-layout {
  align-items: start;
}

.report-chart-panel {
  min-height: 100%;
}

.income-margin-cards {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.income-margin-cards span {
  padding: 13px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.income-margin-cards small,
.income-margin-cards strong {
  display: block;
}

.income-margin-cards small { color: var(--muted); font-size: 9px; }
.income-margin-cards strong { margin-top: 4px; font-size: 17px; }

.position-summary {
  margin-bottom: 15px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.position-summary > div:not(.position-equals) {
  min-width: 180px;
}

.position-summary span,
.position-summary strong {
  display: block;
}

.position-summary > div > span {
  color: var(--muted);
  font-size: 9px;
}

.position-summary > div > strong {
  margin-top: 5px;
  font-size: 22px;
}

.position-equals {
  color: var(--muted);
  font-size: 22px;
}

.reconciliation-badge {
  min-height: 34px;
  margin-left: auto;
  padding: 0 11px;
  border-radius: 999px;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 800;
}

.reconciliation-badge.ok {
  color: #176245;
  background: var(--success-soft);
}

.reconciliation-badge.warning {
  color: #9f2d2d;
  background: var(--red-soft);
}

.reconciliation-badge .icon {
  width: 14px;
  height: 14px;
}

.statement-row.subtotal {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  font-weight: 800;
}

.position-card.assets {
  border-top: 4px solid var(--blue);
}

.position-card.liabilities {
  border-top: 4px solid var(--green);
}

.position-chart-card {
  margin-top: 15px;
  padding: 22px;
}

.position-bars {
  display: grid;
  gap: 12px;
}

.position-bars > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 130px;
  align-items: center;
  gap: 12px;
  font-size: 10px;
}

.position-bars > div > i {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf0f2;
}

.position-bars b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.position-bars b.liability { background: var(--green); }
.position-bars b.equity { background: var(--lime); }
.position-bars strong { text-align: right; }

.tax-settlement-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.tax-settlement-card {
  padding: 20px;
}

.tax-settlement-card span,
.tax-settlement-card strong,
.tax-settlement-card small {
  display: block;
}

.tax-settlement-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.tax-settlement-card strong {
  margin-top: 8px;
  font-size: 25px;
}

.tax-settlement-card small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
}

.tax-settlement-card.accent {
  color: #fff;
  background: linear-gradient(135deg, var(--forest), var(--forest-2));
}

.tax-settlement-card.accent span,
.tax-settlement-card.accent small {
  color: rgba(255, 255, 255, 0.72);
}

.tax-visual-card {
  margin-bottom: 15px;
  padding: 22px;
}

.tax-disclaimer {
  margin-top: 15px;
}

@media (max-width: 1100px) {
  .information-steps,
  .flow-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-hub,
  .monthly-blocks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .loan-core-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .mobile-nav {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .mobile-nav .nav-item {
    min-width: 46px;
    flex: 0 0 46px;
  }

  .movement-quick-groups {
    grid-template-columns: 1fr;
  }

  .plan-hub,
  .monthly-blocks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .information-hero {
    grid-template-columns: 1fr 160px;
  }

  .information-hero-mark {
    width: 150px;
    height: 150px;
  }

  .loan-chart-grid {
    grid-template-columns: 1fr;
  }

  .loan-cost-card {
    grid-template-columns: auto 120px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
  }

  .loan-cost-ring {
    margin: 0;
  }
}

@media (max-width: 680px) {
  .information-hero {
    padding: 25px;
    grid-template-columns: 1fr;
  }

  .information-hero-mark {
    display: none;
  }

  .information-steps,
  .information-grid,
  .flow-kpis,
  .tax-settlement-summary {
    grid-template-columns: 1fr;
  }

  .movement-quick-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .movement-quick-intro .btn {
    width: 100%;
  }

  .plan-hub {
    grid-template-columns: 1fr;
  }

  .plan-tab {
    min-height: 100px;
  }

  .information-step {
    min-height: 0;
  }

  .information-next,
  .position-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .information-next .btn {
    width: 100%;
  }

  .loan-formula-parameters {
    grid-template-columns: 1fr 1fr;
  }

  .movement-entry-row,
  .loan-core-grid {
    grid-template-columns: 1fr;
  }

  .movement-category-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .movement-category-option {
    padding-inline: 8px;
  }

  .movement-category-option strong {
    white-space: normal;
    font-size: 10px;
    line-height: 1.15;
  }

  .loan-principal-field {
    grid-column: auto;
  }

  .loan-identity-tools {
    grid-template-columns: 1fr;
  }

  .position-equals {
    display: none;
  }

  .position-summary > div:not(.position-equals) {
    min-width: 0;
  }

  .reconciliation-badge {
    margin-left: 0;
    align-self: flex-start;
  }

  .position-bars > div {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .position-bars strong {
    grid-column: 2;
  }

  .loan-cost-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .information-hero,
  .information-step,
  .information-note,
  .flow-chart-card,
  .plan-context-card,
  .compact-settings,
  .tax-visual-card,
  .position-chart-card {
    padding: 18px;
  }

  .information-legend {
    display: grid;
  }

  .movement-quick-entry,
  .plan-hub-wrap {
    padding: 18px;
  }

  .movement-category-grid,
  .monthly-blocks {
    grid-template-columns: 1fr;
  }

  .movement-category-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monthly-blocks {
    padding-inline: 14px;
  }

  .loan-equation {
    justify-content: flex-start;
  }

  .loan-formula-parameters,
  .income-margin-cards {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SECCIÓN: COMPARATIVA DE CRÉDITOS Y FLUJO DE CAJA (NUEVO)
   ========================================================================== */

.credit-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  max-width: 540px;
}

.credit-tab-btn {
  flex: 1;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.credit-tab-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.65);
}

.credit-tab-btn.active {
  color: var(--green-dark);
  background: white;
  border-color: rgba(173, 15, 47, 0.16);
  box-shadow: 0 4px 14px rgba(65, 17, 30, 0.08);
}

.credit-tab-btn .icon {
  width: 17px;
  height: 17px;
}

.comparison-controls-card {
  padding: 22px 24px;
  margin-bottom: 20px;
}

.comparison-inputs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.comparison-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.comparison-card {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(232, 220, 224, 0.95);
  background: white;
  border-radius: var(--radius);
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 260ms ease, border-color 260ms ease;
  animation: cardEntrance 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.comparison-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(65, 17, 30, 0.1);
}

.comparison-card.best-choice {
  border-color: #10b981;
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.18);
}

.best-choice-banner {
  margin: -22px -20px 18px -20px;
  padding: 8px 16px;
  background: linear-gradient(90deg, #10b981, #059669);
  color: white;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 7px;
}

.best-choice-banner .icon {
  width: 15px;
  height: 15px;
}

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

.entity-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.entity-badge strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.entity-badge small {
  color: var(--muted);
  font-size: 11px;
}

.comparison-rate-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.comparison-rate-badge label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.rate-prefix {
  width: 86px;
}

.rate-input {
  height: 38px;
  font-size: 13px;
  font-weight: 800;
  padding-left: 24px;
  text-align: right;
}

.rate-prefix > span {
  left: 8px;
  font-size: 11px;
}

.comparison-payment-hero {
  margin: 18px 0 16px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--entity-color, #ad0f2f) 16%, transparent);
  background: linear-gradient(145deg, color-mix(in srgb, var(--entity-color, #ad0f2f) 8%, white), #fff);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.payment-label {
  font-size: 10.5px;
  font-weight: 750;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.payment-val {
  font-size: clamp(23px, 2.5vw, 30px);
  font-weight: 850;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.comparison-payment-hero small {
  color: var(--muted);
  font-size: 11px;
}

.comparison-metrics-list {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  flex: 1;
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--line);
}

.metric-row span {
  color: var(--muted);
}

.metric-row strong {
  font-weight: 700;
}

.metric-row.highlight {
  border-bottom: none;
  padding-top: 4px;
}

.metric-row.highlight strong {
  font-size: 12.5px;
}

.comparison-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.comparison-card-actions .btn {
  min-height: 40px;
  padding: 0 10px;
  font-size: 12px;
}

.comparison-chart-card {
  padding: 24px;
  margin-bottom: 24px;
}

.comparison-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin: 14px 0 18px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink);
}

.legend-line.base {
  width: 24px;
  height: 0;
  border-top: 2.5px dashed #94A3B8;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.comparison-chart-wrap svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.comparison-dot {
  cursor: pointer;
  transition: transform 180ms ease, r 180ms ease;
}

.comparison-dot:hover,
.comparison-dot-group:hover .entity-dot {
  transform: scale(1.3);
}

.comparison-inspector {
  margin-top: 18px;
  padding: 16px 20px;
  border-radius: 16px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.comparison-inspector-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.inspector-entity-box {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inspector-entity-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.inspector-entity-head small,
.inspector-entity-box small {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.inspector-entity-box strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.delta-badge {
  font-size: 11px;
  font-weight: 750;
}

.delta-badge.neutral {
  color: var(--muted);
}

.comparison-table-section {
  margin-top: 24px;
}

.comparison-table .selected-row {
  background: #fdf5f6 !important;
}

.comparison-table .selected-row td {
  border-top: 1px solid rgba(173, 15, 47, 0.2);
  border-bottom: 1px solid rgba(173, 15, 47, 0.2);
}

/* ==========================================================================
   SECCIÓN: FILTROS DE AUDITORÍA Y METADATOS DE CUENTAS
   ========================================================================== */

.audit-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 18px;
}

.audit-filter-pill {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.audit-filter-pill:hover {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: #cbd5e1;
}

.audit-filter-pill.active {
  color: white;
  background: var(--forest);
  border-color: var(--forest);
  box-shadow: 0 4px 12px rgba(13, 36, 24, 0.18);
}

.audit-event {
  padding: 14px 12px;
  border-radius: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  transition: background 160ms ease;
}

.audit-event:hover {
  background: var(--surface-soft);
}

.audit-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.audit-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.audit-main strong {
  font-size: 13px;
  font-weight: 750;
  color: var(--ink);
}

.audit-target {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
}

.audit-target .icon {
  width: 12px;
  height: 12px;
}

.audit-meta {
  color: var(--muted);
  font-size: 11px;
}

.audit-time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Auditoría administrativa separada: alcance general o por cuenta. */
.audit-scope-card {
  padding: 26px;
  overflow: hidden;
  border-color: rgba(173, 15, 47, 0.14);
  background:
    radial-gradient(circle at 92% 0%, rgba(255, 189, 89, 0.2), transparent 28%),
    linear-gradient(145deg, #fff 0%, #fff9fa 58%, #f8edf0 100%);
}

.audit-scope-heading,
.audit-workspace-head,
.audit-selected-user,
.audit-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.audit-scope-heading h2,
.audit-workspace-head h2 {
  margin: 3px 0 5px;
}

.audit-scope-heading p,
.audit-workspace-head p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.audit-scope-switch {
  flex: 0 0 auto;
  padding: 5px;
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 5px;
  border: 1px solid rgba(173, 15, 47, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 24px rgba(71, 13, 29, 0.06);
}

.audit-scope-switch button {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 780;
  cursor: pointer;
  transition: transform 180ms ease, color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.audit-scope-switch button:hover {
  color: var(--green);
  background: #fff6f8;
}

.audit-scope-switch button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--green), #7c0d27);
  box-shadow: 0 8px 18px rgba(173, 15, 47, 0.22);
}

.audit-general-note {
  margin-top: 20px;
  padding: 15px 17px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(13, 148, 136, 0.15);
  border-radius: 15px;
  background: rgba(240, 253, 250, 0.78);
  color: #0f766e;
}

.audit-general-note > .icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.audit-general-note div,
.audit-general-note span {
  display: block;
}

.audit-general-note span {
  margin-top: 3px;
  color: #4b6d69;
  font-size: 11px;
}

.audit-user-picker {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(173, 15, 47, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
}

.audit-user-picker > label {
  display: block;
  margin: 15px 0 7px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 780;
}

.audit-user-picker > label:first-child {
  margin-top: 0;
}

.audit-selected-user {
  padding: 13px 15px;
  justify-content: flex-start;
  border: 1px solid rgba(173, 15, 47, 0.17);
  border-radius: 15px;
  background: linear-gradient(135deg, #fff2f5, #fff);
}

.audit-selected-user .avatar {
  width: 46px;
  height: 46px;
}

.audit-selected-user > div {
  min-width: 0;
  flex: 1;
}

.audit-selected-user small,
.audit-selected-user strong,
.audit-selected-user div > span {
  display: block;
}

.audit-selected-user small {
  color: var(--green);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.audit-selected-user strong {
  margin: 2px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-selected-user div > span {
  color: var(--muted);
  font-size: 11px;
}

.audit-user-search {
  min-height: 46px;
  border-color: rgba(173, 15, 47, 0.2);
  background: #fff;
}

.audit-user-results {
  max-height: 300px;
  margin-top: 10px;
  padding: 2px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
}

.audit-user-option {
  min-width: 0;
  min-height: 66px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.audit-user-option:hover,
.audit-user-option.selected {
  transform: translateY(-1px);
  border-color: rgba(173, 15, 47, 0.3);
  background: #fff8fa;
  box-shadow: 0 8px 20px rgba(75, 15, 31, 0.08);
}

.audit-user-option .avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.audit-user-option > .icon {
  width: 15px;
  transform: rotate(-90deg);
  color: var(--muted);
}

.audit-user-option-copy,
.audit-user-option-copy strong,
.audit-user-option-copy small {
  min-width: 0;
  display: block;
}

.audit-user-option-copy strong,
.audit-user-option-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-user-option-copy strong {
  font-size: 12px;
}

.audit-user-option-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.audit-user-option .badge {
  font-size: 8px;
}

.audit-user-empty {
  grid-column: 1 / -1;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}

.audit-summary-grid {
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.audit-stat-card {
  min-height: 92px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.audit-stat-card > span {
  width: 43px;
  height: 43px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: #fff0f3;
}

.audit-stat-card.access > span {
  color: #047857;
  background: #ecfdf5;
}

.audit-stat-card.security > span {
  color: #7c3aed;
  background: #f5f3ff;
}

.audit-stat-card.operations > span {
  color: #b45309;
  background: #fffbeb;
}

.audit-stat-card small,
.audit-stat-card strong {
  display: block;
}

.audit-stat-card small {
  color: var(--muted);
  font-size: 10px;
}

.audit-stat-card strong {
  margin-top: 3px;
  font-size: 22px;
}

.audit-workspace {
  padding: 24px;
}

.audit-workspace-head {
  align-items: flex-start;
}

.audit-limit-field {
  min-width: 132px;
  display: grid;
  gap: 5px;
}

.audit-limit-field span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.audit-limit-field .select {
  min-height: 40px;
}

.audit-workspace .audit-filters {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.audit-workspace .audit-filter-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.audit-workspace .audit-filter-pill .icon {
  width: 14px;
  height: 14px;
}

.audit-workspace .audit-filter-pill.active {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 7px 16px rgba(173, 15, 47, 0.18);
}

.audit-result-heading {
  padding: 2px 3px 11px;
  color: var(--muted);
  font-size: 11px;
}

.audit-result-heading small {
  color: var(--muted);
}

.audit-workspace .audit-list {
  margin-top: 0;
  gap: 9px;
}

.audit-workspace .audit-event {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  align-items: center;
  background: #fff;
}

.audit-workspace .audit-icon {
  margin: 0;
  display: grid;
}

.audit-workspace .audit-event:hover {
  border-color: rgba(173, 15, 47, 0.17);
  background: #fffbfc;
  box-shadow: 0 8px 22px rgba(74, 16, 31, 0.06);
}

.audit-icon-access {
  color: #047857;
  background: #ecfdf5;
}

.audit-icon-accounts,
.audit-icon-security {
  color: #7c3aed;
  background: #f5f3ff;
}

.audit-icon-operations {
  color: #b45309;
  background: #fffbeb;
}

.audit-icon-support {
  color: #0369a1;
  background: #f0f9ff;
}

.audit-icon-system {
  color: var(--green);
  background: #fff0f3;
}

.audit-kind {
  padding: 3px 7px;
  border-radius: 999px;
  color: #475569 !important;
  background: #f1f5f9;
  font-size: 9px !important;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.audit-people {
  margin-top: 7px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 18px;
}

.audit-person {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.audit-person > span:last-child,
.audit-person small,
.audit-person strong,
.audit-person em {
  min-width: 0;
  display: block;
}

.audit-person small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.audit-person strong {
  margin-top: 1px;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-person em {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.mini-avatar {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  display: grid !important;
  place-items: center;
  flex: 0 0 auto;
  color: #fff !important;
  background: linear-gradient(145deg, var(--green), #72102a);
  font-size: 9px !important;
  font-weight: 850;
}

.audit-target-person > .icon {
  width: 14px;
  height: 14px;
  transform: rotate(-90deg);
  color: #b9a5ab;
}

.audit-selection-empty {
  min-height: 250px;
  padding: 36px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.audit-selection-empty h2 {
  margin: 12px 0 5px;
}

.audit-selection-empty p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 980px) {
  .audit-scope-heading,
  .audit-workspace-head {
    align-items: stretch;
    flex-direction: column;
  }

  .audit-scope-switch {
    width: 100%;
  }

  .audit-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-limit-field {
    width: 160px;
  }
}

@media (max-width: 700px) {
  .audit-scope-card,
  .audit-workspace {
    padding: 18px;
  }

  .audit-user-results {
    grid-template-columns: 1fr;
  }

  .audit-selected-user {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .audit-selected-user .btn {
    width: 100%;
  }

  .audit-result-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .audit-workspace .audit-event {
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: flex-start;
  }

  .audit-workspace .audit-event .audit-time {
    grid-column: 2;
  }
}

@media (max-width: 460px) {
  .audit-scope-switch {
    grid-template-columns: 1fr 1fr;
  }

  .audit-scope-switch button {
    min-width: 0;
    padding-inline: 8px;
  }

  .audit-summary-grid {
    grid-template-columns: 1fr;
  }

  .audit-stat-card {
    min-height: 76px;
  }

  .audit-user-option {
    grid-template-columns: 38px minmax(0, 1fr) 16px;
  }

  .audit-user-option .badge {
    display: none;
  }

  .audit-selected-user strong {
    overflow: visible;
    white-space: normal;
  }

  .audit-selected-user {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .audit-selected-user .avatar {
    grid-row: 1 / 3;
  }

  .audit-selected-user > div {
    grid-column: 2;
    grid-row: 1;
  }

  .audit-selected-user > .badge {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }

  .audit-selected-user > .btn {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .audit-workspace .audit-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .audit-workspace .audit-filter-pill {
    flex: 0 0 auto;
  }

  .audit-people {
    align-items: flex-start;
    flex-direction: column;
  }

  .audit-target-person > .icon {
    display: none;
  }
}

.creator-cell small {
  display: block;
  font-size: 11.5px;
}

.badge.warning {
  color: #92400e;
  background: #fef3c7;
}

.badge.success {
  color: #065f46;
  background: #d1fae5;
}

@media (max-width: 900px) {
  .comparison-cards-grid {
    grid-template-columns: 1fr;
  }

  .comparison-inputs-grid {
    grid-template-columns: 1fr;
  }

  .comparison-inspector-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .comparison-card-actions {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SECCIÓN: PERSONALIZACIÓN VISUAL DE CRÉDITOS (ICONO, COLOR Y SVG)
   ========================================================================== */

.loan-customizer-box {
  background: linear-gradient(145deg, #f8faf9, #fff);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 11px 12px;
  margin-top: -2px;
}

.loan-identity-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.loan-identity-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 7px 16px color-mix(in srgb, currentColor 12%, transparent);
}

.loan-identity-mark .icon {
  width: 19px;
  height: 19px;
}

.loan-identity-row strong,
.loan-identity-row small {
  display: block;
}

.loan-identity-row strong { font-size: 12px; }
.loan-identity-row small { margin-top: 2px; color: var(--muted); font-size: 9px; }

.loan-identity-tools {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.loan-identity-picker {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.loan-identity-picker summary {
  min-height: 38px;
  padding: 0 10px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

.loan-identity-picker summary::-webkit-details-marker { display: none; }
.loan-identity-picker summary > .icon:first-child { width: 15px; height: 15px; color: var(--green); }
.loan-identity-picker summary > .icon:last-child { width: 13px; height: 13px; margin-left: auto; transition: transform 180ms ease; }
.loan-identity-picker[open] summary > .icon:last-child { transform: rotate(180deg); }

.loan-identity-picker .loan-icons-grid,
.loan-identity-picker .loan-color-section {
  margin: 0 8px 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  animation: categoryDrilldownIn 220ms ease both;
}

.loan-current-color {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, 0.12);
}

.loan-type-toggle {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 14px;
  background: rgba(0, 0, 0, 0.04);
  padding: 4px;
  border-radius: 12px;
}

.loan-type-btn {
  flex: 1;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 750;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.loan-type-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}

.loan-type-btn.active {
  color: var(--forest);
  background: white;
  border-color: rgba(173, 15, 47, 0.15);
  box-shadow: 0 2px 8px rgba(65, 17, 30, 0.06);
}

.loan-type-btn .icon {
  width: 15px;
  height: 15px;
}

.loan-preset-container,
.loan-svg-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sublabel {
  display: block;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Icon selection grid */
.loan-icons-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 600px) {
  .loan-icons-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.loan-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  min-height: 52px;
  border-radius: 11px;
  border: 1.5px solid var(--line);
  background: white;
  color: var(--ink);
  cursor: pointer;
  transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 160ms ease, border-color 160ms ease;
}

.loan-icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.loan-icon-btn.selected {
  transform: scale(1.03);
  box-shadow: 0 4px 14px rgba(173, 15, 47, 0.22);
}

.loan-icon-btn .icon {
  width: 20px;
  height: 20px;
}

.loan-icon-btn-text {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: center;
}

/* Color swatches & picker */
.loan-color-section {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.loan-color-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.loan-color-swatches {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.loan-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: white;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.loan-swatch:hover {
  transform: scale(1.18);
  box-shadow: 0 0 0 2px var(--accent), 0 4px 8px rgba(0, 0, 0, 0.16);
}

.loan-swatch.active {
  transform: scale(1.15);
  box-shadow: 0 0 0 2.5px var(--ink), 0 4px 10px rgba(0, 0, 0, 0.2);
}

.loan-swatch .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

.loan-custom-color-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 2px;
}

.loan-color-native {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.loan-color-native-label {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: white;
  transition: transform 160ms ease;
}

.loan-color-native-label:hover {
  transform: scale(1.15);
}

.loan-color-native-label .icon {
  width: 13px;
  height: 13px;
}

.loan-color-hex {
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  font-weight: 750;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* SVG Container */
.loan-svg-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

@media (max-width: 600px) {
  .loan-svg-container {
    grid-template-columns: 1fr;
  }
  .loan-svg-preview-col {
    align-items: flex-start;
  }
}

.loan-svg-input-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.loan-svg-textarea {
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  line-height: 1.4;
  min-height: 76px;
  resize: vertical;
}

.svg-help-note {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.4;
}

.svg-help-note code {
  font-family: var(--font-mono, monospace);
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 10.5px;
}

.loan-svg-preview-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.loan-svg-preview-mark {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border: 1.5px dashed var(--line);
  background: white;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.loan-svg-preview-mark .bank-mark {
  width: 44px;
  height: 44px;
}

/* Enhancements for bank-mark presets and custom SVG */
.bank-mark.loan-mark-preset {
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.15);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms ease;
}

.bank-mark.loan-mark-preset svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
}

.bank-mark.loan-mark-custom {
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  padding: 4px;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bank-mark.loan-mark-custom svg {
  width: 100%;
  height: 100%;
  max-width: 28px;
  max-height: 28px;
}

.bank-context .loan-mark-custom svg {
  max-width: 22px;
  max-height: 22px;
}

.loan-chip:hover .bank-mark {
  transform: scale(1.08) rotate(2deg);
}

.animate-fade-in {
  animation: fadeIn 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .auth-glow {
    display: none;
  }

  .glow-action,
  .glow-action:hover {
    background: var(--green);
  }
}

/* ========================================================================== 
   IMPULSA · IDENTIDAD, CONFIGURACIÓN, SOPORTE Y DIRECTORIO ESCALABLE
   ========================================================================== */

.brand-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.brand-name small {
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.68;
}

.brand-name strong {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.comparison-controls-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(173, 15, 47, 0.16);
  background:
    radial-gradient(circle at 94% 0%, rgba(244, 181, 52, 0.16), transparent 34%),
    linear-gradient(145deg, #fff 0%, #fff8fa 100%);
}

.comparison-controls-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -90px;
  bottom: -120px;
  border: 24px solid rgba(173, 15, 47, 0.045);
  border-radius: 50%;
  pointer-events: none;
}

.comparison-card {
  border-top: 4px solid var(--entity-color, var(--green));
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--entity-color, #ad0f2f) 16%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--entity-color, #ad0f2f) 3%, white), #fff 34%),
    #fff;
}

.comparison-card.best-choice {
  border-top-color: #10b981;
}

.comparison-entity-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 58px;
  align-items: end;
  gap: 8px;
  padding: 13px;
  margin: 14px 0 2px;
  border: 1px solid color-mix(in srgb, var(--entity-color, #ad0f2f) 18%, #e8dce0);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.comparison-entity-editor .field {
  gap: 5px;
}

.comparison-entity-editor label {
  font-size: 10px;
}

.comparison-color-field .color-input {
  width: 100%;
  min-height: 42px;
  padding: 4px;
  border-radius: 12px;
}

.user-directory-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 150px 120px;
  align-items: end;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(173, 15, 47, 0.11);
  border-radius: 16px;
  background: linear-gradient(135deg, #fff8fa, #fff);
  margin-bottom: 14px;
}

.user-directory-filters .search-box {
  align-self: end;
  min-height: 44px;
}

.compact-field {
  gap: 5px;
}

.compact-field label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--muted);
}

.user-directory-toolbar {
  margin-bottom: 10px;
}

.directory-summary {
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
}

.user-phone {
  display: flex !important;
  align-items: center;
  gap: 4px;
  color: #47605a !important;
  margin-top: 3px;
}

.user-phone .icon {
  width: 12px;
  height: 12px;
}

.users-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

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

.pagination-actions .btn:first-child .icon {
  transform: rotate(90deg);
}

.pagination-actions .next .icon {
  transform: rotate(-90deg);
}

.page-indicator {
  min-width: 110px;
  text-align: center;
}

.settings-experience-layout {
  display: grid;
  gap: 22px;
}

.mascot-settings-card,
.whatsapp-settings-card {
  padding: 26px;
  overflow: hidden;
}

.mascot-settings-card {
  background:
    radial-gradient(circle at 88% 0%, rgba(244, 181, 52, 0.17), transparent 30%),
    linear-gradient(145deg, #fff, #fff8fa);
}

.mascot-choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.mascot-choice {
  position: relative;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  text-align: center;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.mascot-choice:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(65, 17, 30, 0.09);
}

.mascot-choice.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(173, 15, 47, 0.1), 0 14px 30px rgba(173, 15, 47, 0.11);
}

.mascot-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mascot-choice-visual {
  display: grid;
  place-items: center;
  height: 150px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f9f3f5, #fff);
  overflow: hidden;
}

.mascot-choice-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 220ms ease;
}

.mascot-choice:hover img {
  transform: scale(1.05) rotate(-1deg);
}

.mascot-choice strong,
.mascot-choice small {
  display: block;
}

.mascot-choice strong {
  font-size: 13px;
}

.mascot-choice small {
  min-height: 34px;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted);
}

.mascot-choice-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 180ms ease, transform 180ms ease;
}

.mascot-choice.selected .mascot-choice-check {
  opacity: 1;
  transform: scale(1);
}

.mascot-choice-check .icon {
  width: 15px;
  height: 15px;
}

.settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.settings-toggle input {
  position: absolute;
  opacity: 0;
}

.settings-toggle > span {
  width: 46px;
  height: 26px;
  padding: 3px;
  border-radius: 20px;
  background: #d6dadd;
  transition: background 180ms ease;
}

.settings-toggle > span::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 180ms ease;
}

.settings-toggle input:checked + span {
  background: #1fae6f;
}

.settings-toggle input:checked + span::after {
  transform: translateX(20px);
}

.settings-toggle strong {
  font-size: 12px;
}

.settings-intro {
  max-width: 820px;
  color: var(--muted);
  line-height: 1.55;
}

.support-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}

.support-contact-row {
  display: grid;
  grid-template-columns: 30px 1fr 1fr;
  align-items: end;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.support-contact-number {
  align-self: center;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.settings-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.settings-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #147d52;
  font-size: 12px;
}

.settings-preview .icon {
  width: 22px;
  height: 22px;
}

.whatsapp-support {
  position: fixed;
  z-index: 70;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.whatsapp-support-label {
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(17, 70, 47, 0.14);
  color: #245b45;
  font-size: 10px;
  font-weight: 800;
}

.whatsapp-float {
  min-height: 50px;
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(18, 140, 126, 0.28);
  font-size: 12px;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.whatsapp-float:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 36px rgba(18, 140, 126, 0.35);
}

.whatsapp-float .icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

@media (max-width: 1180px) {
  .mascot-choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .support-contact-grid {
    grid-template-columns: 1fr;
  }

  .user-directory-filters {
    grid-template-columns: minmax(240px, 1fr) 170px 145px;
  }

  .page-size-field {
    grid-column: 3;
  }
}

@media (max-width: 760px) {
  .brand-name small {
    font-size: 7px;
  }

  .brand-name strong {
    font-size: 15px;
  }

  .comparison-entity-editor,
  .user-directory-filters {
    grid-template-columns: 1fr 1fr;
  }

  .comparison-entity-editor .field:first-child,
  .user-directory-filters .search-box {
    grid-column: 1 / -1;
  }

  .page-size-field {
    grid-column: auto;
  }

  .mascot-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support-contact-row {
    grid-template-columns: 30px 1fr;
  }

  .support-contact-row .field:last-child {
    grid-column: 2;
  }

  .users-pagination,
  .settings-save-row {
    align-items: stretch;
    flex-direction: column;
  }

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

  .whatsapp-support {
    right: 12px;
    bottom: 82px;
  }

  .whatsapp-support-label {
    display: none;
  }

  .whatsapp-float {
    width: 52px;
    height: 52px;
    min-height: 52px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
  }

  .whatsapp-float span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
}

@media (max-width: 430px) {
  .mascot-settings-card,
  .whatsapp-settings-card {
    padding: 18px;
  }

  .mascot-choice-visual {
    height: 120px;
  }

  .comparison-entity-editor,
  .user-directory-filters {
    grid-template-columns: 1fr;
  }

  .comparison-entity-editor .field:first-child,
  .user-directory-filters .search-box,
  .support-contact-row .field:last-child {
    grid-column: auto;
  }

  .support-contact-row {
    grid-template-columns: 1fr;
  }

  .support-contact-number {
    justify-self: start;
  }

  .pagination-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .page-indicator {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

/* Profundidad nativa inspirada en las referencias 3D, sin librerías externas. */
.mini-bars .bar,
.report-bars .report-bar {
  position: relative;
  overflow: visible;
  transform: translateZ(0) skewY(-1deg);
  box-shadow: 4px 5px 0 color-mix(in srgb, currentColor 26%, transparent), 0 9px 16px rgba(49, 9, 20, .08);
}

.mini-bars .bar::before,
.report-bars .report-bar::before {
  content: "";
  position: absolute;
  height: 5px;
  inset: -4px -1px auto;
  border-radius: 4px 4px 1px 1px;
  background: rgba(255, 255, 255, .4);
  transform: skewX(-28deg);
  transform-origin: bottom;
}

.mini-bars .bar::after,
.report-bars .report-bar::after {
  content: "";
  position: absolute;
  width: 5px;
  inset: 2px -5px 0 auto;
  border-radius: 0 3px 3px 0;
  background: rgba(49, 9, 20, .18);
  transform: skewY(-35deg);
  transform-origin: left;
}

/* Estudios 3D incorporados desde las referencias HTML del responsable. */
.three-chart-shell {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 390px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 16% 10%, rgba(173, 15, 47, .34), transparent 35%),
    radial-gradient(circle at 85% 80%, rgba(255, 189, 89, .12), transparent 34%),
    linear-gradient(155deg, #17050b 0%, #310914 54%, #14050a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 18px 36px rgba(49, 9, 20, .16);
  isolation: isolate;
}

.three-chart-shell::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: .38;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.three-canvas-host,
.three-chart-fallback {
  position: absolute;
  z-index: 1;
  inset: 0;
}

.three-canvas-host {
  touch-action: none;
}

.three-canvas-host canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: grab;
  outline: none;
}

.three-canvas-host canvas:active { cursor: grabbing; }
.three-canvas-host canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--lime); }

.three-chart-fallback {
  display: grid;
  place-items: center;
  padding: 72px 24px 76px;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.three-ready .three-chart-fallback {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.three-chart-toolbar,
.three-chart-hud,
.three-chart-legend,
.three-pie-controls,
.three-pie-center,
.three-chart-tooltip,
.three-chart-caption {
  position: absolute;
  z-index: 4;
}

.three-chart-toolbar,
.three-pie-controls,
.three-chart-hud,
.three-chart-legend {
  border: 1px solid rgba(255, 255, 255, .11);
  background: rgba(25, 5, 12, .72);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .25);
  backdrop-filter: blur(12px);
}

.three-chart-toolbar {
  top: 14px;
  left: 14px;
  padding: 5px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.three-view-switch {
  display: flex;
  align-items: center;
  gap: 4px;
}

.three-chart-toolbar button,
.three-pie-controls button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #dbc4cb;
  background: rgba(255,255,255,.055);
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms cubic-bezier(.16,1,.3,1);
}

.three-chart-toolbar button:hover,
.three-pie-controls button:hover,
.three-chart-toolbar button.active,
.three-pie-controls button.active {
  color: #fff;
  border-color: rgba(255, 189, 89, .35);
  background: rgba(173, 15, 47, .58);
  transform: translateY(-1px);
}

.three-chart-toolbar button:focus-visible,
.three-pie-controls button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.three-chart-toolbar .icon,
.three-pie-controls .icon {
  width: 14px;
  height: 14px;
}

.three-rotate-control {
  border-left-color: rgba(255,255,255,.12) !important;
}

.three-chart-legend {
  top: 14px;
  right: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #f1dfe4;
  font-size: 9px;
  font-weight: 750;
}

.three-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.three-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--legend-color);
  box-shadow: 2px 3px 0 color-mix(in srgb, var(--legend-color) 45%, #16050a);
}

.three-chart-hud {
  top: 14px;
  left: 14px;
  padding: 11px 13px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.three-chart-hud > span + span {
  padding-left: 14px;
  border-left: 1px solid rgba(255,255,255,.12);
}

.three-chart-hud small,
.three-chart-hud strong {
  display: block;
}

.three-chart-hud small {
  color: #bba3ab;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.three-chart-hud strong {
  margin-top: 3px;
  color: #fff;
  font-size: 12px;
}

.three-chart-tooltip {
  left: var(--tooltip-x, 50%);
  top: var(--tooltip-y, 50%);
  width: min(205px, calc(100% - 24px));
  padding: 11px 13px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 13px;
  display: grid;
  gap: 4px;
  color: #fff;
  background: rgba(18, 4, 9, .94);
  box-shadow: 0 16px 34px rgba(0,0,0,.34);
  backdrop-filter: blur(14px);
  pointer-events: none;
  transform: translateY(-100%);
}

.three-chart-tooltip[hidden] { display: none; }
.three-chart-tooltip strong { font-size: 10px; }
.three-chart-tooltip span { color: var(--lime); font-size: 14px; font-weight: 900; }
.three-chart-tooltip small { color: #cdb8be; font-size: 8px; line-height: 1.4; }

.three-chart-caption {
  right: 16px;
  bottom: 12px;
  left: 16px;
  color: rgba(255,255,255,.58);
  font-size: 8px;
  text-align: center;
  pointer-events: none;
}

.three-pie-chart-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.three-pie-chart {
  min-height: 410px;
}

.three-pie-controls {
  bottom: 30px;
  left: 50%;
  padding: 5px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
  transform: translateX(-50%);
}

.three-pie-center {
  top: 50%;
  left: 50%;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50%;
  display: none;
  place-content: center;
  padding: 9px;
  color: var(--ink);
  background: rgba(255,255,255,.94);
  box-shadow: 0 12px 30px rgba(0,0,0,.24), inset 0 1px 5px rgba(49,9,20,.08);
  text-align: center;
  transform: translate(-50%, -45%);
  pointer-events: none;
}

.three-ready .three-pie-center { display: grid; }
.three-pie-center strong,
.three-pie-center span { display: block; }
.three-pie-center strong { font-size: 11px; }
.three-pie-center span { margin-top: 3px; color: var(--muted); font-size: 7px; }

.three-pie-chart .three-chart-fallback .donut-scene {
  width: min(230px, 70%);
}

.three-pie-chart-grid > .donut-legend {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, #fbf7f8);
}

.donut-legend > button.three-hover {
  border-color: color-mix(in srgb, var(--green) 32%, var(--line));
  background: var(--green-soft);
  box-shadow: 0 7px 16px rgba(49,9,20,.08);
  transform: translateX(5px);
}

.three-bars-chart {
  min-height: clamp(360px, 46vw, 470px);
}

.three-bars-chart .three-chart-fallback .mini-bars {
  width: min(900px, 92%);
  height: 68%;
  min-height: 240px;
  margin: auto;
}

@media (max-width: 900px) {
  .three-pie-chart-grid > .donut-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three-pie-chart { min-height: 390px; }
}

@media (max-width: 700px) {
  .three-chart-shell { min-height: 360px; border-radius: 17px; }
  .three-pie-chart { min-height: 370px; }
  .three-chart-toolbar { right: 10px; left: 10px; justify-content: space-between; }
  .three-chart-toolbar button,
  .three-pie-controls button { min-width: 34px; padding-inline: 8px; }
  .three-chart-toolbar button span,
  .three-pie-controls button span { display: none; }
  .three-chart-legend { top: 62px; right: 10px; padding: 8px 10px; }
  .three-chart-hud { top: 10px; left: 10px; }
  .three-pie-controls { bottom: 28px; }
  .three-pie-chart-grid > .donut-legend { grid-template-columns: 1fr; }
  .three-pie-center { width: 76px; height: 76px; }
  .three-chart-caption { font-size: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .three-chart-fallback,
  .three-chart-toolbar button,
  .three-pie-controls button,
  .donut-legend > button.three-hover { transition: none !important; }
}

/* ========================================================================== 
   REFINAMIENTO UI/UX · CRÉDITOS Y MOVIMIENTOS · 2026-10
   ========================================================================== */

/* Interacciones más breves y sin reanimar listas durante filtros en vivo. */
.movement-category-card,
.movement-category-option,
.movement-row,
.comparison-card,
.loan-icon-btn,
.loan-swatch {
  transition-duration: 160ms;
}

.movement-list.is-refreshed .movement-row,
.movement-chart-card.is-refreshed *,
.credit-tab-content.comparison-live-update .comparison-card,
.credit-tab-content.comparison-live-update .comparison-area,
.credit-tab-content.comparison-live-update .chart-line-sim {
  animation: none !important;
}

.movement-row:hover {
  transform: none;
}

/* Movimientos: acceso directo, acciones de archivo agrupadas y modal progresivo. */
.movement-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.movement-category-card {
  min-height: 72px;
}

.movement-category-more {
  border-style: dashed;
  background: color-mix(in srgb, var(--category-color) 3%, white);
}

.sheet-menu {
  position: relative;
}

.sheet-menu > summary {
  list-style: none;
}

.sheet-menu > summary::-webkit-details-marker {
  display: none;
}

.sheet-menu > summary .icon:last-child {
  width: 12px;
  height: 12px;
  transition: transform 160ms ease;
}

.sheet-menu[open] > summary .icon:last-child {
  transform: rotate(180deg);
}

.sheet-menu-popover {
  position: absolute;
  z-index: 45;
  top: calc(100% + 8px);
  right: 0;
  width: min(290px, calc(100vw - 40px));
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: grid;
  gap: 3px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(49, 9, 20, 0.18);
}

.sheet-menu-action {
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border: 0;
  border-radius: 11px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.sheet-menu-action:hover,
.sheet-menu-action:focus-visible {
  background: var(--green-soft);
  outline: none;
}

.sheet-menu-action > .icon {
  width: 18px;
  height: 18px;
  justify-self: center;
  color: var(--green);
}

.sheet-menu-action span,
.sheet-menu-action strong,
.sheet-menu-action small {
  min-width: 0;
  display: block;
}

.sheet-menu-action strong {
  font-size: 12px;
}

.sheet-menu-action small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.movement-concept-picker {
  display: grid;
  gap: 13px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.movement-concept-picker[hidden] {
  display: none;
}

.movement-selection-card {
  min-height: 60px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--category-color) 24%, var(--line));
  border-radius: 14px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: color-mix(in srgb, var(--category-color) 5%, white);
}

.movement-selection-card[hidden] {
  display: none;
}

.movement-selection-card > span {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--category-color);
  background: color-mix(in srgb, var(--category-color) 13%, white);
}

.movement-selection-card > span .icon {
  width: 19px;
  height: 19px;
}

.movement-selection-card small,
.movement-selection-card strong {
  display: block;
}

.movement-selection-card small {
  color: var(--muted);
  font-size: 10px;
}

.movement-selection-card strong {
  margin-top: 2px;
  font-size: 14px;
}

.movement-selection-card button {
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--category-color) 25%, var(--line));
  border-radius: 10px;
  color: var(--category-color);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.movement-modal {
  width: min(100%, 700px);
}

.movement-modal .form-stack {
  gap: 14px;
}

.movement-category-option {
  min-height: 64px;
}

.movement-category-option strong,
.movement-copy strong,
.movement-amount,
.movement-summary strong {
  font-size: max(12px, 0.78rem);
}

.movement-copy span,
.movement-quick-heading small {
  font-size: 11px;
}

.movement-row .row-action {
  min-width: 40px;
  width: 40px;
  min-height: 40px;
  height: 40px;
}

/* Créditos: selector estable, iconos centrados y objetivos táctiles cómodos. */
.loan-identity-trigger {
  min-height: 42px;
  padding-inline: 11px;
  font-size: 11px;
}

.loan-identity-trigger .icon {
  width: 17px;
  height: 17px;
}

.loan-identity-popover {
  top: 50px;
  width: min(520px, calc(100vw - 54px));
  padding: 16px;
}

.loan-identity-popover-head button {
  width: 44px;
  height: 44px;
}

.loan-identity-popover-head strong {
  font-size: 14px;
}

.loan-identity-popover-head small,
.loan-identity-section-label {
  font-size: 10px;
}

.loan-identity-popover .loan-icons-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.loan-identity-popover .loan-icon-btn {
  min-height: 62px;
  padding: 8px 4px;
}

.loan-identity-popover .loan-icon-btn-text {
  font-size: 9px;
}

.loan-icon-btn .icon {
  width: 22px;
  height: 22px;
}

.loan-swatch,
.loan-color-native-label {
  width: 44px;
  height: 44px;
}

.loan-swatch:hover,
.loan-swatch.active,
.loan-color-native-label:hover {
  transform: scale(1.06);
}

.loan-color-swatches {
  gap: 9px;
}

.loan-color-hex {
  font-size: 12px;
}

.loan-chip {
  min-height: 72px;
  padding: 12px;
  grid-template-columns: 46px minmax(0, 1fr) 42px;
  gap: 12px;
}

/* Especificidad intencional: evita que la regla textual de .loan-chip span
   desplace el distintivo a la esquina superior izquierda. */
.loan-chip > .bank-mark {
  width: 46px;
  height: 46px;
  margin: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  align-self: center;
}

.loan-chip > .bank-mark .icon {
  width: 22px;
  height: 22px;
}

.loan-chip-copy,
.loan-chip-copy strong,
.loan-chip-copy span {
  min-width: 0;
  display: block;
}

.loan-chip-copy strong {
  font-size: 14px;
}

.loan-chip-copy span {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.bank-context .bank-mark {
  margin: 0;
  display: grid;
  place-items: center;
}

/* La cuota es la respuesta principal; la explicación avanzada queda disponible. */
.loan-formula-card {
  padding: clamp(18px, 2.2vw, 26px);
  border-color: color-mix(in srgb, var(--green) 16%, var(--line));
  background:
    radial-gradient(circle at 100% 0, rgba(255, 189, 89, 0.13), transparent 36%),
    linear-gradient(145deg, #fff, #fbf7f8);
}

.loan-formula-head h3 {
  font-size: clamp(17px, 1.7vw, 21px);
}

.loan-payment-result {
  margin-top: 16px;
  padding: 17px 20px;
  border-radius: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--forest), var(--green));
  box-shadow: 0 12px 24px rgba(82, 13, 33, 0.15);
}

.loan-payment-result span,
.loan-payment-result small {
  display: block;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 750;
}

.loan-payment-result strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-size: clamp(25px, 3vw, 36px);
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.loan-payment-result small {
  margin-top: 3px;
}

.loan-equation {
  min-height: 74px;
  padding: 16px;
  gap: 12px;
  font-size: clamp(15px, 1.6vw, 19px);
  font-variant-numeric: tabular-nums;
}

.loan-equation > strong {
  padding: 9px 13px;
  font-size: clamp(18px, 2vw, 24px);
}

.formula-fraction b {
  padding: 3px 10px;
  font-size: 0.88em;
}

.loan-formula-details {
  margin-top: 11px;
  border-top: 1px solid var(--line);
}

.loan-formula-details > summary {
  min-height: 44px;
  padding: 8px 2px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.loan-formula-details > summary::-webkit-details-marker {
  display: none;
}

.loan-formula-details > summary .icon {
  width: 17px;
  height: 17px;
}

.loan-formula-parameters small,
.loan-rate-conversion {
  font-size: 11px;
}

.loan-formula-parameters strong {
  font-size: 13px;
}

.loan-summary-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.loan-summary-strip .summary-cell {
  padding: 15px;
}

.loan-summary-strip .summary-cell span {
  font-size: 11px;
}

.loan-summary-strip .summary-cell strong {
  font-size: 17px;
}

/* Comparativa: lectura primero por impacto, riesgos visibles y detalle colapsable. */
.comparison-card {
  padding-bottom: 18px;
}

.comparison-cash-signal {
  margin: 0 0 16px;
  padding: 11px;
  border: 1px solid #bee3cf;
  border-radius: 13px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  background: #eef9f3;
}

.comparison-cash-signal.risk {
  border-color: #f2c5cd;
  background: #fff3f5;
}

.comparison-signal-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #08744e;
  background: #d8f2e4;
}

.comparison-cash-signal.risk .comparison-signal-icon {
  color: var(--green-dark);
  background: #f9dce2;
}

.comparison-signal-icon .icon {
  width: 17px;
  height: 17px;
}

.comparison-cash-signal small,
.comparison-cash-signal strong,
.comparison-signal-status {
  display: block;
}

.comparison-cash-signal small {
  color: var(--muted);
  font-size: 10px;
}

.comparison-cash-signal strong {
  margin-top: 2px;
  font-size: 12px;
}

.comparison-signal-status {
  grid-column: 2;
  color: #08744e;
  font-size: 10px;
  font-weight: 800;
}

.comparison-cash-signal.risk .comparison-signal-status {
  color: var(--green-dark);
}

.comparison-chart-heading-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.comparison-view-toggle {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: inline-flex;
  background: var(--surface-soft);
}

.comparison-view-toggle button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.comparison-view-toggle button.active {
  color: #fff;
  background: var(--green);
  box-shadow: 0 5px 12px rgba(173, 15, 47, 0.18);
}

.comparison-chart-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.comparison-chart-wrap > .comparison-depth-chart {
  min-width: 720px;
}

.comparison-table-disclosure {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.comparison-table-disclosure > summary {
  min-height: 62px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  list-style: none;
  cursor: pointer;
}

.comparison-table-disclosure > summary::-webkit-details-marker {
  display: none;
}

.comparison-table-disclosure > summary > .icon:first-child {
  color: var(--green);
}

.comparison-table-disclosure > summary > .icon:last-child {
  width: 15px;
  height: 15px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.comparison-table-disclosure[open] > summary > .icon:last-child {
  transform: rotate(180deg);
}

.comparison-table-disclosure summary strong,
.comparison-table-disclosure summary small {
  display: block;
}

.comparison-table-disclosure summary strong {
  font-size: 13px;
}

.comparison-table-disclosure summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.comparison-table-disclosure .table-scroll {
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .loan-form-card {
    position: static;
  }

  .comparison-chart-card .card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .comparison-chart-heading-actions {
    justify-content: space-between;
  }
}

@media (max-width: 700px) {
  .movement-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .movement-summary {
    min-height: 84px;
    padding: 11px;
  }

  .movement-summary-icon {
    width: 34px;
    height: 34px;
  }

  .movement-row {
    grid-template-columns: 40px minmax(0, 1fr) auto 40px;
  }

  .movement-row .row-action {
    display: grid;
  }

  .loan-identity-popover {
    top: 50px;
    max-height: min(72vh, 640px);
  }

  .loan-identity-trigger span {
    display: inline;
  }

  .loan-identity-popover .loan-icons-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .loan-color-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .comparison-view-toggle {
    width: 100%;
  }

  .comparison-view-toggle button {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .movement-summary-grid {
    grid-template-columns: 1fr;
  }

  .movement-summary {
    min-height: 72px;
  }

  .movement-entry-row {
    grid-template-columns: 1fr;
  }

  .movement-selection-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .movement-selection-card button {
    grid-column: 1 / -1;
  }

  .movement-row {
    grid-template-columns: 38px minmax(0, 1fr) 40px;
  }

  .movement-row .movement-amount {
    grid-column: 2;
    justify-self: start;
  }

  .movement-row .row-action {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .sheet-menu {
    margin-left: auto;
  }

  .sheet-menu > summary span {
    display: inline;
  }

  .loan-payment-result {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .loan-payment-result strong {
    grid-row: auto;
    grid-column: auto;
    margin: 4px 0;
  }

  .loan-equation {
    justify-content: flex-start;
  }

  .loan-formula-parameters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .loan-summary-strip {
    grid-template-columns: 1fr 1fr;
  }

  .comparison-chart-heading-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 370px) {
  .loan-identity-trigger span {
    display: none;
  }

  .loan-identity-popover .loan-icons-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .loan-summary-strip {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .movement-category-card,
  .movement-category-option,
  .movement-row,
  .comparison-card,
  .comparison-area,
  .comparison-depth-chart .chart-line-sim {
    animation: none !important;
  }
}

.comparison-dot-group:focus-visible {
  outline: none;
}

.comparison-dot-group:focus-visible .entity-dot {
  stroke: var(--ink);
  stroke-width: 3;
}

.comparison-table tr[role="button"]:focus-visible {
  outline: 3px solid rgba(173, 15, 47, 0.28);
  outline-offset: -3px;
}
