/* ─── Variables SMC ─────────────────────────── */
:root {
    --rojo:         #c52026;
    --rojo-oscuro:  #a01a1f;
    --beige:        #eee1c6;
    --beige-claro:  #f7f0e3;
    --sidebar-w:    260px;
    --header-h:     64px;
    --texto:        #1a1a1a;
    --texto-suave:  #6b7280;
    --borde:        #e5e7eb;
    --fondo:        #f3f4f6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--fondo);
    color: var(--texto);
    font-size: 14px;
}

body.smc-fade-out {
    opacity: 0;
    transition: opacity .26s ease-out;
}

.bg-login {
    background: var(--beige);
}

.login-page {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: auto -8vw -14vh auto;
    width: min(56vmin, 420px);
    aspect-ratio: 1 / 1;
    z-index: 0;
    pointer-events: none;
    opacity: 0.1;
    background-image: url("https://www.smcardiologia.org.mx/wp-content/uploads/2024/11/logo-smc-80x80-1.svg");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.2));
    animation: login-brand-float 56s linear infinite;
}

.login-page > .container {
    position: relative;
    z-index: 1;
}

.login-ecg-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}

.login-ecg-trace {
    animation: smc-ecg-sweep 4s linear infinite;
}

@keyframes smc-ecg-sweep {
    0% {
        stroke-dashoffset: 1200;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes login-brand-float {
    0% {
        transform: rotate(0deg) translateY(0);
    }
    50% {
        transform: rotate(180deg) translateY(-10px);
    }
    100% {
        transform: rotate(360deg) translateY(0);
    }
}

/* ─── Layout principal ──────────────────────── */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    max-width: 100%;
    background: #fff;
    border-right: 1px solid var(--borde);
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1020;
    overflow-y: auto;
}

.panel-offcanvas {
    width: min(100vw - 1rem, 300px);
}

.panel-offcanvas .offcanvas-body {
    overflow-y: auto;
}

.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--borde);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.sidebar-logo-text h2 {
    font-size: 13px;
    font-weight: 700;
    color: var(--rojo);
    line-height: 1.2;
}

.sidebar-logo-text span {
    font-size: 11px;
    color: var(--texto-suave);
}

.sidebar-nav {
    padding: 16px 0;
    flex: 1;
}

.nav-section {
    padding: 8px 16px 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--texto-suave);
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--texto-suave);
    text-decoration: none;
    border-radius: 0;
    transition: background .15s, color .15s;
    font-size: 13.5px;
}

.nav-link:hover {
    background: var(--beige-claro);
    color: var(--rojo);
}

.nav-link.active {
    background: #fef2f2;
    color: var(--rojo);
    font-weight: 600;
    border-right: 3px solid var(--rojo);
}

.nav-link svg { flex-shrink: 0; }

.nav-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.nav-group {
    display: block;
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .24s ease, opacity .2s ease;
    opacity: 0;
}

.nav-group.open .nav-submenu {
    max-height: 400px;
    opacity: 1;
}

.nav-sublink {
    padding-left: 46px;
    font-size: 13px;
}

.nav-right {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-caret {
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    color: var(--texto-suave);
    transition: transform .2s ease;
}

.nav-group.open .nav-caret {
    transform: rotate(180deg);
}

.nav-count {
    font-size: 11px;
    color: var(--texto-suave);
}

.nav-badge {
    margin-left: auto;
    background: var(--rojo);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 99px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--borde);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: var(--rojo);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.user-info h4 { font-size: 13px; font-weight: 600; }
.user-info span { font-size: 11px; color: var(--texto-suave); }

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: 1px solid var(--borde);
    border-radius: 6px;
    color: var(--texto-suave);
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    transition: border-color .15s, color .15s;
}

.btn-logout:hover { border-color: var(--rojo); color: var(--rojo); }

/* ─── Contenido principal ───────────────────── */
.main {
    margin-left: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    min-width: 0;
}

@media (min-width: 992px) {
    .main {
        margin-left: var(--sidebar-w);
    }
}

.topbar {
    min-height: var(--header-h);
    z-index: 1010;
}

.page-content {
    flex: 1;
    width: 100%;
    min-width: 0;
}

/* ─── Cards de estadísticas ─────────────────── */
.stat-card {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 10px;
    padding: 18px 20px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
    transition:
        border-color .22s ease,
        box-shadow .24s ease,
        transform .24s cubic-bezier(0.22, 1, 0.36, 1),
        background-color .24s ease;
}

.stat-card:hover { border-color: var(--rojo); box-shadow: 0 2px 8px rgba(197,32,38,.1); }
.stat-card.active { border-color: var(--rojo); background: #fef2f2; }
.stat-card:hover,
.stat-card.active {
    transform: translateY(-2px);
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--texto-suave);
    margin-bottom: 6px;
}

.stat-label-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.stat-icon {
    opacity: 0.95;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.stat-icon-total {
    color: #334155;
}

.stat-icon-en_revision {
    color: #ca8a04;
    background: rgba(202, 138, 4, 0.12);
    box-shadow: inset 0 0 0 1px rgba(202, 138, 4, 0.25);
}

.stat-icon-pendiente {
    color: #ea580c;
    background: rgba(234, 88, 12, 0.12);
    box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.25);
}

.stat-icon-aceptado {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.12);
    box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.24);
}

.stat-icon-rechazado {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.12);
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.24);
}

.erp-card-logo {
    width: 62px;
    height: 22px;
    object-fit: contain;
    object-position: center;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 4px rgba(30, 64, 175, 0.28));
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--texto);
    position: relative;
    z-index: 1;
}

.stat-card .stat-label {
    position: relative;
    z-index: 1;
}

.stat-watermark {
    position: absolute;
    right: -8px;
    bottom: -10px;
    width: 92px;
    height: 92px;
    color: currentColor;
    opacity: 0.11;
    pointer-events: none;
    transition:
        opacity .25s ease,
        transform .35s cubic-bezier(0.22, 1, 0.36, 1),
        filter .25s ease;
}

.stat-card.active .stat-watermark {
    opacity: 0.28;
    transform: translateX(-4px) translateY(-2px) scale(1.06);
    filter: drop-shadow(0 0 12px rgba(197, 32, 38, 0.24));
}

.stat-watermark svg {
    width: 100%;
    height: 100%;
}

.stat-watermark-erp {
    width: 170px;
    height: 110px;
    right: -24px;
    bottom: -18px;
    opacity: 0.18;
}

.stat-watermark-erp img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.stat-card.active .stat-watermark-erp {
    opacity: 0.3;
}

.stat-card.active .stat-watermark-erp img {
    filter: drop-shadow(0 0 16px rgba(37, 99, 235, 0.35));
}

/* Activo por color de estado (evita gris y mantiene identidad visual) */
.stat-card.en_revision.active {
    border-color: #ca8a04;
    background: #fffbeb;
    box-shadow: 0 10px 24px rgba(202, 138, 4, 0.18);
}
.stat-card.en_revision.active .stat-watermark {
    opacity: 0.34;
    filter: drop-shadow(0 0 14px rgba(202, 138, 4, 0.35));
}

.stat-card.pendiente.active {
    border-color: #ea580c;
    background: #fff7ed;
    box-shadow: 0 10px 24px rgba(234, 88, 12, 0.18);
}
.stat-card.pendiente.active .stat-watermark {
    opacity: 0.34;
    filter: drop-shadow(0 0 14px rgba(234, 88, 12, 0.35));
}

.stat-card.aceptado.active {
    border-color: #16a34a;
    background: #f0fdf4;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.2);
}
.stat-card.aceptado.active .stat-watermark {
    opacity: 0.34;
    filter: drop-shadow(0 0 14px rgba(22, 163, 74, 0.35));
}

.stat-card.rechazado.active {
    border-color: #dc2626;
    background: #fef2f2;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.2);
}
.stat-card.rechazado.active .stat-watermark {
    opacity: 0.34;
    filter: drop-shadow(0 0 14px rgba(220, 38, 38, 0.35));
}

.stat-card.cancelado.active {
    border-color: #64748b;
    background: #f8fafc;
    box-shadow: 0 10px 24px rgba(100, 116, 139, 0.2);
}
.stat-card.cancelado.active .stat-watermark {
    opacity: 0.34;
    filter: drop-shadow(0 0 14px rgba(100, 116, 139, 0.35));
}

.stat-card.erp.active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2);
}
.stat-card.erp.active .stat-watermark {
    opacity: 0.36;
}
.stat-card.erp.active .stat-watermark-erp img {
    filter: drop-shadow(0 0 18px rgba(37, 99, 235, 0.42));
}


.stat-card.en_revision .stat-number  { color: #ca8a04; }
.stat-card.pendiente .stat-number  { color: #ea580c; }
.stat-card.aceptado .stat-number   { color: #16a34a; }
.stat-card.rechazado .stat-number  { color: var(--rojo); }
.stat-card.cancelado .stat-number { color: #64748b; }
.stat-card.erp .stat-number        { color: #2563eb; }

@media (min-width: 1200px) {
    .solicitudes-filtros-cards--7 > .col {
        flex: 0 0 auto;
        width: calc(100% / 7);
    }
}

/* ─── Tabla ─────────────────────────────────── */
.table-card {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 10px;
    overflow: hidden;
}

#solicitudes-filtros-cards,
.table-card {
    transition: opacity .22s ease, transform .24s cubic-bezier(0.22, 1, 0.36, 1);
}

#solicitudes-filtros-cards.filter-switch-out,
.table-card.filter-switch-out {
    opacity: 0.42;
    transform: translateX(10px);
}

#solicitudes-filtros-cards.filter-switch-in,
.table-card.filter-switch-in {
    animation: filter-switch-in .3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes filter-switch-in {
    from {
        opacity: 0.42;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.table-toolbar {
    padding: 16px 20px;
    border-bottom: 1px solid var(--borde);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--borde);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color .15s;
}

.search-input:focus { border-color: var(--rojo); }

.filter-select {
    padding: 8px 10px;
    border: 1px solid var(--borde);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    background: #fff;
    cursor: pointer;
}

.filter-select:focus { border-color: var(--rojo); }

.btn-filter {
    padding: 8px 16px;
    background: var(--rojo);
    color: #fff;
    border: 1px solid var(--rojo);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.btn-filter:hover,
.btn.btn-filter:hover,
.btn.btn-filter:focus {
    background: var(--rojo-oscuro);
    border-color: var(--rojo-oscuro);
    color: #fff;
}

.btn-icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-icon-inline svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.btn-icon-inline span {
    font-weight: 700;
}

.table-card .smc-table {
    --bs-table-bg: transparent;
    font-size: 13.5px;
}

.table-card .smc-table thead th {
    padding: 11px 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--texto-suave);
    border-bottom: 1px solid var(--borde);
    white-space: nowrap;
}

.table-card .smc-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--borde);
    vertical-align: middle;
}

.table-card .smc-table tbody tr:last-child td {
    border-bottom: none;
}

.table-card .smc-table tbody tr:hover td {
    background: #fafafa;
}

/* ─── Paginación ─────────────────────────────── */
.pagination .page-link {
    color: var(--rojo);
    border-color: var(--borde);
    background: #fff;
    box-shadow: none;
}

.pagination .page-link:hover,
.pagination .page-link:focus {
    color: var(--rojo-oscuro);
    border-color: var(--rojo);
    background: #fef2f2;
    box-shadow: none;
}

.pagination .page-item.active .page-link {
    color: #fff;
    background: var(--rojo);
    border-color: var(--rojo);
}

.pagination .page-item.disabled .page-link {
    color: var(--texto-suave);
    background: #f8f9fa;
    border-color: var(--borde);
}

[data-bs-theme="dark"] .pagination .page-link {
    background: #1f2937;
    color: #fda4af;
    border-color: #374151;
}

[data-bs-theme="dark"] .pagination .page-link:hover,
[data-bs-theme="dark"] .pagination .page-link:focus {
    color: #fff;
    background: rgba(197, 32, 38, 0.25);
    border-color: var(--rojo);
}

[data-bs-theme="dark"] .pagination .page-item.active .page-link {
    color: #fff;
    background: var(--rojo);
    border-color: var(--rojo);
}

[data-bs-theme="dark"] .pagination .page-item.disabled .page-link {
    color: #9ca3af;
    background: #111827;
    border-color: #374151;
}

/* ─── Badges de estado ──────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
}

.badge-en_revision { background: #fef9c3; color: #854d0e; }
.badge-pendiente  { background: #ffedd5; color: #9a3412; }
.badge-aceptado   { background: #dcfce7; color: #166534; }
.badge-rechazado  { background: #fee2e2; color: #991b1b; }
.badge-cancelado  { background: #f1f5f9; color: #475569; }
.badge-erp-sync,
.badge-enviado_erp { background: #dbeafe; color: #1e40af; }

.badge-mt  { background: #f3e8ff; color: #6b21a8; }
.badge-ma  { background: #dbeafe; color: #1e40af; }
.badge-mr  { background: #dcfce7; color: #166534; }
.badge-mai { background: #fce7f3; color: #9d174d; }
.badge-mc  { background: #cffafe; color: #0e7490; }
.badge-mte { background: #ffedd5; color: #c2410c; }
.badge-mae { background: #fce7f3; color: #be185d; }
.badge-mho { background: #fef3c7; color: #92400e; }
.badge-vencida { background: #fee2e2; color: #991b1b; }
.badge-mhx { background: #ccfbf1; color: #115e59; }
.badge-mhem { background: #fde68a; color: #78350f; }
.badge-mfi { background: #e2e8f0; color: #334155; }
.badge-mfh { background: #ede9fe; color: #5b21b6; }
.badge-mbj { background: #f3f4f6; color: #4b5563; }
.badge-mhc { background: #fef08a; color: #854d0e; }
.badge-mtv { background: #ddd6fe; color: #5b21b6; }
.badge-mhen { background: #ffe4e6; color: #be123c; }
.badge-inv { background: #e0e7ff; color: #3730a3; }

/* ─── Botones de acción en tabla ────────────── */
.btn-ver {
    padding: 5px 12px;
    background: none;
    border: 1px solid var(--borde);
    border-radius: 5px;
    font-size: 12px;
    color: var(--texto-suave);
    cursor: pointer;
    text-decoration: none;
    transition: border-color .15s, color .15s;
    display: inline-block;
}

.btn-ver:hover { border-color: var(--rojo); color: var(--rojo); }

.btn.btn-ver:hover,
.btn.btn-ver:focus {
    border-color: var(--rojo);
    color: var(--rojo);
    background: transparent;
}

/* ─── Detalle de solicitud ──────────────────── */
.card {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 10px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--borde);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 { font-size: 15px; font-weight: 700; }

.card-body { padding: 20px; }

.info-item label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--texto-suave);
    margin-bottom: 3px;
}

.info-item p {
    font-size: 14px;
    color: var(--texto);
}

/* ─── Documentos ────────────────────────────── */
.doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--borde);
}

.doc-item:last-child { border-bottom: none; }

.doc-icon {
    width: 36px;
    height: 36px;
    background: #fef2f2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-info { flex: 1; min-width: 0; }
.doc-info p { font-size: 13px; font-weight: 500; word-break: break-word; }
@media (min-width: 576px) {
    .doc-info p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.doc-info span { font-size: 11px; color: var(--texto-suave); }

.doc-link {
    font-size: 12px;
    color: var(--rojo);
    text-decoration: none;
    font-weight: 600;
    flex-shrink: 0;
}

.doc-link:hover { text-decoration: underline; }

/* ─── Historial ─────────────────────────────── */
.historial-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--borde);
}

.historial-item:last-child { border-bottom: none; }

.historial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rojo);
    margin-top: 5px;
    flex-shrink: 0;
}

.historial-info p { font-size: 13px; font-weight: 500; }
.historial-info span { font-size: 11px; color: var(--texto-suave); }

/* ─── Botones de accion del detalle ─────────── */
.acciones-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-accion {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-accion:hover:not(:disabled) {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.btn-accion:disabled { opacity: .4; cursor: not-allowed; }

/* Misma paleta que los badges: fondo suave + texto oscuro (legible y armónico) */
.btn-aceptar {
    background: #dcfce7;
    color: #166534;
    border-color: rgba(22, 101, 52, 0.28);
}
.btn-aceptar:hover:not(:disabled) {
    background: #bbf7d0;
    border-color: rgba(22, 101, 52, 0.4);
}

.btn-rechazar {
    background: #fee2e2;
    color: #991b1b;
    border-color: rgba(153, 27, 27, 0.28);
}
.btn-rechazar:hover:not(:disabled) {
    background: #fecaca;
    border-color: rgba(153, 27, 27, 0.4);
}

.btn-erp {
    background: #dbeafe;
    color: #1e40af;
    border-color: rgba(30, 64, 175, 0.28);
}
.btn-erp:hover:not(:disabled) {
    background: #bfdbfe;
    border-color: rgba(30, 64, 175, 0.42);
}

.btn-estado-en_revision {
    background: #fef9c3;
    color: #854d0e;
    border-color: rgba(133, 77, 14, 0.28);
}
.btn-estado-en_revision:hover:not(:disabled) {
    background: #fef08a;
    border-color: rgba(133, 77, 14, 0.38);
}

.btn-estado-pendiente {
    background: #ffedd5;
    color: #9a3412;
    border-color: rgba(154, 52, 18, 0.28);
}
.btn-estado-pendiente:hover:not(:disabled) {
    background: #fed7aa;
    border-color: rgba(154, 52, 18, 0.4);
}

[data-bs-theme="dark"] .btn-aceptar {
    background: rgba(34, 197, 94, 0.15);
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.35);
}
[data-bs-theme="dark"] .btn-aceptar:hover:not(:disabled) {
    background: rgba(34, 197, 94, 0.24);
}

[data-bs-theme="dark"] .btn-rechazar {
    background: rgba(248, 113, 113, 0.12);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.35);
}
[data-bs-theme="dark"] .btn-rechazar:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.22);
}

[data-bs-theme="dark"] .btn-erp {
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.4);
}
[data-bs-theme="dark"] .btn-erp:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.28);
}

[data-bs-theme="dark"] .btn-estado-en_revision {
    background: rgba(234, 179, 8, 0.14);
    color: #fde047;
    border-color: rgba(250, 204, 21, 0.35);
}
[data-bs-theme="dark"] .btn-estado-en_revision:hover:not(:disabled) {
    background: rgba(234, 179, 8, 0.24);
}

[data-bs-theme="dark"] .btn-estado-pendiente {
    background: rgba(249, 115, 22, 0.14);
    color: #fdba74;
    border-color: rgba(251, 146, 60, 0.38);
}
[data-bs-theme="dark"] .btn-estado-pendiente:hover:not(:disabled) {
    background: rgba(249, 115, 22, 0.24);
}

/* ─── Estado vacío ──────────────────────────── */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--texto-suave);
}

.empty-state p { font-size: 15px; margin-top: 8px; }

/* ─── Login page ────────────────────────────── */
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    width: 100%;
    box-shadow: 0 4px 32px rgba(0,0,0,.08);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid var(--borde);
    padding: 6px;
    margin-bottom: 14px;
}

.login-logo h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--texto);
}

.login-logo p {
    font-size: 13px;
    color: var(--texto-suave);
    margin-top: 4px;
}

.btn-login {
    background: var(--rojo);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    transition: background .15s;
}

.btn-login:hover,
.btn-login:focus {
    background: var(--rojo-oscuro);
    color: #fff;
}

.login-footer {
    font-size: 12px;
}

.login-card .form-control {
    font-size: 14px;
    padding: 10px 12px;
}

.login-card .form-label {
    font-size: 11px;
    letter-spacing: .04em;
}

.login-password-toggle {
    border-color: var(--borde);
    color: var(--texto-suave);
    background: #fff;
}

.login-password-toggle:hover,
.login-password-toggle:focus {
    color: var(--rojo);
    border-color: var(--rojo);
    background: #fff;
    box-shadow: none;
}

.btn-login {
    padding: 10px 14px;
    font-size: 14px;
}

/* ─── Volver ────────────────────────────────── */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--texto-suave);
    text-decoration: none;
    margin-bottom: 18px;
    transition: color .15s;
}

.btn-back:hover { color: var(--rojo); }

/* ─── Sistema global de animaciones ─────────── */
:root {
    --smc-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body.smc-page-leave {
    opacity: 0;
    transition: opacity .42s ease;
}

.smc-reveal {
    opacity: 0;
    transform: translateY(16px) scale(0.99);
    transition:
        opacity 0.48s var(--smc-ease) var(--smc-reveal-delay, 0ms),
        transform 0.52s var(--smc-ease) var(--smc-reveal-delay, 0ms);
    will-change: opacity, transform;
}

.smc-reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.stat-card,
.table-card,
.card,
.btn-filter,
.btn-ver,
.btn-back,
.btn-logout,
.nav-link,
.theme-toggle-btn,
.login-card {
    transition:
        transform 0.28s var(--smc-ease),
        box-shadow 0.28s var(--smc-ease),
        background-color 0.24s ease,
        border-color 0.24s ease,
        color 0.24s ease;
}

.stat-card:hover,
.card:hover,
.table-card:hover {
    transform: translateY(-2px);
}

.btn-filter:hover,
.btn-ver:hover,
.btn-back:hover,
.btn-logout:hover,
.theme-toggle-btn:hover {
    transform: translateY(-1px);
}

.nav-link:hover {
    transform: translateX(4px);
}

/* ─── Utilidades (evitar estilos en línea en plantillas) ─ */
.text-muted-sm {
    font-size: 12px;
    color: var(--texto-suave);
}

.table-cell-sub {
    font-size: 12px;
    color: var(--texto-suave);
}

.motivo-rechazo-wrap {
    margin-top: 16px;
    padding: 12px 14px;
    background: #fef2f2;
    border-radius: 7px;
    border-left: 3px solid #c52026;
}

.motivo-rechazo-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #991b1b;
    display: block;
    margin-bottom: 4px;
}

.motivo-rechazo-p {
    font-size: 13px;
    color: #7f1d1d;
}

.card-header-meta {
    font-size: 12px;
    color: var(--texto-suave);
}

.estado-erp-banner {
    text-align: center;
    padding: 16px 0;
    color: #1e40af;
    font-size: 13px;
}

.estado-erp-banner svg {
    display: block;
    margin: 0 auto 8px;
}

.estado-erp-fecha {
    color: var(--texto-suave);
    font-size: 12px;
}

.estado-rechazado-titulo {
    text-align: center;
    padding: 16px 0;
    color: #991b1b;
    font-size: 13px;
    font-weight: 600;
}

.estado-rechazado-hint {
    font-size: 12px;
    color: var(--texto-suave);
    text-align: center;
    margin-bottom: 12px;
}

.btn-accion--spaced {
    margin-bottom: 10px;
}

.search-input:focus,
.filter-select:focus {
    border-color: var(--rojo);
    box-shadow: 0 0 0 0.2rem rgba(197, 32, 38, 0.15);
}

/* ─── Toggle tema (luna / sol + animación) ──── */
.theme-toggle-btn {
    width: 2.5rem;
    height: 2.5rem;
    position: relative;
}

.theme-toggle-stack {
    position: relative;
    width: 1.125rem;
    height: 1.125rem;
    display: block;
}

.theme-toggle-face {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    margin-top: -9px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.theme-toggle-face svg {
    display: block;
}

[data-bs-theme="light"] .theme-toggle-btn .theme-toggle-sun {
    opacity: 0;
    transform: scale(0.35) rotate(110deg);
    pointer-events: none;
}

[data-bs-theme="light"] .theme-toggle-btn .theme-toggle-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

[data-bs-theme="dark"] .theme-toggle-btn .theme-toggle-moon {
    opacity: 0;
    transform: scale(0.35) rotate(-110deg);
    pointer-events: none;
}

[data-bs-theme="dark"] .theme-toggle-btn .theme-toggle-sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

@keyframes theme-toggle-pulse {
    0% { transform: scale(1); }
    45% { transform: scale(0.88); }
    100% { transform: scale(1); }
}

.theme-toggle-btn.theme-toggle-btn--pulse {
    animation: theme-toggle-pulse 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-login-fab {
    z-index: 1080;
}

/* Desvanecimiento suave al cambiar tema (solo con .theme-transitions en <html>) */
html.theme-transitions body,
html.theme-transitions .sidebar,
html.theme-transitions .topbar,
html.theme-transitions .stat-card,
html.theme-transitions .table-card,
html.theme-transitions .table-toolbar,
html.theme-transitions .card,
html.theme-transitions .card-header,
html.theme-transitions .nav-link,
html.theme-transitions .btn-logout,
html.theme-transitions .login-card,
html.theme-transitions .login-logo img,
html.theme-transitions .filter-select,
html.theme-transitions .form-control,
html.theme-transitions .form-select,
html.theme-transitions .table-card .smc-table thead th,
html.theme-transitions .table-card .smc-table tbody td,
html.theme-transitions .badge,
html.theme-transitions .doc-icon,
html.theme-transitions .sidebar-logo,
html.theme-transitions .sidebar-footer,
html.theme-transitions .doc-item,
html.theme-transitions .historial-item,
html.theme-transitions .motivo-rechazo-wrap,
html.theme-transitions .empty-state,
html.theme-transitions .btn-ver,
html.theme-transitions .offcanvas,
html.theme-transitions .offcanvas-header {
    transition:
        background-color 0.45s ease,
        border-color 0.45s ease,
        color 0.4s ease,
        box-shadow 0.45s ease,
        stroke 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
    body.smc-page-leave {
        opacity: 1 !important;
        transition: none !important;
    }

    .smc-reveal,
    .smc-reveal.is-visible,
    .stat-card,
    .table-card,
    .card,
    .btn-filter,
    .btn-ver,
    .btn-back,
    .btn-logout,
    .nav-link,
    .theme-toggle-btn,
    .login-card {
        transition: none !important;
        transform: none !important;
        animation: none !important;
        opacity: 1 !important;
    }

    html.theme-transitions body,
    html.theme-transitions .sidebar,
    html.theme-transitions .topbar,
    html.theme-transitions .stat-card,
    html.theme-transitions .table-card,
    html.theme-transitions .table-toolbar,
    html.theme-transitions .card,
    html.theme-transitions .card-header,
    html.theme-transitions .nav-link,
    html.theme-transitions .btn-logout,
    html.theme-transitions .login-card,
    html.theme-transitions .login-logo img,
    html.theme-transitions .filter-select,
    html.theme-transitions .form-control,
    html.theme-transitions .form-select,
    html.theme-transitions .table-card .smc-table thead th,
    html.theme-transitions .table-card .smc-table tbody td,
    html.theme-transitions .badge,
    html.theme-transitions .doc-icon,
    html.theme-transitions .sidebar-logo,
    html.theme-transitions .sidebar-footer,
    html.theme-transitions .doc-item,
    html.theme-transitions .historial-item,
    html.theme-transitions .motivo-rechazo-wrap,
    html.theme-transitions .empty-state,
    html.theme-transitions .btn-ver,
    html.theme-transitions .offcanvas,
    html.theme-transitions .offcanvas-header,
    .theme-toggle-face {
        transition-duration: 0.01ms !important;
    }

    .theme-toggle-btn.theme-toggle-btn--pulse {
        animation: none !important;
    }
}

/* ─── Modo oscuro (data-bs-theme en <html>) ─── */
[data-bs-theme="dark"] {
    color-scheme: dark;
    --texto: #f1f5f9;
    --texto-suave: #94a3b8;
    --borde: #334155;
    --fondo: #0f172a;
    --beige-claro: #1e293b;
    --beige: #1e293b;
}

[data-bs-theme="dark"] .sidebar {
    background: #0f172a;
    border-right-color: var(--borde);
}

[data-bs-theme="dark"] .sidebar-logo {
    border-bottom-color: var(--borde);
}

[data-bs-theme="dark"] .sidebar-logo-text h2 {
    color: #fca5a5;
}

[data-bs-theme="dark"] .nav-link:hover {
    background: #1e293b;
    color: #fca5a5;
}

[data-bs-theme="dark"] .nav-link.active {
    background: rgba(197, 32, 38, 0.18);
    color: #fca5a5;
    border-right-color: var(--rojo);
}

[data-bs-theme="dark"] .sidebar-footer {
    border-top-color: var(--borde);
}

[data-bs-theme="dark"] .stat-card {
    background: #1e293b;
    border-color: var(--borde);
}

[data-bs-theme="dark"] .stat-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .stat-card.active {
    background: rgba(197, 32, 38, 0.2);
}

[data-bs-theme="dark"] .stat-card.en_revision.active {
    background: rgba(202, 138, 4, 0.2);
    border-color: #facc15;
    box-shadow: 0 10px 24px rgba(202, 138, 4, 0.26);
}
[data-bs-theme="dark"] .stat-card.pendiente.active {
    background: rgba(234, 88, 12, 0.2);
    border-color: #fb923c;
    box-shadow: 0 10px 24px rgba(234, 88, 12, 0.26);
}
[data-bs-theme="dark"] .stat-card.aceptado.active {
    background: rgba(22, 163, 74, 0.22);
    border-color: #4ade80;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.28);
}
[data-bs-theme="dark"] .stat-card.rechazado.active {
    background: rgba(220, 38, 38, 0.22);
    border-color: #f87171;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.28);
}
[data-bs-theme="dark"] .stat-card.cancelado.active {
    background: rgba(100, 116, 139, 0.24);
    border-color: #94a3b8;
    box-shadow: 0 10px 24px rgba(100, 116, 139, 0.28);
}
[data-bs-theme="dark"] .stat-card.erp.active {
    background: rgba(37, 99, 235, 0.24);
    border-color: #60a5fa;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.3);
}

[data-bs-theme="dark"] .table-card {
    background: #1e293b;
    border-color: var(--borde);
}

[data-bs-theme="dark"] .table-toolbar {
    border-bottom-color: var(--borde);
}

[data-bs-theme="dark"] .stat-icon {
    background: rgba(148, 163, 184, 0.14);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

[data-bs-theme="dark"] .filter-select {
    background-color: #0f172a;
    border-color: var(--borde);
    color: var(--texto);
}

[data-bs-theme="dark"] .table-card .smc-table thead th {
    background-color: #0f172a !important;
    color: var(--texto-suave);
    border-bottom-color: var(--borde);
}

[data-bs-theme="dark"] .table-card thead.table-light th {
    background-color: #0f172a !important;
    color: var(--texto-suave);
}

[data-bs-theme="dark"] .table-card .smc-table tbody td {
    border-bottom-color: var(--borde);
}

[data-bs-theme="dark"] .table-card .smc-table tbody tr:hover td {
    background: #0f172a;
}

[data-bs-theme="dark"] .card {
    background: #1e293b;
    border-color: var(--borde);
}

[data-bs-theme="dark"] .card-header {
    border-bottom-color: var(--borde);
}

[data-bs-theme="dark"] .doc-item {
    border-bottom-color: var(--borde);
}

[data-bs-theme="dark"] .doc-icon {
    background: rgba(197, 32, 38, 0.18);
}

[data-bs-theme="dark"] .historial-item {
    border-bottom-color: var(--borde);
}

[data-bs-theme="dark"] .login-card {
    background: #1e293b;
    border: 1px solid var(--borde);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

[data-bs-theme="dark"] .login-page::before {
    opacity: 0.16;
    filter: drop-shadow(0 20px 45px rgba(0, 0, 0, 0.45));
}

[data-bs-theme="dark"] .login-ecg-bg {
    opacity: 0.35;
}

[data-bs-theme="dark"] .login-logo img {
    border-color: var(--borde);
    background: #0f172a;
}

[data-bs-theme="dark"] .motivo-rechazo-wrap {
    background: rgba(127, 29, 29, 0.35);
    border-left-color: #f87171;
}

[data-bs-theme="dark"] .motivo-rechazo-label {
    color: #fecaca;
}

[data-bs-theme="dark"] .motivo-rechazo-p {
    color: #fecaca;
}

[data-bs-theme="dark"] .estado-erp-banner {
    color: #93c5fd;
}

[data-bs-theme="dark"] .estado-rechazado-titulo {
    color: #fecaca;
}

[data-bs-theme="dark"] .empty-state svg {
    stroke: #64748b;
}

[data-bs-theme="dark"] .badge-en_revision {
    background: rgba(234, 179, 8, 0.22);
    color: #fde047;
}
[data-bs-theme="dark"] .badge-pendiente {
    background: #78350f;
    color: #fde68a;
}

[data-bs-theme="dark"] .badge-aceptado {
    background: #14532d;
    color: #bbf7d0;
}

[data-bs-theme="dark"] .badge-rechazado {
    background: #7f1d1d;
    color: #fecaca;
}

[data-bs-theme="dark"] .badge-cancelado {
    background: #334155;
    color: #cbd5e1;
}

[data-bs-theme="dark"] .badge-erp-sync,
[data-bs-theme="dark"] .badge-enviado_erp {
    background: #1e3a8a;
    color: #bfdbfe;
}

[data-bs-theme="dark"] .badge-mt {
    background: #581c87;
    color: #e9d5ff;
}

[data-bs-theme="dark"] .badge-ma {
    background: #1e3a8a;
    color: #bfdbfe;
}

[data-bs-theme="dark"] .badge-mr {
    background: #14532d;
    color: #bbf7d0;
}

[data-bs-theme="dark"] .badge-mai {
    background: #831843;
    color: #fce7f3;
}

[data-bs-theme="dark"] .badge-mc {
    background: #164e63;
    color: #a5f3fc;
}

[data-bs-theme="dark"] .badge-mte {
    background: #9a3412;
    color: #fed7aa;
}

[data-bs-theme="dark"] .badge-mae {
    background: #831843;
    color: #fbcfe8;
}

[data-bs-theme="dark"] .badge-vencida {
    background: #7f1d1d;
    color: #fecaca;
}

[data-bs-theme="dark"] .badge-mho {
    background: #78350f;
    color: #fde68a;
}

[data-bs-theme="dark"] .badge-mhx {
    background: #134e4a;
    color: #99f6e4;
}

[data-bs-theme="dark"] .badge-mhem {
    background: #713f12;
    color: #fef08a;
}

[data-bs-theme="dark"] .badge-mfi {
    background: #334155;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .badge-mfh {
    background: #4c1d95;
    color: #ddd6fe;
}

[data-bs-theme="dark"] .badge-mbj {
    background: #374151;
    color: #d1d5db;
}

[data-bs-theme="dark"] .badge-mhc {
    background: #854d0e;
    color: #fef08a;
}

[data-bs-theme="dark"] .badge-mtv {
    background: #5b21b6;
    color: #ddd6fe;
}

[data-bs-theme="dark"] .badge-mhen {
    background: #9f1239;
    color: #ffe4e6;
}

[data-bs-theme="dark"] .badge-inv {
    background: #312e81;
    color: #c7d2fe;
}

/* ─── SweetAlert2 según tema SMC ────────────── */
.swal2-popup.swal2-smc {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    transition:
        background-color 0.4s ease,
        color 0.35s ease,
        border-color 0.35s ease;
}

.swal2-popup.swal2-smc-dark {
    border-color: rgba(148, 163, 184, 0.2);
}

.swal2-popup.swal2-smc-dark .swal2-html-container,
.swal2-popup.swal2-smc-dark .swal2-title {
    color: #f1f5f9;
}

.swal2-popup.swal2-smc-dark .swal2-textarea,
.swal2-popup.swal2-smc-dark .swal2-input {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

.swal2-popup.swal2-smc-dark .swal2-textarea:focus,
.swal2-popup.swal2-smc-dark .swal2-input:focus {
    border-color: #c52026 !important;
    box-shadow: 0 0 0 2px rgba(197, 32, 38, 0.25);
}

.swal2-popup.swal2-smc-dark .swal2-validation-message {
    background: #7f1d1d;
    color: #fecaca;
}

.swal2-popup.swal2-smc-light .swal2-textarea,
.swal2-popup.swal2-smc-light .swal2-input {
    background-color: #f9fafb !important;
    color: #1e293b !important;
    border-color: #e5e7eb !important;
}

.swal2-popup.swal2-smc-light .swal2-textarea:focus,
.swal2-popup.swal2-smc-light .swal2-input:focus {
    border-color: #c52026 !important;
    box-shadow: 0 0 0 2px rgba(197, 32, 38, 0.2);
}

html.theme-transitions .swal2-container .swal2-popup.swal2-smc {
    transition:
        background-color 0.4s ease,
        color 0.35s ease,
        border-color 0.35s ease;
}

/* ─── Detalle: copiar y vista previa documentos ─ */
.btn-copy {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.doc-preview-dialog {
    max-width: min(96vw, 1100px);
}

.doc-preview-body {
    min-height: min(70vh, 720px);
}

.doc-preview-frame {
    min-height: min(70vh, 720px);
    border: 0;
    background: var(--fondo);
}

.doc-preview-img-wrap {
    min-height: min(50vh, 480px);
}

.doc-preview-img {
    max-height: min(70vh, 720px);
    object-fit: contain;
}

/* ─── Inicio / dashboard resumen ───────────────────────────── */
.inicio-wrap {
    max-width: 1200px;
    margin: 0 auto;
}

.inicio-hero {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: clamp(1.25rem, 4vw, 2.25rem);
    margin-bottom: 1.5rem;
    border: 1px solid var(--borde);
    box-shadow: 0 18px 48px rgba(17, 24, 39, 0.08);
}

.inicio-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(900px 280px at 100% 0%, rgba(197, 32, 38, 0.14), transparent 55%);
    pointer-events: none;
}

/* Fondo decorativo sol / luna (gira muy lento según franja del día) */
.inicio-hero-celeste {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.inicio-hero-celeste-track {
    position: absolute;
    right: max(-8%, -2.5rem);
    top: 50%;
    width: min(52vw, 300px);
    height: min(52vw, 300px);
    transform: translateY(-50%);
}

.inicio-hero-celeste-spin {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: inicio-celeste-giro 96s linear infinite;
}

.inicio-hero-celeste-spin--counter {
    animation-duration: 54s;
    animation-direction: reverse;
    opacity: 0.85;
}

@keyframes inicio-celeste-giro {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.inicio-celeste-svg {
    width: 100%;
    height: 100%;
    display: block;
}


.inicio-hero--manana .inicio-celeste-svg--sol {
    color: #ea580c;
    opacity: 0.2;
    filter: drop-shadow(0 0 28px rgba(234, 88, 12, 0.25));
}

.inicio-hero--tarde .inicio-celeste-svg--sol-tarde {
    color: #fdba74;
    opacity: 0.14;
    filter: drop-shadow(0 0 36px rgba(253, 186, 116, 0.2));
}

.inicio-hero--noche .inicio-celeste-svg--luna {
    color: #f5f5f4;
    opacity: 0.14;
    filter: drop-shadow(0 0 44px rgba(255, 255, 255, 0.14));
}

.inicio-hero--noche .inicio-celeste-svg--orbita {
    color: #e7e5e4;
    opacity: 0.55;
}


.inicio-hero--manana {
    background: linear-gradient(135deg, #fffdf8 0%, #f7f0e3 42%, #fde8e8 100%);
    color: var(--texto);
}

/* Hero tarde/noche: colores según hora (TIME_ZONE); paleta rojo + stone/beige SMC */
.inicio-hero--tarde {
    background: linear-gradient(125deg, #292524 0%, #44403c 32%, #57534e 55%, #7f1d1f 100%);
    color: #fafaf9;
}

.inicio-hero--tarde .inicio-kicker,
.inicio-hero--tarde .inicio-lead,
.inicio-hero--tarde .inicio-card-meta {
    color: rgba(250, 250, 249, 0.78);
}

.inicio-hero--noche {
    background: linear-gradient(145deg, #1c1917 0%, #292018 38%, #3f1818 72%, #5c1a1f 100%);
    color: #f5f5f4;
}

.inicio-hero--noche .inicio-kicker,
.inicio-hero--noche .inicio-lead,
.inicio-hero--noche .inicio-card-meta {
    color: rgba(245, 245, 244, 0.78);
}

.inicio-hero-grid {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 1.5rem;
    align-items: center;
}

/* Transición al entrar si cambió mañana/tarde/noche respecto a la última visita */
.inicio-hero-periodo-reveal {
    position: absolute;
    inset: 0;
    z-index: 5;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.12s cubic-bezier(0.33, 1, 0.68, 1);
}

.inicio-hero-periodo-reveal.is-armed {
    opacity: 1;
    transition: none;
}

.inicio-hero-periodo-reveal.is-dissolving {
    opacity: 0;
}

.inicio-hero-periodo-reveal--prev-noche {
    background: linear-gradient(145deg, #1c1917 0%, #292018 38%, #3f1818 72%, #5c1a1f 100%);
}

.inicio-hero-periodo-reveal--prev-tarde {
    background: linear-gradient(125deg, #292524 0%, #44403c 32%, #57534e 55%, #7f1d1f 100%);
}

.inicio-hero-periodo-reveal--prev-manana {
    background: linear-gradient(135deg, #fffdf8 0%, #f7f0e3 42%, #fde8e8 100%);
}

.inicio-wrap--entrada-suave .inicio-hero {
    animation: inicio-wrap-hero-in 0.58s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes inicio-wrap-hero-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    .inicio-hero-grid {
        grid-template-columns: 1fr auto;
    }
}

.inicio-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--texto-suave);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.inicio-kicker-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--rojo);
    box-shadow: 0 0 0 4px rgba(197, 32, 38, 0.2);
    animation: inicio-pulse 2.4s ease-in-out infinite;
}

@keyframes inicio-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(0.92); }
}

.inicio-title {
    font-size: clamp(1.35rem, 3.5vw, 1.85rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 0.65rem;
}

.inicio-hero--tarde .inicio-title,
.inicio-hero--noche .inicio-title {
    color: #fff;
}

.inicio-name {
    color: var(--rojo);
    background: linear-gradient(120deg, var(--rojo), #e85d62);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.inicio-hero--tarde .inicio-name,
.inicio-hero--noche .inicio-name {
    background: linear-gradient(120deg, #fecaca, #fca5a5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.inicio-lead {
    font-size: 0.95rem;
    line-height: 1.55;
    max-width: 36rem;
    margin-bottom: 1rem;
    color: var(--texto-suave);
}

.inicio-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.inicio-btn-ghost--manana {
    border: 1px solid rgba(26, 26, 26, 0.18);
    color: var(--texto);
    background: rgba(255, 255, 255, 0.65);
}

.inicio-btn-ghost--tarde,
.inicio-btn-ghost--noche {
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
}

.inicio-btn-ghost--tarde:hover,
.inicio-btn-ghost--noche:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.inicio-hero-stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.inicio-stat-chip {
    min-width: 120px;
    padding: 1rem 1.15rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(8px);
}

.inicio-hero--tarde .inicio-stat-chip,
.inicio-hero--noche .inicio-stat-chip {
    background: rgba(41, 37, 36, 0.55);
    border-color: rgba(255, 255, 255, 0.12);
}

.inicio-stat-chip--accent {
    border-color: rgba(197, 32, 38, 0.35);
    box-shadow: inset 0 0 0 1px rgba(197, 32, 38, 0.08);
}

.inicio-stat-val {
    display: block;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--rojo);
}

.inicio-hero--tarde .inicio-stat-val,
.inicio-hero--noche .inicio-stat-val {
    color: #fecaca;
}

.inicio-stat-lbl {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--texto-suave);
    margin-top: 0.35rem;
    display: block;
}

.inicio-hero--tarde .inicio-stat-lbl,
.inicio-hero--noche .inicio-stat-lbl {
    color: rgba(250, 250, 249, 0.65);
}

.inicio-card {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 16px;
    padding: 1.15rem 1.25rem;
    box-shadow: 0 8px 28px rgba(17, 24, 39, 0.05);
}

.inicio-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--borde);
}

.inicio-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}

.inicio-card-meta {
    font-size: 11px;
    font-weight: 600;
    color: var(--texto-suave);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.inicio-recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.inicio-recent-item {
    border-radius: 12px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.inicio-recent-item:hover {
    transform: translateX(2px);
}

.inicio-recent-link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem 1rem;
    align-items: center;
    padding: 0.75rem 0.65rem;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    border: 1px solid transparent;
    background: linear-gradient(90deg, #fafafa 0%, #fff 100%);
}

.inicio-recent-item:hover .inicio-recent-link {
    border-color: rgba(197, 32, 38, 0.2);
    box-shadow: 0 6px 20px rgba(197, 32, 38, 0.08);
}

.inicio-recent-rank {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    border-radius: 10px;
    background: var(--beige-claro);
    color: var(--rojo);
}

.inicio-recent-name {
    display: block;
    font-size: 0.92rem;
}

.inicio-recent-mail {
    display: block;
    font-size: 12px;
    color: var(--texto-suave);
    margin-top: 0.15rem;
}

.inicio-recent-time {
    font-size: 11px;
    color: var(--texto-suave);
    font-variant-numeric: tabular-nums;
}

.inicio-barchart {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.inicio-barchart--compact {
    gap: 0.55rem;
}

.inicio-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr) auto;
    gap: 0.5rem 0.65rem;
    align-items: center;
    font-size: 12px;
}

.inicio-bar-label {
    font-weight: 600;
    color: var(--texto-suave);
}

.inicio-bar-track {
    height: 10px;
    border-radius: 99px;
    background: var(--fondo);
    overflow: hidden;
}

.inicio-barchart--compact .inicio-bar-track {
    height: 8px;
}

.inicio-bar-fill {
    height: 100%;
    border-radius: 99px;
    min-width: 4px;
    transform-origin: left center;
    animation: inicio-bar-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes inicio-bar-in {
    from { transform: scaleX(0.08); opacity: 0.65; }
    to { transform: scaleX(1); opacity: 1; }
}

.inicio-bar-fill--mt {
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.inicio-bar-fill--ma {
    background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.inicio-bar-fill--mr {
    background: linear-gradient(90deg, #059669, #34d399);
}

.inicio-bar-fill--mai {
    background: linear-gradient(90deg, #db2777, #f472b6);
}

.inicio-bar-fill--mc {
    background: linear-gradient(90deg, #0891b2, #22d3ee);
}

.inicio-bar-fill--mte {
    background: linear-gradient(90deg, #ea580c, #fb923c);
}

.inicio-bar-fill--mae {
    background: linear-gradient(90deg, #be185d, #f472b6);
}

.inicio-bar-fill--mho {
    background: linear-gradient(90deg, #b45309, #fbbf24);
}

.inicio-bar-fill--mhx {
    background: linear-gradient(90deg, #0f766e, #2dd4bf);
}

.inicio-bar-fill--mhem {
    background: linear-gradient(90deg, #92400e, #fcd34d);
}

.inicio-bar-fill--mfi {
    background: linear-gradient(90deg, #475569, #94a3b8);
}

.inicio-bar-fill--mfh {
    background: linear-gradient(90deg, #6d28d9, #a78bfa);
}

.inicio-bar-fill--mbj {
    background: linear-gradient(90deg, #6b7280, #9ca3af);
}

.inicio-bar-fill--mhc {
    background: linear-gradient(90deg, #a16207, #fde047);
}

.inicio-bar-fill--mtv {
    background: linear-gradient(90deg, #7c3aed, #c4b5fd);
}

.inicio-bar-fill--mhen {
    background: linear-gradient(90deg, #e11d48, #fb7185);
}

.inicio-bar-fill--est-en_revision {
    background: linear-gradient(90deg, #ca8a04, #fcd34d);
}

.inicio-bar-fill--est-pendiente {
    background: linear-gradient(90deg, #d97706, #fbbf24);
}

.inicio-bar-fill--est-aceptado {
    background: linear-gradient(90deg, #15803d, #4ade80);
}

.inicio-bar-fill--est-rechazado {
    background: linear-gradient(90deg, #b91c1c, #f87171);
}

.inicio-bar-fill--est-cancelado {
    background: linear-gradient(90deg, #475569, #94a3b8);
}

.inicio-bar-fill--est-erp_sync {
    background: linear-gradient(90deg, #1d4ed8, #93c5fd);
}

.inicio-bar-count {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    min-width: 1.5rem;
    text-align: right;
    color: var(--texto);
}

[data-bs-theme="dark"] .inicio-card {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .inicio-card-head {
    border-bottom-color: rgba(148, 163, 184, 0.18);
}

[data-bs-theme="dark"] .inicio-recent-link {
    background: linear-gradient(90deg, #0f172a 0%, #111827 100%);
}

[data-bs-theme="dark"] .inicio-recent-mail,
[data-bs-theme="dark"] .inicio-bar-label {
    color: #94a3b8;
}

[data-bs-theme="dark"] .inicio-bar-track {
    background: #1e293b;
}

[data-bs-theme="dark"] .inicio-bar-count {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .inicio-hero--manana .inicio-celeste-svg--sol {
    color: #fb923c;
    opacity: 0.22;
}

[data-bs-theme="dark"] .inicio-hero--manana {
    background: linear-gradient(135deg, #1c1917 0%, #292524 50%, #3f1818 100%);
    color: #fafaf9;
    border-color: rgba(148, 163, 184, 0.2);
}

[data-bs-theme="dark"] .inicio-hero--manana .inicio-lead,
[data-bs-theme="dark"] .inicio-hero--manana .inicio-kicker {
    color: #a8a29e;
}

[data-bs-theme="dark"] .inicio-hero--manana .inicio-stat-chip {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(148, 163, 184, 0.2);
}

[data-bs-theme="dark"] .inicio-btn-ghost--manana {
    border-color: rgba(255, 255, 255, 0.2);
    color: #fafaf9;
    background: rgba(255, 255, 255, 0.06);
}

@media (prefers-reduced-motion: reduce) {
    .inicio-kicker-dot {
        animation: none;
    }
    .inicio-bar-fill {
        animation: none;
    }
    .inicio-recent-item:hover {
        transform: none;
    }
    .inicio-hero-celeste-spin {
        animation: none;
    }
    .login-page::before {
        animation: none;
    }
    .login-ecg-trace {
        animation: none;
        stroke-dashoffset: 0;
    }
    .inicio-wrap--entrada-suave .inicio-hero {
        animation: none;
    }
    .smc-portal-live-ring,
    .smc-portal-live-core,
    .smc-portal-pulse-toast-glow,
    .smc-row-portal-hot,
    .nav-portal-pulse-dot.is-lit {
        animation: none !important;
    }
    .smc-portal-pulse-toast {
        transition: opacity 0.2s ease, transform 0.2s ease;
    }
    .smc-portal-campo-highlight {
        animation: none;
    }
}

/* ─── Pulso portal (solicitante → admin) ───────────────────────── */
.smc-portal-pulse-dock {
    position: fixed;
    top: calc(var(--header-h) + 10px);
    right: 12px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    max-height: calc(100vh - var(--header-h) - 24px);
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: none;
    padding-left: 8px;
}
.smc-portal-pulse-dock > * {
    pointer-events: auto;
}

.smc-portal-pulse-toast {
    position: relative;
    min-width: 280px;
    max-width: min(94vw, 380px);
    transform: translateX(120%) scale(0.94);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}
.smc-portal-pulse-toast.is-visible {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.smc-portal-pulse-toast-glow {
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    background: linear-gradient(125deg, #22c55e, #0ea5e9, #c52026);
    opacity: 0.55;
    filter: blur(12px);
    z-index: 0;
    animation: smc-portal-glow-shift 4s ease-in-out infinite;
}
@keyframes smc-portal-glow-shift {
    0%, 100% { opacity: 0.45; transform: rotate(0deg) scale(1); }
    50% { opacity: 0.7; transform: rotate(2deg) scale(1.02); }
}

.smc-portal-pulse-toast-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 12px 14px 14px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.94));
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    color: #0f172a;
}

[data-bs-theme="dark"] .smc-portal-pulse-toast-inner {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
    border-color: rgba(148, 163, 184, 0.2);
    color: #f1f5f9;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.smc-portal-pulse-toast-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #15803d;
}
[data-bs-theme="dark"] .smc-portal-pulse-toast-icon {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.25), rgba(14, 165, 233, 0.2));
    color: #4ade80;
}

.smc-portal-pulse-toast-main {
    flex: 1;
    min-width: 0;
}

.smc-portal-pulse-toast-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #059669;
    margin-bottom: 4px;
}
[data-bs-theme="dark"] .smc-portal-pulse-toast-kicker {
    color: #34d399;
}

.smc-portal-pulse-toast-name {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 6px;
    color: inherit;
}

.smc-portal-pulse-toast-msg {
    font-size: 12px;
    line-height: 1.45;
    color: #475569;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
[data-bs-theme="dark"] .smc-portal-pulse-toast-msg {
    color: #94a3b8;
}

.smc-portal-pulse-toast-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #c52026;
    text-decoration: none;
    border-bottom: 1px solid rgba(197, 32, 38, 0.35);
}
.smc-portal-pulse-toast-link:hover {
    color: #a01a1f;
}

.smc-portal-pulse-toast-close {
    flex-shrink: 0;
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 22px;
    line-height: 1;
    padding: 0 0 0 4px;
    cursor: pointer;
    opacity: 0.75;
}
.smc-portal-pulse-toast-close:hover {
    opacity: 1;
    color: #64748b;
}

.smc-portal-live-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 9px 4px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #047857;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid rgba(16, 185, 129, 0.45);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}
[data-bs-theme="dark"] .smc-portal-live-badge {
    color: #6ee7b7;
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.5), rgba(15, 118, 110, 0.35));
    border-color: rgba(52, 211, 153, 0.35);
}

.smc-portal-live-ring {
    position: absolute;
    left: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(16, 185, 129, 0.55);
    animation: smc-portal-ring-ping 1.8s ease-out infinite;
    pointer-events: none;
}
.smc-portal-live-core {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.85);
    animation: smc-portal-core-pulse 1.2s ease-in-out infinite;
    flex-shrink: 0;
}
.smc-portal-live-label {
    margin-left: 2px;
    font-size: 9px;
    letter-spacing: 0.02em;
}
@keyframes smc-portal-ring-ping {
    0% { transform: scale(0.65); opacity: 0.9; }
    100% { transform: scale(2.1); opacity: 0; }
}
@keyframes smc-portal-core-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.88); opacity: 0.85; }
}

#dashboard-results.smc-live-refreshed,
#usuarios-results.smc-live-refreshed,
#invitados-results.smc-live-refreshed,
#inicio-live.smc-live-refreshed {
    animation: smc-live-refresh-pulse 0.85s ease-out 1;
}

@keyframes smc-live-refresh-pulse {
    0% { opacity: 0.72; }
    100% { opacity: 1; }
}

.smc-row-portal-fresh td {
    transition: background-color 0.35s ease;
}
.smc-row-portal-fresh {
    box-shadow: inset 3px 0 0 0 #10b981;
}
[data-bs-theme="dark"] .smc-row-portal-fresh {
    box-shadow: inset 3px 0 0 0 #34d399;
}

.smc-row-portal-hot {
    animation: smc-row-portal-flash 1.1s ease-out 2;
    background-color: rgba(16, 185, 129, 0.09) !important;
}
[data-bs-theme="dark"] .smc-row-portal-hot {
    background-color: rgba(52, 211, 153, 0.08) !important;
}
@keyframes smc-row-portal-flash {
    0% { background-color: rgba(14, 165, 233, 0.22); }
    100% { background-color: rgba(16, 185, 129, 0.09); }
}

.nav-portal-pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 6px;
    background: radial-gradient(circle at 30% 30%, #fef08a, #f97316 45%, #c52026);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 12px rgba(249, 115, 22, 0.85);
    vertical-align: middle;
    display: inline-block;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}
.nav-portal-pulse-dot.is-lit {
    transform: scale(1);
    opacity: 1;
    animation: smc-nav-dot-pulse 1.1s ease-in-out infinite;
}
@keyframes smc-nav-dot-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 10px rgba(249, 115, 22, 0.7); }
    50% { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 18px rgba(197, 32, 38, 0.95); }
}

/* Resaltado de campos editados en detalle (portal Cardiología) */
.smc-portal-campo-highlight-inner {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    vertical-align: top;
}
.smc-portal-campo-highlight {
    position: relative;
    border-radius: 6px;
    padding: 3px 8px 3px 10px !important;
    margin: 0;
    background: rgba(255, 251, 235, 0.85);
    border: 1px solid rgba(197, 32, 38, 0.2);
    box-shadow: none;
}
.smc-portal-campo-highlight::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--rojo);
    opacity: 0.65;
}
.smc-portal-campo-highlight label {
    color: var(--texto-suave);
}
.smc-portal-campo-highlight p,
.smc-portal-campo-highlight .mb-0 {
    color: var(--texto);
}
.tab-pane.smc-portal-campo-highlight {
    display: block;
    width: auto;
    max-width: none;
    padding: 0 0 0 12px !important;
    margin: 0;
    background: transparent;
    border: 0;
    box-shadow: inset 3px 0 0 rgba(197, 32, 38, 0.28);
    border-radius: 0;
}
.tab-pane.smc-portal-campo-highlight::before {
    display: none;
}
.detalle-foto-wrap.smc-portal-campo-highlight {
    display: flex;
    width: auto;
    padding: 4px;
    border-radius: 10px;
}
.detalle-foto-wrap.smc-portal-campo-highlight::before {
    display: none;
}
.doc-item.smc-portal-campo-highlight {
    display: flex;
    width: auto;
    max-width: 100%;
    margin: 0;
    padding: 8px 10px !important;
    border-radius: 8px;
}
.doc-item.smc-portal-campo-highlight::before {
    top: 6px;
    bottom: 6px;
}
[data-bs-theme="dark"] .smc-portal-campo-highlight {
    background: rgba(127, 29, 29, 0.22);
    border-color: rgba(248, 113, 113, 0.28);
}
[data-bs-theme="dark"] .smc-portal-campo-highlight label {
    color: #94a3b8;
}
[data-bs-theme="dark"] .smc-portal-campo-highlight p,
[data-bs-theme="dark"] .smc-portal-campo-highlight .mb-0 {
    color: #e2e8f0;
}

/* ─── Cursos: hero + stepper flujo de pago ───────────────────────── */
.smc-cursos-hero {
    border: 1px solid var(--borde);
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, #fff 0%, var(--beige-claro) 55%, #fff 100%);
    position: relative;
}
.smc-cursos-hero__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    position: relative;
    z-index: 1;
}
.smc-cursos-hero__text { flex: 1 1 220px; min-width: 0; }
.smc-cursos-hero__kicker {
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--rojo);
    font-size: 0.68rem;
}
.smc-cursos-hero__name { font-weight: 800; color: var(--texto); }
.smc-cursos-hero__deco {
    flex: 0 0 120px;
    min-height: 88px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, rgba(197, 32, 38, 0.06), rgba(238, 225, 198, 0.5));
    border: 1px solid rgba(197, 32, 38, 0.12);
}
.smc-cursos-hero__art {
    width: 100px;
    height: auto;
    max-width: 100%;
    display: block;
}
@media (max-width: 575.98px) {
    .smc-cursos-hero__deco { flex: 1 1 100%; min-height: 72px; }
}

.smc-cursos-flujo { margin-bottom: 0; }
.smc-cursos-flujo__card {
    border: 1px solid var(--borde);
    border-radius: 14px;
    padding: 1.25rem 1.25rem 1.1rem;
    background: #fff;
    box-shadow: 0 2px 14px rgba(26, 26, 26, 0.04);
}
.smc-cursos-flujo__intro {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.35rem;
}
.smc-cursos-flujo__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rojo);
    background: linear-gradient(145deg, var(--beige-claro), #fff);
    border: 1px solid rgba(197, 32, 38, 0.12);
}
.smc-cursos-flujo__title {
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 0.35rem;
    color: var(--texto);
}
.smc-cursos-flujo__hint {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--texto-suave);
    line-height: 1.45;
}
.smc-cursos-flujo__steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem 0.5rem;
}
@media (max-width: 991.98px) {
    .smc-cursos-flujo__steps {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
.smc-cursos-flujo__step {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 0.5rem 0.85rem;
    border-radius: 10px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}
.smc-cursos-flujo__step--active {
    background: linear-gradient(135deg, rgba(197, 32, 38, 0.06), rgba(238, 225, 198, 0.35));
    box-shadow: inset 0 0 0 1px rgba(197, 32, 38, 0.14);
}
.smc-cursos-flujo__step--done {
    background: rgba(22, 101, 52, 0.04);
}
.smc-cursos-flujo__step--wait {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.08), rgba(238, 225, 198, 0.28));
    box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.28);
}
.smc-cursos-flujo__rail {
    display: none;
}
@media (min-width: 992px) {
    .smc-cursos-flujo__step .smc-cursos-flujo__rail {
        display: block;
        position: absolute;
        top: 50%;
        left: calc(100% - 0.25rem);
        width: calc(100% - 2.5rem);
        height: 3px;
        transform: translateY(-50%);
        background: linear-gradient(90deg, var(--borde), var(--beige));
        border-radius: 2px;
        z-index: 0;
    }
    .smc-cursos-flujo__step:last-child .smc-cursos-flujo__rail { display: none; }
    .smc-cursos-flujo__step--done .smc-cursos-flujo__rail {
        background: linear-gradient(90deg, #16a34a55, #16a34a22);
    }
}
.smc-cursos-flujo__dot {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
    border: 2px solid var(--borde);
    background: #fff;
    color: var(--texto-suave);
}
.smc-cursos-flujo__step--active .smc-cursos-flujo__dot {
    border-color: var(--rojo);
    color: var(--rojo);
    box-shadow: 0 0 0 4px rgba(197, 32, 38, 0.12);
}
.smc-cursos-flujo__step--wait .smc-cursos-flujo__dot {
    border-color: #ca8a04;
    color: #ca8a04;
    background: #fffbeb;
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.15);
}
.smc-cursos-flujo__step--done .smc-cursos-flujo__dot {
    border-color: #16a34a;
    background: #16a34a;
    color: #fff;
}
.smc-cursos-flujo__wait-icon { display: block; }
.smc-cursos-flujo__num { line-height: 1; }
.smc-cursos-flujo__pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--rojo);
    animation: smc-flujo-pulse 1.4s ease-in-out infinite;
}
@keyframes smc-flujo-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.75; }
}
.smc-cursos-flujo__body { min-width: 0; }
.smc-cursos-flujo__label {
    display: block;
    font-weight: 700;
    font-size: 0.8125rem;
    color: var(--texto);
}
.smc-cursos-flujo__micro {
    display: block;
    font-size: 0.72rem;
    color: var(--texto-suave);
    margin-top: 0.15rem;
    word-break: break-word;
}
.smc-cursos-flujo__badge-done {
    margin-top: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #166534;
    background: rgba(22, 101, 52, 0.08);
    border: 1px solid rgba(22, 101, 52, 0.2);
}
.smc-cursos-flujo__check { margin-right: 0.35rem; }

.badge-movilidad-proceso {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #fff4e6;
    color: #c2410c;
    border: 1px solid #fdba74;
    vertical-align: middle;
}

[data-bs-theme="dark"] .smc-cursos-hero__name { color: #fafafa; }
[data-bs-theme="dark"] .smc-cursos-hero__kicker { color: #f87171; }
[data-bs-theme="dark"] .smc-cursos-hero {
    background: linear-gradient(135deg, #1c1c1e 0%, #252528 50%, #1c1c1e 100%);
    border-color: #3f3f46;
}
[data-bs-theme="dark"] .smc-cursos-hero__deco {
    background: linear-gradient(160deg, rgba(248, 113, 113, 0.08), rgba(63, 63, 70, 0.45));
    border-color: #52525b;
}
[data-bs-theme="dark"] .smc-cursos-hero__art {
    opacity: 0.92;
    filter: brightness(1.08) contrast(1.05);
}
[data-bs-theme="dark"] .smc-cursos-flujo__card {
    background: #18181b;
    border-color: #3f3f46;
}
[data-bs-theme="dark"] .smc-cursos-flujo__hint,
[data-bs-theme="dark"] .smc-cursos-flujo__micro { color: #a1a1aa; }
[data-bs-theme="dark"] .smc-cursos-flujo__step--active {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(63, 63, 70, 0.5));
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.25);
}
[data-bs-theme="dark"] .smc-cursos-flujo__step--wait {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.12), rgba(63, 63, 70, 0.45));
    box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.22);
}
[data-bs-theme="dark"] .smc-cursos-flujo__step--wait .smc-cursos-flujo__dot {
    background: #27272a;
    border-color: #eab308;
    color: #fde047;
}
[data-bs-theme="dark"] .smc-cursos-flujo__dot { background: #27272a; border-color: #52525b; }

/* ═══ Portal del solicitante — experiencia unificada «pulso editorial» ═══ */
body.solicitante-portal {
    background:
        radial-gradient(1200px 520px at 12% -8%, rgba(197, 32, 38, 0.09), transparent 55%),
        radial-gradient(900px 480px at 96% 8%, rgba(238, 225, 198, 0.55), transparent 50%),
        linear-gradient(180deg, #f8fafc 0%, var(--fondo) 38%, #eef2f7 100%);
}

body.solicitante-portal .sol-portal-shell {
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
}

body.solicitante-portal .topbar {
    background: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(12px);
    border-bottom-color: rgba(15, 23, 42, 0.06) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

body.solicitante-portal .sidebar {
    background: linear-gradient(175deg, #ffffff 0%, #fffdf8 45%, #faf6f0 100%);
    border-right-color: rgba(15, 23, 42, 0.06);
    box-shadow: 8px 0 40px rgba(15, 23, 42, 0.04);
}

body.solicitante-portal .sidebar-logo {
    border-bottom-color: rgba(15, 23, 42, 0.06);
}

body.solicitante-portal .nav-link.active {
    background: linear-gradient(90deg, rgba(197, 32, 38, 0.1), rgba(197, 32, 38, 0.02));
    border-right: 3px solid var(--rojo);
    box-shadow: inset 0 0 0 1px rgba(197, 32, 38, 0.06);
}

body.solicitante-portal .user-avatar {
    box-shadow: 0 0 0 3px rgba(197, 32, 38, 0.12), 0 8px 22px rgba(197, 32, 38, 0.15);
}

/* —— Página inicio —— */
body.solicitante-portal .sol-portal-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

body.solicitante-portal .sol-hero--portal {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(15, 23, 42, 0.07);
    background: linear-gradient(125deg, #fffefb 0%, #fff7f7 38%, #f7f0e3 100%);
    box-shadow:
        0 22px 50px rgba(17, 24, 39, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.75) inset;
}

body.solicitante-portal .sol-hero__grid {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(80% 70% at 18% 12%, #000 18%, transparent 72%);
    pointer-events: none;
}

body.solicitante-portal .sol-hero__ecg {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 72px;
    color: rgba(197, 32, 38, 0.22);
    pointer-events: none;
}

body.solicitante-portal .sol-hero__ecg-svg {
    width: 100%;
    height: 100%;
    display: block;
}

body.solicitante-portal .sol-hero__ecg-path {
    stroke-dasharray: 520;
    stroke-dashoffset: 520;
    animation: sol-ecg-draw 2.8s ease-out forwards, sol-ecg-drift 14s linear 2.8s infinite;
}

@keyframes sol-ecg-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes sol-ecg-drift {
    from { transform: translateX(0); }
    to { transform: translateX(-40px); }
}

body.solicitante-portal .sol-hero__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    pointer-events: none;
    opacity: 0.55;
}
body.solicitante-portal .sol-hero__glow--a {
    width: 220px;
    height: 220px;
    top: -80px;
    right: -40px;
    background: rgba(197, 32, 38, 0.2);
}
body.solicitante-portal .sol-hero__glow--b {
    width: 180px;
    height: 180px;
    bottom: -60px;
    left: -30px;
    background: rgba(238, 225, 198, 0.85);
}

body.solicitante-portal .sol-hero__inner {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 1.5rem;
    padding: clamp(1.35rem, 4vw, 2.25rem);
    align-items: start;
}

@media (min-width: 768px) {
    body.solicitante-portal .sol-hero__inner {
        grid-template-columns: 1fr minmax(200px, 260px);
        align-items: center;
    }
}

body.solicitante-portal .sol-hero__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--texto-suave);
    margin-bottom: 0.5rem;
}

body.solicitante-portal .sol-hero__pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rojo);
    box-shadow: 0 0 0 4px rgba(197, 32, 38, 0.2);
    animation: sol-pulse-dot 2.2s ease-in-out infinite;
}

@keyframes sol-pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.9); opacity: 0.75; }
}

body.solicitante-portal .sol-hero__title {
    font-size: clamp(1.45rem, 4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 0.65rem;
    color: var(--texto);
}

body.solicitante-portal .sol-hero__name {
    background: linear-gradient(115deg, var(--rojo), #e85d62 55%, #b91c1c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.solicitante-portal .sol-hero__lead {
    margin: 0 0 1rem;
    max-width: 40rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--texto-suave);
}

body.solicitante-portal .sol-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

body.solicitante-portal .sol-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.72);
}
body.solicitante-portal .sol-chip--accent {
    border-color: rgba(197, 32, 38, 0.22);
    background: rgba(254, 242, 242, 0.85);
    color: var(--texto);
}
body.solicitante-portal .sol-chip--muted {
    color: var(--texto-suave);
}

body.solicitante-portal .sol-hero__aside {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.07);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(8px);
}

body.solicitante-portal .sol-hero__stat-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--texto-suave);
    margin-bottom: 0.35rem;
}

body.solicitante-portal .sol-hero__badge {
    font-size: 0.8rem;
}

body.solicitante-portal .sol-hero__stat-val {
    display: block;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}
body.solicitante-portal .sol-hero__stat-val--ok { color: #15803d; }
body.solicitante-portal .sol-hero__stat-val--wait { color: #c2410c; }

body.solicitante-portal .sol-hero__stat-meta {
    font-size: 12px;
    color: var(--texto-suave);
    margin-top: 0.2rem;
    display: block;
}

/* Bento */
body.solicitante-portal .sol-bento {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}
@media (min-width: 768px) {
    body.solicitante-portal .sol-bento {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1100px) {
    body.solicitante-portal .sol-bento {
        grid-template-columns: 1.35fr repeat(2, 1fr);
        grid-template-rows: auto auto;
    }
    body.solicitante-portal .sol-tile--wide {
        grid-column: 1 / 2;
        grid-row: 1 / 3;
    }
    body.solicitante-portal .sol-tile--accent {
        grid-column: 2 / 4;
    }
}

body.solicitante-portal .sol-tile {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.07);
    background: #fff;
    padding: 1.15rem 1.2rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.05);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, border-color 0.2s ease;
}
body.solicitante-portal .sol-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.09);
    border-color: rgba(197, 32, 38, 0.18);
}

body.solicitante-portal .sol-tile__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rojo);
    background: linear-gradient(145deg, rgba(254, 242, 242, 0.95), #fff);
    border: 1px solid rgba(197, 32, 38, 0.12);
}
body.solicitante-portal .sol-tile__icon--light {
    color: #fff;
    background: linear-gradient(145deg, var(--rojo), #a01a1f);
    border-color: rgba(255, 255, 255, 0.2);
}

body.solicitante-portal .sol-tile--accent {
    background: linear-gradient(135deg, #fff5f5 0%, #fff 55%, #f7f0e3 100%);
}

body.solicitante-portal .sol-tile__title {
    margin: 0 0 0.35rem;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--texto-suave);
}

body.solicitante-portal .sol-tile__value {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--texto);
    line-height: 1.35;
}

body.solicitante-portal .sol-tile__hint {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--texto-suave);
}

/* Acciones */
body.solicitante-portal .sol-actions__heading {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.75rem;
    color: var(--texto);
}

body.solicitante-portal .sol-actions__grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}
@media (min-width: 900px) {
    body.solicitante-portal .sol-actions__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

body.solicitante-portal .sol-action-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem 1.2rem 1.1rem;
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(160deg, #ffffff 0%, #fafafa 100%);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, border-color 0.2s ease;
}
body.solicitante-portal .sol-action-card::after {
    content: '';
    position: absolute;
    inset: auto -30% -60% -30%;
    height: 120px;
    background: radial-gradient(circle at 50% 0%, rgba(197, 32, 38, 0.12), transparent 65%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
body.solicitante-portal .sol-action-card:hover {
    transform: translateY(-4px);
    border-color: rgba(197, 32, 38, 0.28);
    box-shadow: 0 22px 50px rgba(197, 32, 38, 0.12);
}
body.solicitante-portal .sol-action-card:hover::after {
    opacity: 1;
}

body.solicitante-portal .sol-action-card--ghost {
    background: rgba(255, 255, 255, 0.65);
}

body.solicitante-portal .sol-action-card__icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rojo);
    background: rgba(254, 242, 242, 0.95);
    border: 1px solid rgba(197, 32, 38, 0.14);
}

body.solicitante-portal .sol-action-card__title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
}

body.solicitante-portal .sol-action-card__desc {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--texto-suave);
    flex: 1;
}

body.solicitante-portal .sol-action-card__go {
    margin-top: 0.35rem;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--rojo);
}

/* Estado vacío + pie */
body.solicitante-portal .sol-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
    border-radius: 18px;
    border: 1px dashed rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.65);
}
body.solicitante-portal .sol-empty__icon {
    display: inline-flex;
    color: var(--rojo);
    opacity: 0.75;
    margin-bottom: 0.75rem;
}
body.solicitante-portal .sol-empty__title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
}
body.solicitante-portal .sol-empty__text {
    margin: 0 auto;
    max-width: 32rem;
    color: var(--texto-suave);
    font-size: 0.9375rem;
    line-height: 1.55;
}

body.solicitante-portal .sol-footnote {
    text-align: center;
    padding: 0.5rem 0 0.25rem;
}
body.solicitante-portal .sol-footnote p {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--texto-suave);
    opacity: 0.85;
}

/* Detalle / edición / documentos — tarjetas elevadas */
body.solicitante-portal .sol-portal-detalle .card,
body.solicitante-portal .sol-portal-edit .card,
body.solicitante-portal .sol-portal-docs .card,
body.solicitante-portal .sol-portal-vigencia .card,
body.solicitante-portal .sol-portal-card {
    border-radius: 16px;
    border-color: rgba(15, 23, 42, 0.07);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

body.solicitante-portal .sol-portal-detalle .card-header,
body.solicitante-portal .sol-portal-edit .card-header,
body.solicitante-portal .sol-portal-docs .card-header,
body.solicitante-portal .sol-portal-vigencia .card-header {
    border-bottom-color: rgba(15, 23, 42, 0.06);
}

body.solicitante-portal .sidebar-nav-block {
    margin-bottom: 0.15rem;
}

body.solicitante-portal .sidebar-nav-hint {
    margin: 0.15rem 0.65rem 0.65rem 2.15rem;
    padding: 0.5rem 0.6rem;
    font-size: 10.5px;
    line-height: 1.45;
    color: var(--texto-suave);
    border-left: 2px solid rgba(197, 32, 38, 0.35);
    background: rgba(255, 255, 255, 0.45);
    border-radius: 0 8px 8px 0;
}

body.solicitante-portal .sidebar-nav-hint strong {
    font-weight: 600;
    color: var(--texto);
}

body.solicitante-portal .sol-portal-intro__lead {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--texto-suave);
    max-width: 40rem;
}

body.solicitante-portal .sol-portal-meta dt {
    font-weight: 600;
}

body.solicitante-portal .btn-back {
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--texto);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

body.solicitante-portal .btn-back:hover,
body.solicitante-portal .btn-back:focus-visible {
    color: var(--rojo);
    border-color: rgba(197, 32, 38, 0.28);
    background: rgba(255, 255, 255, 0.95);
}

body.solicitante-portal .sol-portal-detalle .detalle-tabs {
    flex-wrap: nowrap;
    overflow: visible;
}

body.solicitante-portal .sol-portal-detalle .detalle-tabs .nav-item {
    flex-shrink: 0;
}

body.solicitante-portal .sol-portal-detalle .detalle-tabs .nav-link {
    white-space: nowrap;
    padding: 10px 11px;
    font-size: 0.875rem;
}

@media (max-width: 575.98px) {
    body.solicitante-portal .sol-portal-detalle .detalle-tabs {
        flex-wrap: wrap;
    }
}

body.solicitante-portal .sol-portal-detalle .detalle-tabs .nav-link.active,
body.solicitante-portal .sol-portal-edit .edit-tabs .nav-link.active {
    color: var(--rojo);
    border-bottom-width: 3px;
}

body.solicitante-portal .sol-portal-detalle .detalle-foto-wrap {
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

/* Modo oscuro portal solicitante */
[data-bs-theme="dark"] body.solicitante-portal {
    background:
        radial-gradient(900px 420px at 10% 0%, rgba(248, 113, 113, 0.12), transparent 55%),
        radial-gradient(700px 400px at 100% 0%, rgba(59, 130, 246, 0.08), transparent 45%),
        linear-gradient(180deg, #0b1220 0%, var(--fondo) 45%, #0f172a 100%);
}

[data-bs-theme="dark"] body.solicitante-portal .topbar {
    background: rgba(15, 23, 42, 0.82) !important;
    border-bottom-color: rgba(148, 163, 184, 0.12) !important;
}

[data-bs-theme="dark"] body.solicitante-portal .sidebar {
    background: linear-gradient(175deg, #0f172a 0%, #111827 50%, #0f172a 100%);
    border-right-color: rgba(148, 163, 184, 0.12);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] body.solicitante-portal .sol-hero--portal {
    background: linear-gradient(135deg, #111827 0%, #1e1b1b 42%, #1c1917 100%);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

[data-bs-theme="dark"] body.solicitante-portal .sol-hero__title,
[data-bs-theme="dark"] body.solicitante-portal .sol-actions__heading,
[data-bs-theme="dark"] body.solicitante-portal .sol-tile__value,
[data-bs-theme="dark"] body.solicitante-portal .sol-action-card__title {
    color: #f8fafc;
}

[data-bs-theme="dark"] body.solicitante-portal .sol-hero__name {
    background: linear-gradient(115deg, #fecaca, #f87171 50%, #fb923c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-bs-theme="dark"] body.solicitante-portal .sol-hero__ecg {
    color: rgba(248, 113, 113, 0.35);
}

[data-bs-theme="dark"] body.solicitante-portal .sol-hero__aside,
[data-bs-theme="dark"] body.solicitante-portal .sol-tile,
[data-bs-theme="dark"] body.solicitante-portal .sol-action-card {
    background: rgba(30, 41, 59, 0.55);
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] body.solicitante-portal .sol-action-card--ghost {
    background: rgba(15, 23, 42, 0.45);
}

[data-bs-theme="dark"] body.solicitante-portal .sol-tile--accent {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.35) 0%, rgba(30, 41, 59, 0.75) 100%);
}

[data-bs-theme="dark"] body.solicitante-portal .sol-portal-detalle .card,
[data-bs-theme="dark"] body.solicitante-portal .sol-portal-edit .card,
[data-bs-theme="dark"] body.solicitante-portal .sol-portal-docs .card,
[data-bs-theme="dark"] body.solicitante-portal .sol-portal-vigencia .card,
[data-bs-theme="dark"] body.solicitante-portal .sol-portal-card {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] body.solicitante-portal .btn-back {
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(148, 163, 184, 0.2);
}

[data-bs-theme="dark"] body.solicitante-portal .btn-back:hover,
[data-bs-theme="dark"] body.solicitante-portal .btn-back:focus-visible {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(30, 41, 59, 0.9);
}

[data-bs-theme="dark"] body.solicitante-portal .sol-portal-intro__lead {
    color: #94a3b8;
}

[data-bs-theme="dark"] body.solicitante-portal .sidebar-nav-hint {
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.45);
    border-left-color: rgba(248, 113, 113, 0.45);
}

[data-bs-theme="dark"] body.solicitante-portal .sidebar-nav-hint strong {
    color: #e2e8f0;
}

@media (prefers-reduced-motion: reduce) {
    body.solicitante-portal .sol-hero__ecg-path {
        animation: none;
        stroke-dashoffset: 0;
    }
    body.solicitante-portal .sol-hero__pulse {
        animation: none;
    }
    body.solicitante-portal .sol-tile:hover,
    body.solicitante-portal .sol-action-card:hover {
        transform: none;
    }
}

/* ─── Indicador global de mantenimiento (topbar) ─── */
.smc-mant-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    max-width: min(100%, 280px);
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;
}

.smc-mant-indicator-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.smc-mant-indicator-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.smc-mant-indicator-meta {
    font-weight: 500;
    opacity: 0.9;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smc-mant-indicator--ok {
    color: #166534;
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.35);
}

.smc-mant-indicator--ok .smc-mant-indicator-dot {
    background: #22c55e;
}

.smc-mant-indicator--activo {
    color: #9a3412;
    background: rgba(249, 115, 22, 0.16);
    border-color: rgba(249, 115, 22, 0.45);
}

.smc-mant-indicator--activo .smc-mant-indicator-dot {
    background: #ea580c;
    animation: smc-mant-dot-pulse 1.4s ease-in-out infinite;
}

@keyframes smc-mant-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

body.smc-mant-global-activo .topbar {
    box-shadow: inset 0 3px 0 0 #ea580c;
}

[data-bs-theme="dark"] .smc-mant-indicator--ok {
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(74, 222, 128, 0.35);
}

[data-bs-theme="dark"] .smc-mant-indicator--activo {
    color: #fdba74;
    background: rgba(249, 115, 22, 0.14);
    border-color: rgba(251, 146, 60, 0.4);
}

@media (max-width: 575.98px) {
    .smc-mant-indicator {
        max-width: 120px;
        padding: 0.22rem 0.5rem;
        font-size: 0.62rem;
    }
    .topbar .h5 {
        font-size: 0.95rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .smc-mant-indicator--activo .smc-mant-indicator-dot {
        animation: none;
    }
}

/* ─── Modal cambio de membresía — tarjetas de opción ─── */
.cambio-membresia-opciones {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: 1fr;
}

@media (min-width: 520px) {
    .cambio-membresia-opciones {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 419.98px) {
    .cambio-membresia-card {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        padding-right: 2.5rem;
    }

    .cambio-membresia-card__price {
        grid-row: 2;
        grid-column: 2;
        flex-direction: row;
        align-items: center;
        gap: 0.35rem;
        justify-self: start;
        margin-top: 0.35rem;
    }

    .cambio-membresia-card__arrow {
        grid-row: 1 / 3;
        grid-column: 3;
        position: absolute;
        right: 0.85rem;
        top: 50%;
        margin-top: -9px;
    }

    .cambio-membresia-card__spinner {
        right: 0.85rem;
    }
}

.cambio-membresia-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0 0.85rem;
    width: 100%;
    padding: 1rem 1rem 1rem 1.15rem;
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 16px;
    background: linear-gradient(155deg, #ffffff 0%, #fafafa 100%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition:
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.22s ease,
        border-color 0.2s ease;
}

.cambio-membresia-card::before {
    content: '';
    position: absolute;
    inset: auto -20% -50% -20%;
    height: 90px;
    background: radial-gradient(circle at 50% 0%, var(--cm-card-glow, rgba(197, 32, 38, 0.1)), transparent 68%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.cambio-membresia-card:hover {
    transform: translateY(-3px);
    border-color: var(--cm-card-border-hover, rgba(197, 32, 38, 0.28));
    box-shadow: 0 18px 40px var(--cm-card-shadow-hover, rgba(197, 32, 38, 0.12));
}

.cambio-membresia-card:hover::before {
    opacity: 1;
}

.cambio-membresia-card:focus-visible {
    outline: 2px solid var(--cm-card-accent, var(--rojo));
    outline-offset: 2px;
}

.cambio-membresia-card:disabled {
    cursor: wait;
    opacity: 0.72;
}

.cambio-membresia-card.is-loading .cambio-membresia-card__arrow,
.cambio-membresia-card.is-loading .cambio-membresia-card__price {
    opacity: 0;
}

.cambio-membresia-card.is-loading .cambio-membresia-card__spinner {
    opacity: 1;
}

.cambio-membresia-card__accent {
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--cm-card-accent, var(--rojo));
}

.cambio-membresia-card__icon {
    grid-row: 1 / 3;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cm-card-accent, var(--rojo));
    background: var(--cm-card-icon-bg, rgba(254, 242, 242, 0.95));
    border: 1px solid var(--cm-card-icon-border, rgba(197, 32, 38, 0.14));
    flex-shrink: 0;
    transition: transform 0.22s ease;
}

.cambio-membresia-card:hover .cambio-membresia-card__icon {
    transform: scale(1.06);
}

.cambio-membresia-card__body {
    grid-column: 2;
    min-width: 0;
}

.cambio-membresia-card__title {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--texto);
}

.cambio-membresia-card__sub {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--texto-suave);
}

.cambio-membresia-card__price {
    grid-row: 1 / 3;
    grid-column: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
    padding: 0.35rem 0.55rem;
    border-radius: 10px;
    background: var(--cm-card-price-bg, rgba(254, 242, 242, 0.7));
    border: 1px solid var(--cm-card-price-border, rgba(197, 32, 38, 0.12));
    transition: opacity 0.15s ease;
}

.cambio-membresia-card__amount {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--cm-card-accent, var(--rojo));
    line-height: 1;
}

.cambio-membresia-card__amount--gratis {
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.cambio-membresia-card__price-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--texto-suave);
    opacity: 0.8;
}

.cambio-membresia-card__arrow {
    grid-row: 1 / 3;
    grid-column: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cm-card-accent, var(--rojo));
    opacity: 0.45;
    transform: translateX(-4px);
    transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.cambio-membresia-card:hover .cambio-membresia-card__arrow {
    opacity: 1;
    transform: translateX(0);
}

.cambio-membresia-card__spinner {
    position: absolute;
    right: 1rem;
    top: 50%;
    width: 22px;
    height: 22px;
    margin-top: -11px;
    border: 2px solid var(--cm-card-accent, var(--rojo));
    border-top-color: transparent;
    border-radius: 50%;
    opacity: 0;
    animation: cambio-membresia-spin 0.7s linear infinite;
    pointer-events: none;
}

@keyframes cambio-membresia-spin {
    to { transform: rotate(360deg); }
}

/* Afiliado — azul profesional */
.cambio-membresia-card--ma {
    --cm-card-accent: #2563eb;
    --cm-card-icon-bg: rgba(239, 246, 255, 0.95);
    --cm-card-icon-border: rgba(37, 99, 235, 0.18);
    --cm-card-price-bg: rgba(239, 246, 255, 0.75);
    --cm-card-price-border: rgba(37, 99, 235, 0.14);
    --cm-card-glow: rgba(37, 99, 235, 0.12);
    --cm-card-border-hover: rgba(37, 99, 235, 0.32);
    --cm-card-shadow-hover: rgba(37, 99, 235, 0.14);
}

/* Titular — dorado premium */
.cambio-membresia-card--mt {
    --cm-card-accent: #b45309;
    --cm-card-icon-bg: rgba(255, 251, 235, 0.95);
    --cm-card-icon-border: rgba(180, 83, 9, 0.2);
    --cm-card-price-bg: rgba(255, 251, 235, 0.8);
    --cm-card-price-border: rgba(180, 83, 9, 0.16);
    --cm-card-glow: rgba(217, 119, 6, 0.14);
    --cm-card-border-hover: rgba(180, 83, 9, 0.35);
    --cm-card-shadow-hover: rgba(217, 119, 6, 0.16);
}

/* Titular Vitalicio — púrpura distintivo */
.cambio-membresia-card--mtv {
    --cm-card-accent: #7c3aed;
    --cm-card-icon-bg: rgba(245, 243, 255, 0.95);
    --cm-card-icon-border: rgba(124, 58, 237, 0.18);
    --cm-card-price-bg: rgba(245, 243, 255, 0.8);
    --cm-card-price-border: rgba(124, 58, 237, 0.14);
    --cm-card-glow: rgba(124, 58, 237, 0.12);
    --cm-card-border-hover: rgba(124, 58, 237, 0.32);
    --cm-card-shadow-hover: rgba(124, 58, 237, 0.14);
}

/* Opción sin costo — verde */
.cambio-membresia-card--gratis {
    --cm-card-accent: #15803d;
    --cm-card-icon-bg: rgba(240, 253, 244, 0.95);
    --cm-card-icon-border: rgba(21, 128, 61, 0.18);
    --cm-card-price-bg: rgba(220, 252, 231, 0.85);
    --cm-card-price-border: rgba(21, 128, 61, 0.16);
    --cm-card-glow: rgba(21, 128, 61, 0.1);
    --cm-card-border-hover: rgba(21, 128, 61, 0.3);
    --cm-card-shadow-hover: rgba(21, 128, 61, 0.12);
}

[data-bs-theme="dark"] .cambio-membresia-card {
    background: linear-gradient(155deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.85) 100%);
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .cambio-membresia-card--ma {
    --cm-card-icon-bg: rgba(30, 58, 138, 0.35);
    --cm-card-icon-border: rgba(96, 165, 250, 0.25);
    --cm-card-price-bg: rgba(30, 58, 138, 0.3);
    --cm-card-price-border: rgba(96, 165, 250, 0.2);
}

[data-bs-theme="dark"] .cambio-membresia-card--mt {
    --cm-card-icon-bg: rgba(120, 53, 15, 0.35);
    --cm-card-icon-border: rgba(251, 191, 36, 0.25);
    --cm-card-price-bg: rgba(120, 53, 15, 0.3);
    --cm-card-price-border: rgba(251, 191, 36, 0.2);
}

[data-bs-theme="dark"] .cambio-membresia-card--mtv {
    --cm-card-icon-bg: rgba(76, 29, 149, 0.35);
    --cm-card-icon-border: rgba(167, 139, 250, 0.25);
    --cm-card-price-bg: rgba(76, 29, 149, 0.3);
    --cm-card-price-border: rgba(167, 139, 250, 0.2);
}

[data-bs-theme="dark"] .cambio-membresia-card--gratis {
    --cm-card-icon-bg: rgba(20, 83, 45, 0.35);
    --cm-card-icon-border: rgba(74, 222, 128, 0.25);
    --cm-card-price-bg: rgba(20, 83, 45, 0.3);
    --cm-card-price-border: rgba(74, 222, 128, 0.2);
}

[data-bs-theme="dark"] .cambio-membresia-card__title {
    color: #f1f5f9;
}

@media (prefers-reduced-motion: reduce) {
    .cambio-membresia-card,
    .cambio-membresia-card__icon,
    .cambio-membresia-card__arrow {
        transition: none;
    }
    .cambio-membresia-card:hover {
        transform: none;
    }
    .cambio-membresia-card__spinner {
        animation: none;
    }
}
