:root {
    --excomin-primario: #004a99;
    --excomin-acento: #f07c00;
    --excomin-tinta: #18324f;
    --excomin-fondo: #f3f6fa;
}

.bg-login {
    background: linear-gradient(135deg, #edf3fa 0%, #ffffff 58%, #fff3e8 100%);
}

.bg-excomin {
    background-color: var(--excomin-primario);
}

.login-logo {
    display: block;
    width: 140px;
    height: 124px;
    object-fit: contain;
    margin: 0 auto 1rem;
}

.nav-logo {
    width: 64px;
    height: 57px;
    object-fit: contain;
}

.card {
    border-radius: 6px;
}

.bg-login .card {
    border-top: 4px solid var(--excomin-acento) !important;
}

.form-control:focus {
    border-color: var(--excomin-primario);
    box-shadow: 0 0 0 .2rem rgb(0 74 153 / 16%);
}

.btn-excomin {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--excomin-primario);
    --bs-btn-border-color: var(--excomin-primario);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--excomin-acento);
    --bs-btn-hover-border-color: var(--excomin-acento);
    --bs-btn-active-bg: #003b7a;
    font-weight: 600;
}

.resumen {
    border-left: 4px solid var(--excomin-acento) !important;
}

.btn-outline-excomin {
    --bs-btn-color: var(--excomin-primario);
    --bs-btn-border-color: var(--excomin-primario);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--excomin-acento);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--excomin-primario);
    font-weight: 600;
}

.view-switch .btn {
    min-width: 132px;
}

.admin-entry {
    color: var(--excomin-primario);
    font-size: .82rem;
    text-decoration: underline;
    text-decoration-color: var(--excomin-acento);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.admin-entry:hover,
.admin-entry:focus-visible {
    color: var(--excomin-acento);
}

.text-excomin {
    color: var(--excomin-primario);
}

.admin-login-card,
.admin-coming-soon {
    border-top: 4px solid var(--excomin-acento) !important;
    border-radius: 6px;
}

.admin-mark {
    display: grid;
    width: 42px;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 50%;
    background: var(--excomin-primario);
    color: #fff;
    font-weight: 700;
}

.btn:not(:disabled):not(.btn-link):hover,
.btn:not(:disabled):not(.btn-link):focus-visible {
    color: #fff;
    background-color: var(--excomin-acento);
    border-color: var(--excomin-acento);
}

.panel-registro {
    border-top: 4px solid var(--excomin-acento) !important;
}

.period-value {
    display: flex;
    align-items: center;
    min-height: 42px;
    background: var(--excomin-fondo);
    color: var(--excomin-tinta);
    font-weight: 600;
}

.period-banner {
    padding: 1rem;
    border: 1px solid rgb(0 74 153 / 14%);
    border-left: 4px solid var(--excomin-acento);
    border-radius: 8px;
    background: rgb(0 74 153 / 3%);
}

.period-banner-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.period-selected {
    color: var(--excomin-primario);
    font-size: .9rem;
    font-weight: 700;
}

.period-options {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .85rem;
}

.period-chip {
    min-height: 38px;
    padding: .4rem .75rem;
    border: 1px solid var(--excomin-primario);
    border-radius: 999px;
    background: #fff;
    color: var(--excomin-primario);
    font-size: .875rem;
    font-weight: 600;
}

.period-chip.selected {
    border-color: var(--excomin-primario);
    background: var(--excomin-primario);
    color: #fff;
    box-shadow: inset 0 -3px 0 var(--excomin-acento);
}

.period-chip:hover,
.period-chip:focus-visible {
    border-color: var(--excomin-acento);
    background: var(--excomin-acento);
    color: #fff;
}

.badge-pendiente {
    color: #743d00;
    background-color: #ffead5;
}

.text-bg-success {
    --bs-success-rgb: 25, 135, 84;
}

.resumen {
    border-left-color: var(--excomin-primario) !important;
}

footer {
    color: rgba(255, 255, 255, .6);
}

.bg-light footer {
    color: #6c757d;
}

.admin-page {
    min-height: 100vh;
}

.portal-topbar-inner {
    display: flex;
    width: 100%;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    padding-inline: clamp(1rem, 2.5vw, 2.5rem);
}

.portal-content {
    width: 100%;
    padding-inline: clamp(1rem, 2.5vw, 2.5rem);
}

.admin-topbar-inner {
    display: flex;
    width: 100%;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    padding-inline: clamp(1rem, 2.5vw, 2.5rem);
}

.brand-title {
    display: grid;
    gap: .1rem;
    font-size: .9rem;
    font-weight: 700;
}

.brand-title small {
    color: rgb(255 255 255 / 72%);
    font-size: .65rem;
    font-weight: 600;
}

.admin-session {
    color: rgb(255 255 255 / 82%);
    font-size: .82rem;
}

.admin-workspace {
    width: 100%;
    padding: 1.25rem clamp(1rem, 2.5vw, 2.5rem) 2rem;
}

.admin-page-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.admin-page-heading h1 {
    margin: 0;
    color: var(--excomin-tinta);
    font-size: 1.55rem;
    font-weight: 750;
}

.admin-page-heading p {
    margin: .35rem 0 0;
    color: #64748b;
    font-size: .9rem;
}

.admin-eyebrow {
    color: var(--excomin-acento) !important;
    font-size: .7rem !important;
    font-weight: 800;
}

.admin-current-range {
    display: grid;
    gap: .2rem;
    padding: .7rem .9rem;
    border-left: 3px solid var(--excomin-acento);
    background: #fff;
}

.admin-current-range span,
.metric-line span {
    color: #64748b;
    font-size: .65rem;
    font-weight: 700;
}

.admin-current-range strong {
    color: var(--excomin-primario);
    font-size: .9rem;
}

.weight-config,
.admin-filters,
.admin-table-section {
    margin-bottom: 1rem;
    border: 1px solid #dfe6ef;
    border-radius: 7px;
    background: #fff;
}

.weight-config {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding: 1rem 1.2rem;
    border-left: 4px solid var(--excomin-acento);
}

.weight-config-title {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.weight-config-title h2,
.table-heading h2 {
    margin: 0;
    color: var(--excomin-tinta);
    font-size: .95rem;
    font-weight: 700;
}

.weight-config-title p,
.table-heading p {
    margin: .2rem 0 0;
    color: #64748b;
    font-size: .78rem;
}

.config-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: #edf4fc;
    color: var(--excomin-primario);
    font-size: .75rem;
    font-weight: 800;
}

.weight-config-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .65rem;
}

.weight-config-form label,
.filter-grid label {
    display: grid;
    gap: .25rem;
    color: #516176;
    font-size: .72rem;
    font-weight: 700;
}

.weight-config-form input {
    width: 112px;
}

.range-updated {
    padding-bottom: .4rem;
    color: #758397;
    font-size: .7rem;
}

.admin-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
    border: 1px solid #dfe6ef;
    border-radius: 7px;
    background: #fff;
}

.metric-line {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .75rem 1rem;
    border-right: 1px solid #edf0f4;
}

.metric-line:last-child {
    border-right: 0;
}

.metric-line strong {
    color: var(--excomin-tinta);
    font-size: 1rem;
}

.metric-warning strong {
    color: #a35400;
}

.admin-filters {
    padding: 1rem 1.2rem .85rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(140px, .8fr)) auto;
    align-items: end;
    gap: .75rem;
}

.filter-submit {
    min-width: 96px;
}

.period-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .9rem;
}

.period-shortcuts .period-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: .25rem .65rem;
    font-size: .75rem;
    text-decoration: none;
}

.admin-table-section {
    overflow: hidden;
}

.table-heading {
    padding: .85rem 1.1rem;
    border-bottom: 1px solid #e5eaf0;
}

.admin-table {
    min-width: 1000px;
    font-size: .8rem;
}

.admin-table thead th {
    padding: .7rem .8rem;
    background: #f3f6fa;
    color: #4e5f74;
    font-size: .66rem;
    font-weight: 800;
    white-space: nowrap;
}

.admin-table tbody td {
    padding: .72rem .8rem;
    border-color: #edf0f4;
}

.admin-table td small {
    display: block;
    margin-top: .15rem;
    color: #64748b;
}

.weight-alert {
    display: inline-flex;
    padding: .28rem .45rem;
    border-radius: 4px;
    background: #fff0df;
    color: #8a4600;
    font-size: .68rem;
    font-weight: 800;
    white-space: nowrap;
}

.table-pagination {
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    padding: .7rem 1rem;
    border-top: 1px solid #e5eaf0;
}

.empty-row {
    padding: 2.5rem 1rem !important;
    color: #718096;
    text-align: center;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--excomin-primario);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.admin-warning {
    display: grid;
    gap: .25rem;
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    border-left: 4px solid var(--excomin-acento);
    background: #fff3e8;
    color: #70400f;
    font-size: .83rem;
}

.row-weight-alert {
    background: #fffaf5;
}

.observation-cell {
    min-width: 180px;
}

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

    .metric-line:nth-child(2) {
        border-right: 0;
    }

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

@media (max-width: 560px) {
    .admin-topbar-inner {
        padding-inline: .75rem;
    }

    .admin-workspace {
        padding: 1rem .75rem 1.5rem;
    }

    .admin-metrics {
        grid-template-columns: 1fr;
    }

    .metric-line,
    .metric-line:nth-child(2) {
        min-height: 50px;
        border-right: 0;
        border-bottom: 1px solid #edf0f4;
    }

    .metric-line:last-child {
        border-bottom: 0;
    }

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

    .filter-submit {
        width: 100%;
    }

    .weight-config-form {
        width: 100%;
    }

    .weight-config-form label {
        flex: 1 1 125px;
    }

    .range-updated {
        flex: 1 1 100%;
    }
}

.backup-heading {
    align-items: center;
}

.backup-status {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem .75rem;
    border: 1px solid #d8e2ee;
    border-radius: 5px;
    background: #fff;
    color: #64748b;
    font-size: .7rem;
    font-weight: 800;
}

.backup-status.ready {
    border-color: #bbdec9;
    background: #effaf3;
    color: #17683a;
}

.backup-status.setup-required {
    border-color: #f1d2aa;
    background: #fff8ef;
    color: #8a4d0b;
}

.backup-command-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid #dfe6ef;
    border-left: 4px solid var(--excomin-acento);
    border-radius: 7px;
    background: #fff;
}

.backup-command-copy {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.backup-command-icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: #edf4fc;
    color: var(--excomin-primario);
    font-size: 1.2rem;
}

.backup-command-copy h2 {
    margin: 0;
    color: var(--excomin-tinta);
    font-size: .95rem;
    font-weight: 750;
}

.backup-command-copy p {
    margin: .25rem 0 0;
    color: #64748b;
    font-size: .78rem;
}

.backup-run-button {
    min-height: 42px;
    padding-inline: 1rem;
}

.backup-run-button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.backup-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
    border: 1px solid #dfe6ef;
    border-radius: 7px;
    background: #fff;
}

.backup-metric {
    display: grid;
    min-height: 68px;
    align-content: center;
    gap: .25rem;
    padding: .75rem 1rem;
    border-right: 1px solid #edf0f4;
}

.backup-metric:last-child {
    border-right: 0;
}

.backup-metric span {
    color: #64748b;
    font-size: .65rem;
    font-weight: 750;
}

.backup-metric strong {
    color: var(--excomin-tinta);
    font-size: 1.1rem;
}

.backup-table-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.catalog-count {
    color: #64748b;
    font-size: .75rem;
}

.backup-table {
    min-width: 980px;
}

.backup-state {
    display: inline-flex;
    padding: .28rem .45rem;
    border-radius: 4px;
    background: #eff3f8;
    color: #4b5d72;
    font-size: .65rem;
    font-weight: 800;
}

.backup-state.verificado {
    background: #e9f7ef;
    color: #17683a;
}

.backup-state.fallido {
    background: #fdecec;
    color: #a82d2d;
}

.backup-state.ejecutando,
.backup-state.en_cola,
.backup-state.verificando {
    background: #fff3df;
    color: #8a4d0b;
}

.backup-file {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--excomin-tinta);
    font-size: .76rem;
    white-space: nowrap;
}

.backup-error {
    display: block;
    max-width: 260px;
    margin-top: .2rem;
    color: #a82d2d;
    white-space: normal;
}

.checksum {
    color: #617188;
    font-size: .7rem;
}

.backup-actions {
    display: inline-flex;
    gap: .35rem;
}

.empty-backup-icon {
    display: block;
    margin-bottom: .55rem;
    color: #8ba3bf;
    font-size: 1.8rem;
}

.empty-row strong,
.empty-row span {
    display: block;
}

.empty-row span {
    margin-top: .3rem;
    font-size: .78rem;
}

.backup-safety-note {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin: .9rem 0 1.2rem;
    padding: .8rem 1rem;
    border: 1px solid #f1d2aa;
    border-radius: 6px;
    background: #fff8ef;
    color: #71440f;
    font-size: .78rem;
}

.backup-audit-section {
    border: 1px solid #dfe6ef;
    border-radius: 7px;
    background: #fff;
}

.audit-events {
    display: grid;
    padding: .35rem 1rem;
}

.audit-event {
    display: grid;
    grid-template-columns: 10px minmax(150px, .7fr) minmax(170px, 1fr) minmax(130px, .7fr);
    align-items: center;
    gap: .7rem;
    min-height: 43px;
    border-bottom: 1px solid #edf0f4;
    color: #5d6d80;
    font-size: .75rem;
}

.audit-event:last-child {
    border-bottom: 0;
}

.audit-event strong {
    color: var(--excomin-tinta);
    font-size: .7rem;
}

.audit-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--excomin-acento);
}

.empty-audit {
    padding: 1rem;
    color: #758397;
    font-size: .78rem;
}

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

    .backup-metric:nth-child(2) {
        border-right: 0;
    }

    .backup-metric:nth-child(-n+2) {
        border-bottom: 1px solid #edf0f4;
    }
}

@media (max-width: 520px) {
    .backup-command-bar,
    .backup-command-copy {
        align-items: flex-start;
    }

    .backup-command-bar {
        flex-direction: column;
    }

    .backup-run-button,
    .backup-command-bar form {
        width: 100%;
    }

    .backup-metrics {
        grid-template-columns: 1fr;
    }

    .backup-metric,
    .backup-metric:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid #edf0f4;
    }

    .backup-metric:last-child {
        border-bottom: 0;
    }

    .audit-event {
        grid-template-columns: 10px 1fr;
        gap: .35rem .6rem;
        padding-block: .5rem;
    }

    .audit-event time,
    .audit-event strong,
    .audit-event > span:last-child {
        grid-column: 2;
    }
}
