:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --text: #31435A;
    --muted: #7A8695;
    --border: #d1d5db;
    --border-soft: #e5e7eb;
    --primary: #31435A;
    --primary-soft: #7A8695;
    --danger: #b91c1c;
    --warning-bg: #ffffff;
    --warning-border: #b91c1c;
    --error-bg: #ffffff;
    --error-border: #b91c1c;
    --success-bg: #ecfdf5;

    --font-base: 'DefaultBase', Arial, Helvetica, sans-serif;
    --font-heading: 'DefaultTitulos', var(--font-base);
    --font-action: 'DefaultAcciones', var(--font-base);
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

@font-face {
    font-family: 'DefaultBase';
    src: url('/fonts/default/base.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'DefaultTitulos';
    src: url('/fonts/default/titulos.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'DefaultAcciones';
    src: url('/fonts/default/acciones.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

body {
    margin: 0;
    font-family: var(--font-base, Arial, Helvetica, sans-serif);
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
}

@font-face {
    font-family: 'Material Icons Outlined';
    font-style: normal;
    font-weight: 400;
    src: url('/fonts/material-icons-outlined/MaterialIconsOutlined-Regular.otf') format('opentype');
}

.material-icons-outlined {
    font-family: 'Material Icons Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 22px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-feature-settings: 'liga';
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

a,
a:visited {
    text-decoration: none;
}

a:hover,
a:focus,
a:active {
    color: var(--primary-soft);
    text-decoration: none;
    outline: none;
    box-shadow: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
.page-header h2,
.section-card-header h3,
.result-section-header h4,
.result-header h3,
.auth-header h2 {
    font-family: var(--font-heading, var(--font-base, Arial, Helvetica, sans-serif));
}

button,
.auth-actions a,
.topbar-user a {
    font-family: var(--font-action, var(--font-base, Arial, Helvetica, sans-serif));
}

input,
select,
textarea {
    font-family: var(--font-base, Arial, Helvetica, sans-serif);
}

.container {
    width: min(1500px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 5px 0;
}

.topbar h1 {
    margin: 0 0 6px 0;
    font-size: 24px;
}

.topbar p {
    margin: 0;
    color: var(--muted);
}

.topbar-title-full:visited,
.topbar-title-full:hover,
.topbar-title-full:focus,
.topbar-title-full:active,
.topbar-title-mobile:visited,
.topbar-title-mobile:hover,
.topbar-title-mobile:focus,
.topbar-title-mobile:active {
    text-decoration: none;
    color: inherit;
    outline: none;
    box-shadow: none;
}

.topbar-title-mobile,
.topbar-subtitle-mobile {
    display: none;
}

.topbar-user-email {
    color: var(--muted);
    font-size: 13px;
}

.main-content {
    padding: 24px 0 40px;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h2 {
    margin: 0 0 6px 0;
    font-size: 28px;
}

.page-header p {
    margin: 0;
    color: var(--muted);
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
    gap: 24px;
    align-items: start;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px;
}

.result-panel {
    position: sticky;
    top: 110px;
}

#resultadoPanel {
    scroll-margin-top: 110px;
}

.section-card,
.result-section,
.technical-details {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    padding: 18px;
    margin-bottom: 18px;
}

.section-card:last-child,
.result-section:last-child {
    margin-bottom: 0;
}

.result-section-pasarela {
    background: var(--panel-soft);
    border: 1px solid var(--border-soft);
}

.section-card-header,
.result-section-header,
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.section-card-pasarela {
    background: var(--panel-soft);
    border: 1px solid var(--border-soft);
}

.result-section-header {
    display: block;
}

.result-section-header.result-section-header-with-action {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
}

.result-section-header.result-section-header-with-action > div,
.result-section-header-text {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
}

.result-section-pasarela .results-dl {
    grid-template-columns: minmax(210px, 1fr) minmax(110px, max-content);
}

.pasarela-detail-button-form {
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
}

.pasarela-detail-button {
    width: auto;
    min-width: 0;
    white-space: nowrap;
    background: #fff !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.pasarela-detail-button:hover {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
    filter: none !important;
}

.pasarela-detail-button:active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
    filter: none !important;
}

.pasarela-detail-button .material-icons-outlined {
    font-size: 20px;
    line-height: 1;
}

.result-section-header p {
    margin: 4px 0 0 0;
    color: var(--muted);
}

.result-section-header:not(.result-section-header-with-action) > div {
    width: 100%;
}

.section-card-header h3,
.result-section-header h4,
.result-header h3 {
    margin: 0;
}

.section-card-header h3,
.section-card-header-inline h3,
.result-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.section-card-header p,
.result-header p,
.section-card-header div p,
.result-section-header p,
.result-section-header div p {
    margin: 4px 0 0 0;
    color: var(--muted);
}

.section-card-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.section-card-header-inline h3 {
    margin: 0;
}



.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.form-grid-three {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 18px;
}

.form-grid-bases {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 18px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size:16px;
}

.field small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input:not([type]),
select {
    width: 100%;
    height: 37px;
    padding: 8px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #f5f7fa;
    font: inherit;
    font-size: 16px;
    line-height: 19px;
    color: var(--text);
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background-color 0.16s ease;
}

textarea {
    width: 100%;
    height: auto;
    min-height: 90px;
    padding: 8px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    font: inherit;
    font-size: 16px;
    line-height: 19px;
    color: var(--text);
    resize: vertical;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background-color 0.16s ease;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="date"]:hover,
input[type="number"]:hover,
input:not([type]):hover,
select:hover,
textarea:hover {
    border-color: var(--primary);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input:not([type]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

input[disabled],
select[disabled],
textarea[disabled],
input[readonly],
textarea[readonly] {
    background: #eef1f5;
    border-color: #d7dde5;
    color: #9aa4b2;
    cursor: not-allowed;
    opacity: 0.35;
}

input[disabled]::placeholder,
textarea[disabled]::placeholder,
input[readonly]::placeholder,
textarea[readonly]::placeholder {
    color: #b3bbc7;
}

input[disabled]:hover,
select[disabled]:hover,
textarea[disabled]:hover,
input[readonly]:hover,
textarea[readonly]:hover,
input[disabled]:focus,
select[disabled]:focus,
textarea[disabled]:focus,
input[readonly]:focus,
textarea[readonly]:focus {
    background: #eef1f5;
    border-color: #d7dde5;
    color: #9aa4b2;
    box-shadow: none;
    outline: none;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--border-soft);
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
}

.data-table thead th {
    background: #fff;
    position: sticky;
    top: 0;
}

.actions-col {
    width: 110px;
}

.actions-cell {
    white-space: nowrap;
}

button:not(.mode-switch-button) {
    min-height: 36px;
    height: 36px;
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    line-height: 1;
    text-transform: uppercase;
    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        box-shadow 0.16s ease;
}

button:not(.mode-switch-button):hover {
    filter: brightness(0.96);
}

button:not(.mode-switch-button):active {
    filter: brightness(0.92);
}

button:not(.mode-switch-button):focus,
button:not(.mode-switch-button):focus-visible {
    outline: none;
    box-shadow: none;
}

button:not(.mode-switch-button):disabled,
button:not(.mode-switch-button)[disabled] {
    background: #f8fafc;
    color: var(--muted);
    border-color: var(--border);
    cursor: not-allowed;
    filter: none;
    opacity: 1;
}

.secondary-button:not(.mode-switch-button) {
    background: var(--primary-soft);
    color: #fff;
    border-color: var(--primary-soft);
}

.secondary-button:not(.mode-switch-button):hover {
    background: var(--primary-soft);
    color: #fff;
    border-color: var(--primary-soft);
    
}

.secondary-button:not(.mode-switch-button):active {
    filter: brightness(0.56);
}

.danger-button:not(.mode-switch-button) {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.danger-button:not(.mode-switch-button):active {
    filter: brightness(0.92);
}

.danger-button:not(.mode-switch-button):hover {
    filter: brightness(0.96);
}

.button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.button-icon .material-icons-outlined {
    font-size: 20px;
    line-height: 1;
}

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.action-bar-left,
.action-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
    align-items: stretch;
}

.summary-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 78px;
}

.summary-card strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.summary-label {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
    font-size: 0.92rem;
}

.results-dl {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) minmax(110px, max-content);
    gap: 8px 18px;
    margin: 0;
    font-size: 16px;
    align-items: baseline;
}

.results-dl dt {
    font-weight: 500;
    color: var(--muted);
    min-width: 0;
}

.results-dl dd {
    margin: 0;
    font-weight: 600;
    color: var(--text);
    text-align: right;
    white-space: nowrap;
}

.fin-carencia-linea {
    display: block;
    margin-top: 2px;
    font-weight: 500;
    color: var(--danger);
    font-size: 16px;
    line-height: 1.3;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 16px;
}

.comparison-table th,
.comparison-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: top;
}

.comparison-table th:nth-child(2),
.comparison-table th:nth-child(3),
.comparison-table td:nth-child(1),
.comparison-table td:nth-child(2),
.comparison-table td:nth-child(3) {
    border-left: 1px solid var(--border-soft);
    border-right: 1px solid var(--border-soft);
}

.comparison-table:not(.comparison-table-single) tbody tr:first-child td:first-child {
    border-left: 1px solid var(--border-soft);
    border-top: none;
}

.comparison-table th:nth-child(2),
.comparison-table th:nth-child(3) {
    border-top: 1px solid var(--border-soft);
}

.comparison-table th {
    text-align: left;
    font-weight: 600;
    color: var(--text);
    background: var(--panel-soft);
}

.comparison-table th:first-child {
    color: transparent;
    background: transparent;
}

.comparison-table td {
    color: var(--text);
}

.comparison-table td:first-child {
    width: 34%;
    color: var(--muted);
    font-weight: 500;
    background: transparent;
}

.comparison-table th:nth-child(2),
.comparison-table th:nth-child(3) {
    width: 33%;
    text-align: center;
    font-weight: 500;
}

.comparison-table td:nth-child(2),
.comparison-table td:nth-child(3) {
    width: 33%;
    text-align: right;
    font-weight: 600;
}

.comparison-table + .comparison-table {
    margin-top: 14px;
}

.comparison-table-single td:first-child {
    width: 58%;
    border-left: none;
    border-right: none;
    border-top: none;
}

.comparison-table-single td:nth-child(2) {
    width: 42%;
    text-align: right;
    font-weight: 600;
    border-left: none;
    border-right: none;
    border-top: none;
}

.comparison-table-single td:nth-child(3) {
    display: none;
}

.result-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-section-header {
    margin-bottom: 2px;
}

.result-section-header h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.result-section-header p {
    font-size: 14px;
    line-height: 1.35;
}

.result-section > div > strong {
    font-weight: 600;
    color: var(--text);
}

.result-section > div:not(.result-section-header):not(.result-section-header-text) {
    color: var(--muted);
}

.warning-box,
.error-box,
.validation-summary,
.compact-box {
    border-radius: 4px;
    padding: 0px 14px 16px;
    color: var(--danger);
    margin-bottom: 18px;
}

.validation-summary,
.warning-box,
.compact-box {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
}

.error-box {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
}

.validation-summary ul,
.warning-box ul,
.compact-box ul {
    margin-bottom: 0;
}

.empty-state {
    padding: 24px;
    border: 1px dashed var(--border);
    border-radius: 4px;
    background: #fff;
    color: var(--muted);
    text-align: center;
    font-family: var(--font-heading, var(--font-base, Arial, Helvetica, sans-serif));
    font-size:16px;
    margin: 0;
}

.compact-empty-state {
    padding: 16px;
}

.bases-grid-table {
    min-width: 1200px;
}

.year-cell {
    font-weight: 700;
    background: #fff;
}

.month-input {
    min-width: 90px;
}

.month-out-of-range {
    background: transparent;
    border-bottom: 1px solid var(--border-soft);
}

.technical-details summary {
    cursor: pointer;
    font-size: 20px;
    font-weight: 600;
    font-family: var(--font-heading, var(--font-base));
}

.technical-block {
    margin-top: 16px;
}

.technical-block h5 {
    margin: 0 0 8px 0;
}

pre {
    white-space: pre-wrap;
    word-break: break-word;
    background: #0f172a;
    color: #e5e7eb;
    border-radius: 10px;
    padding: 14px;
    overflow: auto;
    margin: 0;
}

.field-validation-error {
    display: block;
    color: var(--danger);
    margin-top: 4px;
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

.manual-days-block {
    margin-top: 18px;
}

.info-box {
    background: #e2e8f0;
    border: 1px solid #d1dbe6;
    border-radius: 4px;
    padding: 14px 16px;
    margin-top: 16px;
    text-align: center;
    color: var(--text);
}

.info-box p {
    margin: 0;
    color: var(--text);
}

.input-disabled-visual {
    background: #f3f4f6 !important;
    border-color: #d1d5db !important;
}

.section-inline-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.result-panel:focus,
.result-panel:focus-visible,
#resultadoPanel:focus,
#resultadoPanel:focus-visible {
    outline: none;
}

.mode-switch {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.section-card-header-inline::after {
    content: "";
    flex-basis: 100%;
    order: 1;
}

.section-card-header-inline .mode-switch {
    order: 2;
    flex: 0 0 auto;
    width: fit-content;
    align-self: flex-start;
}

.mode-switch-button {
    background: #f8fafc;
    color: var(--muted);
    border: none;
    padding: 8px 16px;
    min-height: 36px;
    height: 36px;
    font-weight: 600;
    font-size: 12px;
    line-height: 1;
    border-radius: 0;
    text-transform: uppercase;
}

.mode-switch-button:hover {
    opacity: 1;
    background: #eef2f7;
}

.mode-switch-button.active {
    background: var(--primary);
    color: #fff;
}

.mode-switch-button:not(.active) {
    background: #f8fafc;
    color: var(--muted);
}

.dias-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.dias-actions-left,
.dias-actions-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 1200px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .result-panel {
        position: static;
    }
}

@media (max-width: 768px) {
    .container {
        width: min(100%, calc(100% - 20px));
    }

    .panel {
        padding: 16px;
    }

    .form-grid,
    .form-grid-three,
    .summary-cards {
        grid-template-columns: 1fr;
    }

    .results-dl {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px 12px;
    }

    .results-dl dd {
        text-align: right;
        white-space: nowrap;
    }

    .comparison-table,
    .comparison-table thead,
    .comparison-table tbody,
    .comparison-table tr,
    .comparison-table th,
    .comparison-table td {
        display: block;
        width: 100%;
    }

    .comparison-table thead {
        display: none;
    }

    .comparison-table tr {
        margin-bottom: 12px;
        border: 1px solid var(--border-soft);
        border-radius: 4px;
        overflow: hidden;
        background: #fff;
    }

    .comparison-table td {
        border-bottom: 1px solid var(--border-soft);
        text-align: left !important;
    }

    .comparison-table td:first-child {
        width: 100%;
        background: transparent;
        color: var(--muted);
    }

    .comparison-table:not(.comparison-table-single) td:nth-child(2)::before {
        content: "SIN pasarela: ";
        display: block;
        color: var(--muted);
        font-weight: 500;
        margin-bottom: 2px;
    }

    .comparison-table:not(.comparison-table-single) td:nth-child(3)::before {
        content: "CON pasarela: ";
        display: block;
        color: var(--muted);
        font-weight: 500;
        margin-bottom: 2px;
    }

    .comparison-table-single td:nth-child(2)::before {
        content: "";
        display: none;
    }

    .comparison-table td:last-child {
        border-bottom: none;
    }    
}

.hidden-file-input {
    display: none !important;
}

.import-pdf-error-message {
    color: var(--danger);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    min-height: 42px;
}

@media print {
    .topbar,
    .page-header,
    .action-bar,
    .no-print,
    button {
        display: none !important;
    }

    body {
        background: white;
    }

    .grid {
        display: block;
    }

    .panel,
    .section-card,
    .result-section,
    .technical-details,
    .summary-card {
        border: 1px solid #d1d5db;
        box-shadow: none;
        background: white;
    }

    .panel:first-child {
        display: none;
    }

    .result-panel {
        position: static;
    }

    #resultadoPanel .no-print {
        display: none !important;
    }

    .dias-actions-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .dias-actions-left,
    .dias-actions-right {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .inline-info-message {
        margin-top: 0.75rem;
        padding: 0.75rem 1rem;
        border-radius: 8px;
        background: #f8fafc;
        border: 1px solid #cbd5e1;
        color: #334155;
    }

    .inline-info-message.is-warning {
        background: #fff7ed;
        border-color: #fdba74;
        color: #9a3412;
    }

    .inline-info-message.is-success {
        background: #edf7ed;
        border-color: #86efac;
        color: #166534;
    }

}
/* --------------------------------------------------------------------------
   Autenticación y cabecera personalizada por mutualidad
-------------------------------------------------------------------------- */

.topbar-content {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.topbar-brand {
    min-width: 0;
    text-align: center;
    justify-self: center;
}

.topbar-brand h1,
.topbar-brand p {
    text-align: center;
}

.topbar-logo-wrapper {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.topbar-logo {
    display: block;
    height: 74.3px;
    width: auto;
    max-width: 190px;
    object-fit: contain;
}

.topbar-logo-wrapper {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1px;
}

.topbar-user {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    font-size:16px;
    color: var(--muted);
    white-space: nowrap;
}

.topbar-user a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.topbar-user a:hover {
    color: var(--primary-soft);
    text-decoration: none;
}

.topbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    text-decoration: none;
}

.topbar-logout:hover {
    color: var(--primary-soft);
    filter: none;
    text-decoration: none;
}

.topbar-logout .material-icons-outlined {
    font-size: 24px;
}

.auth-page {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 32px;
}

.auth-card {
    width: min(480px, 100%);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 28px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.auth-header {
    margin-bottom: 22px;
}

.auth-header h2 {
    margin: 0 0 6px 0;
    font-size: 26px;
}

.auth-header p {
    margin: 0;
    color: var(--muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-form-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.auth-form-row label {
    font-weight: 500;
    font-size: 16px;
    color: var(--text);
    padding-top: 0;
    margin: 0;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.auth-actions a {
    color: var(--primary);
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
}

.auth-actions a:hover {
    color: var(--primary-soft);
    text-decoration: none;
}

.auth-message {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-weight: 600;
}

.auth-message-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--danger);
}

.auth-message-info {
    background: var(--warning-bg);
    border: 1px solid var(--border-soft);
    color: var(--text);
}

.field-help {
    margin: 6px 0 0 0;
    color: var(--muted);
    font-size: 13px;
}

.link-button {
    background: none !important;
    border: none !important;
    color: var(--primary);
    padding: 0;
    height: auto;
    min-height: 0;
    font: inherit;
    font-weight: 500;
    text-transform: none;
    cursor: pointer;
}

.link-button:hover {
    color: var(--primary-soft);
    filter: none;
}

.link-button:focus,
.link-button:focus-visible {
    outline: none;
    box-shadow: none;
}

.pasarela-detail-link-form {
    margin-top: 14px;
}

.pasarela-detail-link {
    display: inline-flex;
    align-items: center;
}

.auth-submit-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-submit-button .button-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: button-spinner-rotation 0.8s linear infinite;
}

.auth-submit-button.is-loading .button-spinner {
    display: inline-block;
}

.auth-submit-button:disabled {
    cursor: wait;
    opacity: 0.75;
}

.auth-wait-message {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text);
    text-align: center;
}

@keyframes button-spinner-rotation {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 760px) {
    .topbar {
        padding: 10px 0;
    }

    .topbar-content {
        display: grid;
        grid-template-columns: 130px minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
    }

    .topbar-logo-zone {
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    .topbar-logo-wrapper {
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    .topbar-logo {
        height: 58px;
        max-width: 130px;
        width: auto;
        object-fit: contain;
    }

    .topbar-brand {
        min-width: 0;
        text-align: center;
        justify-self: stretch;
        overflow: hidden;
    }

    .topbar-brand h1,
    .topbar-brand p {
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-brand h1 {
        font-size: 18px;
        margin: 0;
        line-height: 1.15;
    }

    .topbar-brand p {
        font-size: 12px;
        margin: 2px 0 0 0;
        line-height: 1.15;
    }

    .topbar-title-full,
    .topbar-subtitle-full {
        display: none;
    }

    .topbar-title-mobile,
    .topbar-subtitle-mobile {
        display: inline;
    }

    .topbar-user {
        justify-self: end;
        align-items: center;
        white-space: nowrap;
        font-size: 12px;
    }

    .topbar-user-email {
        display: none;
    }

    .topbar-user a {
        white-space: nowrap;
    }

    .auth-card {
        padding: 22px;
    }

    .results-dl dd {
        text-align: right;
        white-space: normal;
    }

}

@media (max-width: 420px) {
    .topbar-content {
        grid-template-columns: 95px minmax(0, 1fr) auto;
        gap: 8px;
    }

    .topbar-logo {
        height: 50px;
        max-width: 95px;
    }

    .topbar-brand h1 {
        font-size: 16px;
    }

    .topbar-brand p {
        display: none;
    }
}