/* Identidad de la calculadora Circular, compartida por el panel de agencias. */
body.portal-theme {
  --yellow: #bae6fd;
  --ink: #0f172a;
  --muted: #64748b;
  --paper: #f8fafc;
  --line: #e2e8f0;
  --green: #047857;
  --radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--paper);
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
}
.portal-theme h1, .portal-theme h2, .portal-theme h3 {letter-spacing: -.025em; color: var(--ink);}
.portal-theme :is(button,a,input,select,textarea):focus-visible {outline: 3px solid #0284c7; outline-offset: 3px;}
.portal-theme .workspace {background: var(--paper);}
.portal-theme .sidebar {background: #17191c; border-right: 1px solid #272b30;}
.portal-theme .sidebar .logo {color: #fff;}
.portal-theme .sidebar .mark {background: #bae6fd; color: #0c4a6e;}
.portal-theme .sidebar-label {font-size: 9px; font-weight: 600; color: #94a3b8;}
.portal-theme .nav-btn {font-size: 12px; font-weight: 500; border-radius: 8px; min-height: 43px;}
.portal-theme .nav-btn.active {background: #bae6fd; color: #0c4a6e; font-weight: 800;}
.portal-theme .nav-btn:hover:not(.active) {background: #262b33; color: #f8fafc;}
.portal-theme .avatar {background: #293441; color: #7dd3fc;}
.portal-theme .agency b {font-size: 12px;}
.portal-theme .agency small {font-size: 10px;}
.portal-theme .portal-top {box-shadow: 0 1px 2px #0f172a05;}
.portal-theme .breadcrumb {font-size: 12px;}
.portal-theme .content {padding-top: 30px;}
.portal-theme .page-heading h1 {font-size: 28px; font-weight: 800;}
.portal-theme .page-heading p {font-size: 13px; line-height: 1.65;}
.portal-theme .notice {background: #f0f9ff; color: #075985; border-color: #e0f2fe; font-size: 11px;}
.portal-theme .btn {background: #bae6fd; border-color: #bae6fd; color: #0c4a6e; border-radius: 8px; font-weight: 800; gap: 10px; min-height: 44px;}
.portal-theme .btn:hover {background: #7dd3fc; border-color: #7dd3fc; transform: translateY(-1px);}
.portal-theme .btn.yellow {background: #bae6fd; border-color: #bae6fd; color: #0c4a6e;}
.portal-theme .btn.yellow:hover {background: #7dd3fc; border-color: #7dd3fc;}
.portal-theme .btn.outline, .portal-theme .btn.light {background: #fff; color: #334155; border-color: #cbd5e1;}
.portal-theme .btn.outline:hover, .portal-theme .btn.light:hover {background: #f0f9ff; border-color: #7dd3fc; color: #075985;}
.portal-theme .btn.small {min-height: 35px; font-size: 11px;}
.portal-theme .tag {background: #f1f5f9; color: #475569; border-radius: 6px; font-size: 10px; font-weight: 700;}
.portal-theme .tag.yellow {background: #e0f2fe; color: #075985;}
.portal-theme .tag.green {background: #ecfdf5; color: #047857;}
.portal-theme .eyebrow {color: #64748b; letter-spacing: 1.5px; font-weight: 800;}
.portal-theme :is(.panel,.tool,.metric,.vehicle) {background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 1px 3px #0f172a08;}
.portal-theme .panel h2 {font-size: 18px; font-weight: 800;}
.portal-theme .panel h3 {font-weight: 700;}
.portal-theme .panel-sub {font-size: 12px; line-height: 1.65;}
.portal-theme .welcome {background: #fff; color: #1e293b; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 1px 3px #0f172a08;}
.portal-theme .welcome .eyebrow {color: #64748b;}
.portal-theme .welcome h2 {font-weight: 600;}
.portal-theme .welcome h2 strong {color: #0284c7; font-weight: 800;}
.portal-theme .welcome p {color: #64748b; font-size: 13px;}
.portal-theme .welcome-art {color: #38bdf8;}
.portal-theme .welcome-art small {color: #64748b;}
.portal-theme .tool {min-height: 155px;}
.portal-theme .tool:hover {border-color: #7dd3fc; box-shadow: 0 5px 15px #0ea5e90c; transform: translateY(-2px);}
.portal-theme .tool .icon {color: #0ea5e9; font-size: 23px; margin-bottom: 17px;}
.portal-theme .tool strong {font-size: 13px; font-weight: 800;}
.portal-theme .tool p {font-size: 11px; line-height: 1.65;}
.portal-theme .empty {background: #f8fafc; border-color: #cbd5e1; border-radius: 8px;}
.portal-theme .empty p {font-size: 12px;}
.portal-theme .news-line {border-color: #e2e8f0;}
.portal-theme .news-line i {color: #0ea5e9;}
.portal-theme .news-line p {font-size: 11px;}
.portal-theme .vehicle-art {background: linear-gradient(135deg,#f0f9ff,#e2e8f0); color: #334155;}
.portal-theme .vehicle-art:before {background: #bae6fd;}
.portal-theme .vehicle-art small {color: #64748b;}
.portal-theme .vehicle-body h3 {font-weight: 800;}
.portal-theme .vehicle-body p {font-size: 12px;}
.portal-theme .field {gap: 8px; margin-bottom: 18px;}
.portal-theme .field label {font-size: 12px; font-weight: 700; color: #334155;}
.portal-theme .field small {font-size: 11px;}
.portal-theme :is(input,select,textarea) {border-color: #cbd5e1; border-radius: 8px; background: #fff; color: #0f172a; font-size: 13px; min-height: 44px; transition: border-color .15s,box-shadow .15s;}
.portal-theme :is(input,textarea)::placeholder {color: #94a3b8;}
.portal-theme :is(input,select,textarea):focus {border-color: #38bdf8; box-shadow: 0 0 0 3px #e0f2fe;}
.portal-theme :is(input,select,textarea):disabled {background: #f1f5f9; color: #64748b;}
.portal-theme input[type=checkbox] {width: 16px; min-height: 16px; height: 16px; accent-color: #0284c7; vertical-align: middle; margin-right: 7px;}
.portal-theme .result {background: #fff; color: #1e293b; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 1px 3px #0f172a08;}
.portal-theme .result .eyebrow {color: #64748b;}
.portal-theme .result strong.big {color: #0284c7; font-weight: 800; font-size: 34px;}
.portal-theme .result .sub, .portal-theme .result .caption {color: #64748b;}
.portal-theme .result-row {border-color: #e2e8f0; font-size: 12px; color: #0f172a;}
.portal-theme .result-row span {color: #64748b;}
.portal-theme .caption {font-size: 11px;}
.portal-theme .metric {padding: 23px;}
.portal-theme .metric strong {color: #0284c7; font-weight: 800; font-size: 32px;}
.portal-theme .metric span {font-size: 11px; line-height: 1.5;}
.portal-theme :is(.data-table,.compare-table) {font-size: 12px; color: #334155;}
.portal-theme :is(.data-table,.compare-table) th {background: #f8fafc; font-size: 11px; font-weight: 700; color: #64748b; padding: 14px 12px;}
.portal-theme .data-table td {padding: 15px 12px;}
.portal-theme .data-table tbody tr:hover {background: #f0f9ff;}
.portal-theme .data-table button {background: #e0f2fe; color: #075985; border-radius: 6px; padding: 8px 11px; font-size: 11px; font-weight: 700;}
.portal-theme .compare-table th:nth-child(2) {border-top-color: #38bdf8;}
.portal-theme .bar {background: #e0f2fe; height: 8px;}
.portal-theme .bar i {background: #38bdf8;}
.portal-theme .dialog {border: 1px solid #e2e8f0; border-radius: 12px; color: #1e293b; background: #fff;}
.portal-theme .dialog-inner h2 {font-weight: 800;}
.portal-theme .dialog-inner p {font-size: 13px; color: #64748b;}
.portal-theme .close {background: #f1f5f9; color: #475569;}
.portal-theme .toast {background: #0c4a6e; border-color: #075985; border-radius: 8px;}
.portal-theme .proposal-section {border-top: 1px solid #e2e8f0; padding-top: 20px; margin-top: 4px;}
.portal-theme .proposal-section h3 {font-size: 15px; margin-bottom: 15px;}
.portal-theme .proposal-section .caption {margin-top: 0;}
.portal-theme .money-input {position: relative;}
.portal-theme .money-input>span {position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #64748b; font-size: 13px; pointer-events: none;}
.portal-theme .money-input input {padding-left: 30px;}
@media(max-width:760px) {
  .portal-theme .content {padding: 24px 18px 45px;}
  .portal-theme .page-heading h1 {font-size: 25px;}
  .portal-theme .metric {padding: 18px;}
  .portal-theme .metric strong {font-size: 28px;}
  .portal-theme .panel {padding: 20px;}
  .portal-theme .tool {padding: 18px;}
  .portal-theme .result {padding: 23px;}
  .portal-theme .bar-row {font-size: 10px;}
}

.portal-theme .whatsapp-btn {background: #bbf7d0; border-color: #bbf7d0; color: #14532d;}
.portal-theme .whatsapp-btn:hover {background: #86efac; border-color: #86efac; color: #14532d;}
.wa-icon {width: 18px; height: 18px; flex-shrink: 0;}
.portal-theme .proposal-form .compact-input {width: 100%;}
.portal-theme .circular-breakdown {padding: 20px; color: #0f172a;}
.breakdown-heading {display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 13px; margin: 0 0 16px; border-bottom: 1px solid #e2e8f0; font-size: 13px; font-weight: 800; line-height: 1.5;}
.breakdown-heading small {color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; font-size: 10px; font-weight: 700;}
.breakdown-icon {color: #0ea5e9; margin-right: 5px;}
.breakdown-vehicle {font-size: 12px; font-weight: 700; color: #334155; margin-bottom: 14px;}
.breakdown-row {display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 10px 0; border-bottom: 1px solid #e2e8f0; font-size: 13px; line-height: 1.5;}
.breakdown-row>span {color: #475569; min-width: 0;}
.breakdown-row>b {text-align: right; color: #0f172a; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;}
.breakdown-row.detail {font-size: 11px; padding-left: 7px;}
.breakdown-row.detail>span {color: #64748b;}
.breakdown-row.detail>b {color: #334155; font-weight: 500;}
.breakdown-row.subtotal,.breakdown-row.total {padding: 10px 12px; margin: 9px 0; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px;}
.breakdown-row.total {font-size: 15px; font-weight: 800;}
.breakdown-group {border-top: 1px solid #e2e8f0; margin-top: 12px; padding-top: 5px;}
.breakdown-row.advance {margin-top: 12px; padding: 12px; border: 0; border-radius: 8px; background: #bae6fd; font-size: 13px; font-weight: 800;}
.breakdown-row.advance>span,.breakdown-row.advance>b {color: #0c4a6e; font-weight: 800;}
.credit-summary {background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px; margin: 18px 0;}
.credit-summary h4,.trade-summary h4 {font-size: 13px; padding-bottom: 9px; margin: 0; border-bottom: 1px solid #e2e8f0;}
.credit-summary .breakdown-row.detail {border-bottom: 0; padding: 6px 0;}
.breakdown-row.installment {border-bottom: 0; font-weight: 800;}
.breakdown-row.installment>b {font-size: 16px; color: #0284c7; font-weight: 800;}
.trade-summary {margin-top: 20px;}
.quote-actions {display: grid; gap: 10px; margin-top: 20px;}
.quote-actions .btn {width: 100%; font-size: 12px;}
#quoteCopyText {min-height: 320px;}
@media(max-width:760px) {
 .portal-theme .proposal-form .compact-input {width: 100%;}
 .portal-theme .circular-breakdown {padding: 18px;}
 .breakdown-row {font-size: 12px;}
 .breakdown-row.advance {font-size: 12px;}
}

/* Columnas compactas y controles alineados dentro de cada fila. */
.portal-theme .proposal-form .form-grid {grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; max-width: 475px;}
.portal-theme .proposal-form .field {align-content: start; grid-auto-rows: max-content;}
.portal-theme .proposal-form>.form-grid>.field:not(.full)>label {min-height: 34px; display: flex; align-items: flex-end;}
@media(max-width:760px) {
 .portal-theme .proposal-form .form-grid {grid-template-columns: 1fr; max-width: none;}
 .portal-theme .proposal-form>.form-grid>.field:not(.full)>label {min-height: 0;}
}

.portal-theme .top-actions .whatsapp-btn {min-height: 49px; padding: 8px 14px;}
.contact-name {display: grid; gap: 3px; text-align: center; line-height: 1.25;}
.contact-name small {font-size: 10px; font-weight: 600; letter-spacing: .3px;}
@media(max-width:420px) {
 .portal-theme .top-actions .whatsapp-btn {font-size: 10px; padding: 7px 9px; gap: 7px;}
 .contact-name small {font-size: 9px;}
}

.portal-theme .top-actions .wa-icon {width: 30px; height: 30px; align-self: center;}
.portal-theme .proposal-form :is(#term,#forms) {text-align: center;}
.portal-theme .proposal-form #forms {padding-right: 30px;}
.portal-theme .proposal-form .percent-input {display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #0f172a;}
.portal-theme .proposal-form .percent-input input {min-width: 0; max-width: calc(100% - 35px); min-height: 42px; padding: 0; border: 0; border-radius: 8px; box-shadow: none; background: transparent; text-align: right; appearance: textfield;}
.percent-input input::-webkit-inner-spin-button,.percent-input input::-webkit-outer-spin-button {-webkit-appearance: none; margin: 0;}
.portal-theme .proposal-form .percent-input:focus-within {border-color: #38bdf8; box-shadow: 0 0 0 3px #e0f2fe;}
.percent-input>span {font-size: 13px; pointer-events: none;}
@media(max-width:420px) {.portal-theme .top-actions .wa-icon {width: 26px; height: 26px;}}

.portal-theme .proposal-layout {grid-template-columns: minmax(0,.82fr) minmax(0,1fr);}
@media(max-width:760px) {.portal-theme .proposal-layout {grid-template-columns: 1fr;}}

.history-tabs{display:flex;gap:8px;margin:0 0 20px;flex-wrap:wrap;border-bottom:1px solid #e2e8f0;padding-bottom:12px}
.history-tabs button{border:1px solid #e2e8f0;border-radius:10px;padding:13px 18px;background:#fff;color:#64748b;font:inherit;font-weight:600;cursor:pointer}
.history-tabs button[aria-selected="true"]{background:#bae6fd;border-color:#7dd3fc;color:#0c4a6e}
.history-tabs button span{display:inline-block;margin-left:8px;background:#f1f5f9;color:#334155;border-radius:20px;padding:2px 8px;font-size:12px}
.history-tools{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:20px}
.history-tools h2{margin:0}

.budget-search{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,380px) auto;align-items:end;gap:14px;margin-bottom:20px}
.budget-search .field{margin:0}.budget-search .btn{min-height:46px}
@media(max-width:700px){.budget-search{grid-template-columns:1fr}.budget-search .btn{justify-self:start}}

.budget-date-range{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0;padding:0;border:0;min-width:0}
.budget-date-range legend{font-size:12px;font-weight:600;color:#64748b;margin-bottom:8px;padding:0}
@media(max-width:1000px){.budget-search{grid-template-columns:1fr}.budget-search .btn{justify-self:start}}
