html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Ajustes responsivos globales: mantienen el diseño de escritorio y solo corrigen
   desbordes/anchos rígidos en pantallas móviles pequeñas. */
* {
    box-sizing: border-box;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

@media (max-width: 575.98px) {
    body {
        overflow-wrap: anywhere;
    }

    .content,
    article.content,
    main,
    .container,
    .container-fluid {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    article.content,
    .content.px-4,
    .top-row.px-4 {
        padding-left: .85rem !important;
        padding-right: .85rem !important;
    }

    .row {
        --bs-gutter-x: .85rem;
    }

    [class*="col-"],
    .card,
    .card-body,
    .modal-content,
    .modal-body,
    .modal-header,
    .modal-footer,
    .panel-card,
    .loading-card,
    .step-card,
    .profile-form-card,
    .pases-filter-card,
    .filter-card,
    .filters-card,
    .solicitud-modal,
    .pase-modal-content,
    .pase-pdf-content,
    .report-page,
    .report-hero,
    .profile-shell,
    .catalog-page,
    .solicitudes-page,
    .empresas-page,
    .contribuyentes-page,
    .pases-page {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .card-body,
    .modal-body,
    .panel-card,
    .step-card .card-body,
    .profile-form-card .card-body {
        padding: 1rem !important;
    }

    .modal,
    .modal-dialog,
    .modal-dialog-centered,
    .modal-dialog-scrollable,
    .modal-xl,
    .modal-lg {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: .5rem !important;
    }

    .modal-dialog {
        min-height: 100dvh;
        display: flex;
        align-items: stretch;
    }

    .modal-content {
        max-height: calc(100dvh - 1rem);
        overflow: hidden;
        border-radius: 1rem !important;
    }

    .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-header,
    .modal-footer,
    .wizard-actions,
    .hero-content,
    .hero-actions,
    .section-title-row,
    .toolbar,
    .filter-actions,
    .form-actions,
    .actions-row,
    .top-actions,
    .confirm-actions,
    .register-actions,
    .login-actions {
        flex-wrap: wrap !important;
        min-width: 0 !important;
    }

    .modal-footer,
    .wizard-actions,
    .filter-actions,
    .form-actions,
    .actions-row,
    .confirm-actions,
    .register-actions,
    .login-actions {
        gap: .65rem !important;
    }

    .modal-footer > *,
    .wizard-actions > *,
    .filter-actions > *,
    .form-actions > *,
    .actions-row > *,
    .confirm-actions > *,
    .register-actions > *,
    .login-actions > * {
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .btn,
    button,
    input,
    select,
    textarea,
    .form-control,
    .form-select,
    .input-group,
    .input-group-text {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .btn,
    button:not(.navbar-toggler):not(.btn-close) {
        white-space: normal !important;
    }

    .input-group {
        flex-wrap: wrap;
    }

    .input-group > .form-control,
    .input-group > .form-select {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    .table-responsive,
    .solicitudes-table,
    .pases-table-wrapper,
    .catalog-table-wrapper,
    .report-table-wrapper,
    .contribuyentes-table-wrap {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-inline: contain;
    }

    table,
    .table {
        width: 100% !important;
        max-width: 100% !important;
    }

    .table-responsive > table,
    .table-responsive table.table,
    .table-responsive table.modern-table,
    .solicitudes-table > table,
    .pases-table-wrapper > table,
    .catalog-table-wrapper > table,
    .report-table-wrapper > table,
    .contribuyentes-table-wrap > table {
        width: max-content !important;
        min-width: max(760px, 100%) !important;
        max-width: none !important;
    }

    th,
    td {
        white-space: normal;
        word-break: break-word;
    }

    .table-responsive thead th,
    .solicitudes-table thead th,
    .pases-table-wrapper thead th,
    .catalog-table-wrapper thead th,
    .report-table-wrapper thead th,
    .contribuyentes-table-wrap thead th {
        white-space: nowrap;
    }

    .table-responsive .text-end,
    .solicitudes-table .text-end,
    .pases-table-wrapper .text-end,
    .catalog-table-wrapper .text-end,
    .report-table-wrapper .text-end,
    .contribuyentes-table-wrap .text-end {
        white-space: nowrap;
    }

    .dropdown-menu,
    .popover,
    .toast,
    .top-account-menu {
        max-width: calc(100vw - 1rem) !important;
    }

    h1,
    .h1 {
        font-size: clamp(1.45rem, 9vw, 2rem) !important;
        line-height: 1.12;
    }

    h2,
    .h2 {
        font-size: clamp(1.25rem, 7vw, 1.7rem) !important;
        line-height: 1.18;
    }

    h3,
    .h3,
    .modal-title {
        font-size: clamp(1.05rem, 6vw, 1.35rem) !important;
    }
}

@media (max-width: 420px) {
    article.content,
    .content.px-4,
    .top-row.px-4 {
        padding-left: .65rem !important;
        padding-right: .65rem !important;
    }

    .row {
        --bs-gutter-x: .65rem;
    }

    .card-body,
    .modal-body,
    .panel-card,
    .step-card .card-body,
    .profile-form-card .card-body {
        padding: .85rem !important;
    }

    .btn,
    button:not(.navbar-toggler):not(.btn-close),
    .form-control,
    .form-select {
        font-size: .95rem;
    }
}

@media (max-width: 575.98px) {
    .hero-content,
    .hero-stats,
    .hero-summary,
    .stats-grid,
    .summary-grid,
    .cards-grid,
    .kpi-grid,
    .metric-grid,
    .metrics-grid,
    .filters-grid,
    .filter-grid,
    .form-grid,
    .catalog-grid,
    .report-grid,
    .dashboard-grid,
    .quick-actions-grid,
    .mini-kpi-row,
    .charts-grid,
    .chart-grid,
    .admin-grid,
    .solicitud-grid,
    .wizard-grid,
    .document-grid,
    .documents-grid,
    .confirm-grid,
    .register-grid,
    .login-grid,
    .auth-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .hero-actions,
    .section-title-row,
    .card-header,
    .panel-header,
    .filters-header,
    .table-header,
    .catalog-header,
    .report-header,
    .profile-header,
    .solicitud-header {
        width: 100% !important;
        min-width: 0 !important;
    }

    .hero-actions,
    .section-title-row,
    .panel-header,
    .filters-header,
    .table-header,
    .catalog-header,
    .report-header,
    .profile-header,
    .solicitud-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .hero-actions > *,
    .section-title-row > *,
    .panel-header > *,
    .filters-header > *,
    .table-header > *,
    .catalog-header > *,
    .report-header > *,
    .profile-header > *,
    .solicitud-header > * {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .acciones-col,
    .actions-col,
    .text-end.acciones-col,
    td.text-end,
    th.text-end {
        text-align: left !important;
    }

    .pagination,
    .pager,
    .page-actions {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: .35rem !important;
    }
}

#components-reconnect-modal {
    inset: 0;
    display: none;
    position: fixed;
    z-index: 10050;
    align-items: flex-start;
    justify-content: center;
    padding: 6.5rem 1rem 1rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0.05));
    backdrop-filter: blur(2px);
    pointer-events: none;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

#components-reconnect-modal.components-reconnect-hide {
    display: none;
}

.simega-reconnect-card {
    width: min(720px, 100%);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1.1rem 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 24px;
    color: #1f2937;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    pointer-events: auto;
}

.simega-reconnect-icon {
    width: 3.25rem;
    height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: #0f766e;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(59, 130, 246, 0.12));
    box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.18);
    font-size: 1.45rem;
}

.components-reconnect-failed .simega-reconnect-icon,
.components-reconnect-rejected .simega-reconnect-icon {
    color: #b45309;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(239, 68, 68, 0.12));
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.simega-reconnect-content {
    min-width: 0;
}

.simega-reconnect-eyebrow,
.simega-reconnect-content h2,
.simega-reconnect-content p {
    margin: 0;
}

.simega-reconnect-message-failed,
.simega-reconnect-message-rejected,
.simega-reconnect-action {
    display: none;
}

.components-reconnect-failed .simega-reconnect-message-connecting,
.components-reconnect-rejected .simega-reconnect-message-connecting {
    display: none;
}

.components-reconnect-failed .simega-reconnect-message-failed,
.components-reconnect-rejected .simega-reconnect-message-rejected {
    display: block;
}

.components-reconnect-failed .simega-reconnect-action,
.components-reconnect-rejected .simega-reconnect-action {
    display: inline-flex;
}

.components-reconnect-failed .simega-reconnect-attempts,
.components-reconnect-rejected .simega-reconnect-attempts {
    display: none;
}

.simega-reconnect-eyebrow {
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.simega-reconnect-content h2 {
    margin-top: 0.1rem;
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 800;
}

.simega-reconnect-content p {
    margin-top: 0.15rem;
    color: #475569;
    font-size: 0.94rem;
}

.simega-reconnect-content small {
    display: inline-block;
    margin-top: 0.45rem;
    color: #64748b;
    font-weight: 700;
}

.simega-reconnect-progress {
    position: relative;
    height: 0.42rem;
    overflow: hidden;
    margin-top: 0.7rem;
    border-radius: 999px;
    background: #e2e8f0;
}

.simega-reconnect-progress span {
    position: absolute;
    inset-block: 0;
    width: 42%;
    border-radius: inherit;
    background: linear-gradient(90deg, #14b8a6, #38bdf8, #2563eb);
    animation: simega-reconnect-slide 1.2s ease-in-out infinite;
}

.components-reconnect-failed .simega-reconnect-progress span,
.components-reconnect-rejected .simega-reconnect-progress span {
    background: linear-gradient(90deg, #f59e0b, #f97316, #ef4444);
    animation-duration: 1.8s;
}

.simega-reconnect-action {
    justify-self: end;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border: 0;
    border-radius: 999px;
    padding: 0.65rem 1rem;
    color: #fff;
    background: linear-gradient(135deg, #0f766e, #2563eb);
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
}

.simega-reconnect-action:hover {
    filter: brightness(1.04);
}

@keyframes simega-reconnect-slide {
    0% {
        transform: translateX(-110%);
    }
    50% {
        transform: translateX(85%);
    }
    100% {
        transform: translateX(240%);
    }
}

@media (max-width: 640px) {
    #components-reconnect-modal {
        align-items: stretch;
        padding-top: 1rem;
    }

    .simega-reconnect-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .simega-reconnect-icon,
    .simega-reconnect-action {
        justify-self: center;
    }
}

/* Marcadores globales para Leaflet (los elementos los crea JS fuera del scope CSS de Blazor). */
.corrales-zone-marker {
    align-items: center !important;
    background: transparent !important;
    border: 0 !important;
    display: flex !important;
    height: 44px !important;
    justify-content: center !important;
    width: 38px !important;
}

.corrales-zone-pin {
    align-items: center;
    background: var(--marker-color, #1479c9);
    border: 3px solid #fff;
    border-radius: 999px 999px 999px 0;
    box-shadow: 0 0 0 8px rgba(20, 121, 201, .24), 0 14px 30px rgba(15, 23, 42, .42);
    display: flex;
    height: 34px;
    justify-content: center;
    transform: rotate(-45deg);
    transition: transform .18s ease, box-shadow .18s ease;
    width: 34px;
}

.corrales-zone-pin i {
    background: #fff;
    border-radius: 999px;
    display: block;
    height: 11px;
    width: 11px;
}

.corrales-zone-marker:hover .corrales-zone-pin,
.corrales-zone-marker:focus .corrales-zone-pin {
    box-shadow: 0 0 0 12px rgba(20, 121, 201, .3), 0 18px 36px rgba(15, 23, 42, .48);
    transform: rotate(-45deg) scale(1.18);
}

.corrales-leaflet-popup {
    min-width: 220px;
}

.corrales-leaflet-popup h3 {
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 900;
    margin: .5rem 0 .25rem;
}

.corrales-leaflet-popup p {
    color: #475569;
    margin: 0 0 .65rem;
}

.corrales-popup-status {
    border-radius: 999px;
    display: inline-block;
    font-size: .7rem;
    font-weight: 900;
    padding: .2rem .55rem;
    text-transform: uppercase;
}

.corrales-popup-status.is-active {
    background: #dbeafe;
    color: #1d4ed8;
}

.corrales-popup-status.is-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.corrales-popup-actions {
    display: flex;
    gap: .5rem;
    margin-top: .75rem;
}

.corrales-popup-detail,
.corrales-popup-maps {
    align-items: center;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 900;
    justify-content: center;
    padding: .4rem .8rem;
    text-decoration: none;
}

.corrales-popup-detail {
    background: #1479c9;
    color: #fff;
}

.corrales-popup-maps {
    background: #e0f2fe;
    color: #075985;
}

.corrales-popup-detail:hover,
.corrales-popup-detail:focus {
    background: #0f3f7a;
    color: #fff;
}

.corrales-popup-maps:hover,
.corrales-popup-maps:focus {
    background: #bae6fd;
    color: #075985;
}

.leaflet-popup-content-wrapper {
    border-radius: 1.15rem;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .28);
    overflow: hidden;
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    min-width: 270px;
}

.leaflet-popup-tip {
    box-shadow: 0 10px 24px rgba(15, 23, 42, .2);
}

.corrales-popup-hero {
    background: linear-gradient(135deg, #0f3f7a, #1479c9);
    color: #fff;
    padding: 1rem 1rem .9rem;
}

.corrales-popup-hero h3 {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 950;
    letter-spacing: -.02em;
    margin: .55rem 0 .2rem;
}

.corrales-popup-hero p {
    color: rgba(255, 255, 255, .86);
    font-size: .88rem;
    margin: 0;
}

.corrales-leaflet-popup dl {
    background: #f8fafc;
    display: grid;
    gap: .6rem;
    margin: 0;
    padding: .9rem 1rem;
}

.corrales-leaflet-popup dl div {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .07);
    border-radius: .8rem;
    padding: .6rem .7rem;
}

.corrales-popup-actions {
    background: #fff;
    display: grid;
    gap: .6rem;
    grid-template-columns: 1fr 1fr;
    margin-top: 0;
    padding: .95rem 1rem 1rem;
}

.corrales-popup-detail,
.corrales-popup-maps {
    border-radius: .85rem;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
    min-height: 42px;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.corrales-popup-detail::before {
    content: "↗";
    font-size: .9rem;
    margin-right: .35rem;
}

.corrales-popup-maps::before {
    content: "⌖";
    font-size: 1rem;
    margin-right: .35rem;
}

.corrales-popup-detail:hover,
.corrales-popup-detail:focus,
.corrales-popup-maps:hover,
.corrales-popup-maps:focus {
    box-shadow: 0 14px 28px rgba(15, 23, 42, .14);
    transform: translateY(-1px);
}
