/* Identidad institucional Consorcio Apoyo Diagnóstico */
.sidebar .brand {
    flex-direction: column;
    gap: .45rem;
    padding: .75rem .85rem .7rem;
    text-align: center;
}

.brand-logo-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 210px;
    min-height: 106px;
    padding: .35rem .55rem;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: .75rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}

.brand-logo {
    display: block;
    width: 100%;
    max-width: 168px;
    height: auto;
    max-height: 92px;
    object-fit: contain;
    object-position: center;
}

.sidebar .brand small {
    color: #d8edf5;
    font-size: .78rem;
    letter-spacing: .035em;
}

.auth-page {
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(0, 152, 208, .16), transparent 34%), linear-gradient(135deg, #f6fbfd, #e9f4f8);
}

.main,
.auth-page {
    display: flex;
    flex-direction: column;
}

.main > .content,
.auth-page > main {
    flex: 1 0 auto;
    width: 100%;
}

.auth-page > main {
    min-height: 0 !important;
}

.legal-footer {
    flex: 0 0 auto;
    width: 100%;
    padding: .8rem 1.25rem;
    border-top: 1px solid rgba(88, 119, 139, .22);
    background: rgba(255, 255, 255, .72);
    color: #536a79;
    font-size: .76rem;
    font-weight: 650;
    letter-spacing: .025em;
    text-align: center;
}

.system-assistant {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1080;
}

.system-assistant__toggle {
    display: flex;
    align-items: center;
    gap: .45rem;
    border: 0;
    border-radius: 999px;
    padding: .75rem 1rem;
    background: var(--apoyo-blue);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0, 16, 64, .28);
}

.system-assistant__panel {
    position: absolute;
    right: 0;
    bottom: 3.8rem;
    width: min(390px, calc(100vw - 2rem));
    height: min(610px, calc(100vh - 7rem));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--apoyo-line);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 18px 48px rgba(0, 16, 64, .24);
}

.system-assistant__panel header { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem; background: linear-gradient(135deg, var(--apoyo-navy), var(--apoyo-blue)); color: #fff; }
.system-assistant__panel header small { display: block; color: #cbe8f4; }
.system-assistant__panel header button { border: 0; background: transparent; color: #fff; font-size: 1.5rem; }
.system-assistant__messages { flex: 1; overflow: auto; padding: 1rem; background: #f5f9fb; }
.system-assistant__message { max-width: 90%; margin-bottom: .75rem; padding: .7rem .8rem; border-radius: .85rem; white-space: pre-line; }
.system-assistant__message--assistant { border: 1px solid var(--apoyo-line); background: #fff; }
.system-assistant__message--user { margin-left: auto; background: #dff2f8; color: #003c59; }
.system-assistant__links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.system-assistant__links a { padding: .35rem .55rem; border-radius: .45rem; background: #e5f3f8; color: var(--apoyo-blue); font-weight: 650; text-decoration: none; }
.system-assistant__suggestions { display: flex; gap: .4rem; overflow-x: auto; padding: .6rem .75rem; border-top: 1px solid var(--apoyo-line); }
.system-assistant__suggestions button { flex: 0 0 auto; border: 1px solid var(--apoyo-aqua); border-radius: 999px; background: #fff; color: var(--apoyo-blue); padding: .3rem .55rem; font-size: .76rem; }
.system-assistant__form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--apoyo-line); }
.system-assistant__form textarea { flex: 1; resize: none; border: 1px solid #cbd9e3; border-radius: .65rem; padding: .55rem; }
.system-assistant__form button { border: 0; border-radius: .6rem; background: var(--apoyo-blue); color: #fff; padding: 0 .8rem; }
.system-assistant__form button:disabled { opacity: .6; }

@media (max-width: 575.98px) {
    .system-assistant { right: .75rem; bottom: .75rem; }
    .system-assistant__toggle span { display: none; }
    .system-assistant__panel { position: fixed; inset: 4.5rem .5rem .5rem; width: auto; height: auto; }
}

@media print {
    .system-assistant { display: none !important; }
}

.auth-card {
    border-top: 4px solid #0098d0;
    box-shadow: 0 18px 45px rgba(0, 16, 64, .14);
}

.auth-brand-logo,
.verification-brand-logo {
    display: block;
    width: 100%;
    object-fit: cover;
    object-position: center 58%;
}

.auth-brand-logo {
    max-width: 230px;
    height: 148px;
}

.verification-brand-logo {
    max-width: 210px;
    height: 135px;
    margin-right: auto;
    margin-left: auto;
}

@media (max-width: 575.98px) {
    .auth-brand-logo { max-width: 205px; height: 132px; }
    .brand-logo { max-width: 156px; max-height: 86px; }
}

/* Paginación global compacta para tablas y listados. */
.card-footer nav p,
.card-footer .pagination {
    margin-bottom: 0;
}

.card-footer .pagination {
    flex-wrap: wrap;
}

.help-button {
    display: inline-grid;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    padding: 0;
    border: 1px solid #8ca5b7;
    border-radius: 999px;
    background: #fff;
    color: var(--apoyo-blue);
    font-size: .78rem;
    font-weight: 800;
    line-height: 1;
}

.help-button:hover,
.help-button:focus {
    background: #e8f2fa;
    border-color: var(--apoyo-blue);
    outline: none;
    box-shadow: 0 0 0 .18rem rgba(0, 97, 143, .14);
}

.kpi-label .help-button {
    flex: 0 0 1.15rem;
    width: 1.15rem;
    height: 1.15rem;
    font-size: .66rem;
}

.settings-group {
    padding: 1rem;
    border: 1px solid var(--apoyo-line);
    border-radius: .75rem;
    background: #fbfdff;
}

.settings-group-title {
    color: var(--apoyo-navy);
    font-size: .82rem;
    font-weight: 750;
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* Estados legibles, incluido un contraste seguro para estados nuevos. */
.badge-status {
    border: 1px solid #cbd8e1;
    background: #edf2f6;
    color: #29475b;
    font-weight: 700;
}

.status-scheduled {
    border-color: #c6cff5;
    background: #e9edff;
    color: #344a91;
}

.status-pending_reviewer_signature {
    border-color: #ebcf82;
    background: #fff1cc;
    color: #754900;
}

.status-submitted {
    border-color: #bfd8ef;
    background: #e8f1fb;
    color: #00618f;
}

.status-approved {
    border-color: #b9dfcd;
    background: #e7f6ee;
    color: #176540;
}

/* Mantiene la columna de lote cómoda y estable sin limitar el texto ingresado. */
.receipt-lot-heading,
.receipt-lot-cell {
    width: 12rem;
    min-width: 12rem;
}

.receipt-lot-input {
    width: 100%;
    min-width: 10ch;
}

.receipt-quantity-input {
    width: 7.5rem;
    min-width: 7.5rem;
}

.receipt-arrival-cell {
    min-width: 4.5rem;
}

.receipt-line-not-arrived {
    opacity: .58;
    background: #f5f7f9;
}

/* Centro de informes */
.report-eyebrow {
    margin-bottom: .3rem;
    color: var(--apoyo-green);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.report-notice {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .8rem 1rem;
    border: 1px solid #bad3e2;
    border-radius: .7rem;
    background: #eff7fb;
    color: #355466;
    font-size: .88rem;
}

.report-notice-icon {
    display: grid;
    flex: 0 0 1.45rem;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 999px;
    background: var(--apoyo-blue);
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
}

.report-filter-card,
.report-results-card {
    overflow: hidden;
    border-color: #d5e1e8;
    box-shadow: 0 8px 25px rgba(0, 16, 64, .06);
}

.report-filter-card .card-header,
.report-results-card .card-header {
    padding: .9rem 1.1rem;
    background: #f8fbfd;
    border-bottom-color: #dbe5eb;
}

.report-type-select {
    border-color: #8fb6cf;
    background-color: #f8fcff;
    color: var(--apoyo-navy);
    font-weight: 700;
}

.report-filter-chip {
    display: inline-flex;
    gap: .3rem;
    max-width: 100%;
    padding: .3rem .65rem;
    border: 1px solid #c9d9e3;
    border-radius: 999px;
    background: #f7fafc;
    color: #405866;
    font-size: .76rem;
}

.report-kpi {
    padding: 1rem 1.05rem;
    border: 1px solid #d5e1e8;
    border-left: 4px solid var(--apoyo-green);
    border-radius: .7rem;
    background: #fff;
    box-shadow: 0 7px 20px rgba(0, 16, 64, .05);
}

.report-kpi-label {
    color: #617786;
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.report-kpi-value {
    margin-top: .2rem;
    color: var(--apoyo-navy);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.15;
}

.report-table-wrap {
    max-height: min(64vh, 760px);
}

.report-table {
    font-size: .79rem;
    white-space: nowrap;
}

.report-table thead th {
    position: sticky;
    z-index: 2;
    top: 0;
    padding: .7rem .65rem;
    background: var(--apoyo-navy);
    color: #fff;
    font-size: .71rem;
    letter-spacing: .015em;
    vertical-align: middle;
}

.report-table td {
    padding: .62rem .65rem;
}

.report-row-number {
    width: 4rem;
    min-width: 4rem;
    text-align: right;
}

.report-long-value {
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 575.98px) {
    .report-kpi-value { font-size: 1.2rem; }
    .report-table-wrap { max-height: 70vh; }
}

.import-step-card {
    border-top: 3px solid var(--apoyo-green);
    background: linear-gradient(145deg, #fff 65%, #f1f8f4);
}

.import-step-number {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 50%;
    background: var(--apoyo-navy);
    color: #fff;
    font-size: .86rem;
    font-weight: 800;
}
