/* CrediFast Admin Panel — brand v4 */

:root {
    --cf-primary: #00C896;
    --cf-primary-dim: rgba(0, 200, 150, 0.12);
    --cf-bg-deep: #05080f;
    --cf-bg-panel: #0A1628;
    --cf-bg-elevated: #111f35;
    --cf-border: rgba(255, 255, 255, 0.06);
    --cf-font: "Plus Jakarta Sans", system-ui, sans-serif;
    --cf-display: Poppins, "Plus Jakarta Sans", sans-serif;
}

/* Base typography */
.fi-panel-admin,
.fi-panel-admin .fi-body {
    font-family: var(--cf-font) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.fi-body.fi-panel-admin:not(.fi-simple-layout) {
    background: var(--cf-bg-deep) !important;
}

/* Ambient mesh behind content */
.fi-panel-admin .fi-main-ctn {
    position: relative;
}

.fi-panel-admin .fi-main-ctn::before {
    content: "";
    position: fixed;
    inset: 0;
    left: 17rem;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 55% 45% at 85% 8%, rgba(0, 200, 150, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse 40% 35% at 15% 75%, rgba(26, 140, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse 30% 25% at 60% 50%, rgba(0, 200, 150, 0.03) 0%, transparent 45%);
}

.fi-panel-admin .fi-main {
    position: relative;
    z-index: 1;
}

/* Sidebar */
.fi-panel-admin .fi-sidebar {
    background: linear-gradient(180deg, #0c1a30 0%, #071018 55%, #050a12 100%) !important;
    border-right: 1px solid rgba(0, 200, 150, 0.1) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
}

.fi-panel-admin .fi-sidebar-header {
    padding: 1.15rem 1rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.fi-panel-admin .fi-sidebar-header .fi-logo {
    gap: 0.55rem !important;
}

.fi-panel-admin .fi-sidebar-header .fi-logo img {
    filter: drop-shadow(0 2px 10px rgba(0, 200, 150, 0.35));
}

.fi-panel-admin .fi-logo {
    font-family: var(--cf-display) !important;
    font-weight: 700 !important;
    font-size: 1.05rem !important;
    letter-spacing: -0.03em;
}

.fi-panel-admin .fi-logo span {
    background: linear-gradient(90deg, #e8fff8 0%, var(--cf-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Nav groups */
.fi-panel-admin .fi-sidebar-group-label {
    font-family: var(--cf-font) !important;
    font-size: 0.62rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    color: rgba(0, 200, 150, 0.55) !important;
    padding-left: 0.15rem !important;
}

.fi-panel-admin .fi-sidebar-item-button {
    border-radius: 10px !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.fi-panel-admin .fi-sidebar-item-active > .fi-sidebar-item-button {
    background: linear-gradient(90deg, rgba(0, 200, 150, 0.18) 0%, rgba(0, 200, 150, 0.06) 100%) !important;
    color: var(--cf-primary) !important;
    box-shadow: inset 3px 0 0 var(--cf-primary);
}

.fi-panel-admin .fi-sidebar-item-button:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.fi-panel-admin .fi-sidebar-item-icon {
    color: rgba(255, 255, 255, 0.45) !important;
}

.fi-panel-admin .fi-sidebar-item-active .fi-sidebar-item-icon {
    color: var(--cf-primary) !important;
}

/* Sidebar footer */
.cf-sidebar-footer {
    padding: 0.85rem 1rem 1rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cf-sidebar-footer__tagline {
    font-family: var(--cf-display);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--cf-primary);
    margin: 0 0 0.2rem;
    opacity: 0.85;
}

.cf-sidebar-footer__meta {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    margin: 0;
}

/* Topbar */
.fi-panel-admin .fi-topbar {
    background: rgba(8, 16, 28, 0.88) !important;
    backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid rgba(0, 200, 150, 0.08) !important;
}

.fi-panel-admin .fi-topbar .fi-user-menu-trigger {
    border: 1px solid rgba(0, 200, 150, 0.2) !important;
    box-shadow: 0 0 0 2px rgba(0, 200, 150, 0.06);
}

/* Page headers */
.fi-panel-admin .fi-header-heading,
.fi-panel-admin .fi-page-header-heading {
    font-family: var(--cf-display) !important;
    font-weight: 700 !important;
    font-size: 1.65rem !important;
    letter-spacing: -0.03em !important;
    color: #f8fafc !important;
}

.fi-panel-admin .fi-header-subheading,
.fi-panel-admin .fi-page-header-subheading {
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.45) !important;
}

/* Acciones del header: el contenedor (div con shrink-0) no encoge ni envuelve,
   así que el último botón se recorta cuando hay muchos (p. ej. credit-requests/{id}).
   Dejamos que el wrapper encoja y que su .fi-ac interno envuelva a 2ª fila. */
.fi-panel-admin .fi-header > div:last-child {
    flex-shrink: 1;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.fi-panel-admin .fi-header .fi-ac {
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 0.5rem;
}

/* Sections & cards */
.fi-panel-admin .fi-section,
.fi-panel-admin .fi-ta-ctn {
    background: linear-gradient(155deg, rgba(17, 31, 53, 0.65) 0%, rgba(10, 22, 40, 0.9) 100%) !important;
    border: 1px solid var(--cf-border) !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22) !important;
}

.fi-panel-admin .fi-section-header-heading {
    font-family: var(--cf-display) !important;
    font-weight: 600 !important;
    letter-spacing: -0.02em;
    color: #f8fafc !important;
}

/* Legibilidad — Filament v4 (fi-in-*, fi-fo-*) siempre sobre fondo oscuro */
body.fi-panel-admin:not(.fi-simple-layout) {
    color: #f1f5f9;
}

.fi-panel-admin:not(.fi-simple-layout) .text-gray-950,
.fi-panel-admin:not(.fi-simple-layout) .text-gray-900,
.fi-panel-admin:not(.fi-simple-layout) .text-gray-800 {
    color: #f1f5f9 !important;
}

.fi-panel-admin:not(.fi-simple-layout) .text-gray-700,
.fi-panel-admin:not(.fi-simple-layout) .text-gray-600 {
    color: rgba(255, 255, 255, 0.78) !important;
}

.fi-panel-admin:not(.fi-simple-layout) .text-gray-500,
.fi-panel-admin:not(.fi-simple-layout) .text-gray-400 {
    color: rgba(255, 255, 255, 0.52) !important;
}

.fi-panel-admin .fi-in-entry-wrp-label span,
.fi-panel-admin .fi-fo-field-wrp-label span {
    color: rgba(255, 255, 255, 0.72) !important;
}

.fi-panel-admin .fi-in-entry-wrp-helper-text,
.fi-panel-admin .fi-fo-field-wrp-helper-text,
.fi-panel-admin .fi-section-header-description {
    color: rgba(255, 255, 255, 0.5) !important;
}

.fi-panel-admin .fi-in-text,
.fi-panel-admin .fi-in-text-item,
.fi-panel-admin .fi-in-entry-wrp dd,
.fi-panel-admin .fi-fo-field-wrp .fi-input-wrp input,
.fi-panel-admin .fi-fo-field-wrp .fi-input-wrp textarea,
.fi-panel-admin .fi-fo-field-wrp .fi-input-wrp select,
.fi-panel-admin .fi-fo-field-wrp .fi-select-input,
.fi-panel-admin .fi-ta-text,
.fi-panel-admin .fi-ta-text-item,
.fi-panel-admin .fi-ta-cell,
.fi-panel-admin .fi-section-content {
    color: #f1f5f9 !important;
}

.fi-panel-admin .fi-fo-field-wrp .fi-input-wrp {
    background: rgba(0, 0, 0, 0.28) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Línea de tiempo del crédito */
.cf-journey-timeline {
    position: relative;
    background: linear-gradient(155deg, rgba(17, 31, 53, 0.85) 0%, rgba(10, 22, 40, 0.97) 100%);
    border: 1px solid rgba(0, 200, 150, 0.18);
    border-radius: 16px;
    color: #e2e8f0;
    overflow: hidden;
    box-shadow: 0 18px 40px -22px rgba(0, 200, 150, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
}

.cf-journey-timeline::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, #00a87a, var(--cf-primary), rgba(0, 200, 150, 0.15));
}

.cf-jt-inner {
    padding: 1.25rem 1.4rem;
}

.cf-jt-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.cf-jt-title {
    font-family: var(--cf-display);
    font-size: 1rem;
    font-weight: 600;
    color: #f8fafc;
    margin: 0;
}

.cf-jt-progress {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cf-primary);
}

.cf-jt-headline {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
}

.cf-jt-summary {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0.2rem 0 0;
}

.cf-jt-bar {
    margin-top: 1rem;
    height: 0.5rem;
    width: 100%;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.cf-jt-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #00a87a, var(--cf-primary));
    transition: width 0.4s ease;
}

.cf-jt-payment {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
}

.cf-jt-payment strong {
    color: #f8fafc;
}

.cf-jt-stages-wrap {
    margin-top: 1.25rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
}

.cf-jt-stages {
    display: flex;
    min-width: max-content;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.cf-jt-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 7.5rem;
}

.cf-jt-stage-row {
    display: flex;
    width: 100%;
    align-items: center;
}

.cf-jt-line {
    height: 2px;
    flex: 1;
}

.cf-jt-line--done {
    background: var(--cf-primary);
}

.cf-jt-line--pending {
    background: rgba(255, 255, 255, 0.12);
}

.cf-jt-line-spacer {
    flex: 1;
}

.cf-jt-dot {
    display: flex;
    height: 2rem;
    width: 2rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.cf-jt-stage--completed .cf-jt-dot {
    background: var(--cf-primary);
    color: #041018;
    border-color: var(--cf-primary);
}

.cf-jt-stage--current .cf-jt-dot {
    background: rgba(0, 200, 150, 0.15);
    color: var(--cf-primary);
    border: 2px solid var(--cf-primary);
    box-shadow: 0 0 12px rgba(0, 200, 150, 0.35);
}

.cf-jt-stage--failed .cf-jt-dot {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

.cf-jt-stage--pending .cf-jt-dot,
.cf-jt-stage--upcoming .cf-jt-dot {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.12);
}

.cf-jt-stage-label {
    margin: 0.5rem 0 0;
    padding: 0 0.25rem;
    text-align: center;
    font-size: 0.62rem;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.45);
}

.cf-jt-stage--current .cf-jt-stage-label {
    font-weight: 600;
    color: var(--cf-primary);
}

.cf-jt-stage--completed .cf-jt-stage-label {
    color: rgba(255, 255, 255, 0.72);
}

.cf-jt-stage--failed .cf-jt-stage-label {
    font-weight: 600;
    color: #f87171;
}

.cf-jt-stage-detail {
    margin: 0.2rem 0 0;
    padding: 0 0.25rem;
    text-align: center;
    font-size: 0.58rem;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.5);
}

.cf-jt-details {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.cf-jt-details summary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    list-style: none;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.cf-jt-details summary::-webkit-details-marker {
    display: none;
}

.cf-jt-details summary::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.cf-jt-details[open] summary::before {
    transform: rotate(-135deg);
}

.cf-jt-details summary:hover {
    color: var(--cf-primary);
    border-color: rgba(0, 200, 150, 0.4);
    background: rgba(0, 200, 150, 0.08);
}

.cf-jt-details-list {
    margin: 0.75rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cf-jt-details-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.15rem;
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .cf-jt-details-row {
        grid-template-columns: 3fr 9fr;
    }
}

.cf-jt-details-row dt {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
}

.cf-jt-details-row dd {
    margin: 0;
    color: rgba(255, 255, 255, 0.55);
}

.cf-jt-details-actor {
    color: rgba(255, 255, 255, 0.38);
}

/* ── Línea de tiempo dinámica del crédito (rediseño) ── */
.cf-journey {
    position: relative;
    overflow: hidden;
    padding: 1.4rem 1.5rem 1.25rem;
    border-radius: 18px;
    color: #e2e8f0;
    background: linear-gradient(155deg, rgba(17, 31, 53, 0.9) 0%, rgba(9, 20, 37, 0.98) 100%);
    border: 1px solid rgba(0, 200, 150, 0.18);
    box-shadow: 0 20px 46px -24px rgba(0, 200, 150, 0.5), 0 3px 10px rgba(0, 0, 0, 0.3);
}

.cf-journey::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, #00a87a, #00e0a4, rgba(0, 200, 150, 0.12));
}

.cf-journey.is-failed {
    border-color: rgba(239, 68, 68, 0.35);
}

.cf-journey.is-failed::before {
    background: linear-gradient(90deg, #ef4444, #f87171, rgba(239, 68, 68, 0.1));
}

.cf-journey__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.cf-journey__meta {
    min-width: 0;
}

.cf-journey__eyebrow {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--cf-primary, #00C896);
    margin-bottom: 0.35rem;
}

.cf-journey.is-failed .cf-journey__eyebrow {
    color: #f87171;
}

.cf-journey__title {
    font-family: var(--cf-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
    line-height: 1.15;
}

.cf-journey__desc {
    margin: 0.3rem 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Anillo de avance */
.cf-journey__ring {
    --size: 96px;
    position: relative;
    flex-shrink: 0;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(from -90deg,
        #00e0a4 0%,
        var(--cf-primary, #00C896) calc(var(--cf-pct, 0) * 1%),
        rgba(255, 255, 255, 0.07) calc(var(--cf-pct, 0) * 1%) 100%);
    box-shadow: 0 0 0 1px rgba(0, 200, 150, 0.15), 0 0 26px -6px rgba(0, 200, 150, 0.55);
}

.cf-journey.is-failed .cf-journey__ring {
    background: conic-gradient(from -90deg,
        #f87171 0%,
        #ef4444 calc(var(--cf-pct, 0) * 1%),
        rgba(255, 255, 255, 0.07) calc(var(--cf-pct, 0) * 1%) 100%);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2), 0 0 26px -6px rgba(239, 68, 68, 0.55);
}

.cf-journey__ring-hole {
    width: calc(var(--size) - 16px);
    height: calc(var(--size) - 16px);
    border-radius: 50%;
    background: radial-gradient(circle at 50% 32%, #16263f, #0a1628);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cf-journey__ring-val {
    font-family: var(--cf-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1;
}

.cf-journey__ring-val small {
    font-size: 0.8rem;
    opacity: 0.7;
}

.cf-journey__ring-cap {
    margin-top: 0.15rem;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.45);
}

/* Pagos (etapa cobranza) */
.cf-journey__pay {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.9rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
}

.cf-journey__pay strong {
    color: #f8fafc;
}

/* Flujo dinámico (ventana de etapas) */
.cf-journey__flow {
    display: flex;
    align-items: flex-start;
    gap: 0.15rem;
    margin-top: 1.4rem;
}

.cf-journey__link {
    flex: 1 1 auto;
    min-width: 1rem;
    height: 3px;
    margin-top: 1.2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.cf-journey__link--done {
    background: linear-gradient(90deg, #00a87a, #00e0a4);
}

.cf-journey__link--now {
    background: linear-gradient(90deg, #00e0a4, rgba(0, 200, 150, 0.15));
}

.cf-journey__link--now::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    animation: cf-shimmer 1.6s linear infinite;
}

.cf-journey__node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
    width: 4.6rem;
}

.cf-journey__dot {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.82rem;
    border: 1.5px solid transparent;
    transition: all 0.3s ease;
}

.cf-journey__label {
    font-size: 0.68rem;
    line-height: 1.2;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.cf-journey__node.is-completed .cf-journey__dot {
    background: linear-gradient(145deg, #00e0a4, #00a87a);
    color: #04231a;
    box-shadow: 0 4px 14px -4px rgba(0, 200, 150, 0.6);
}

.cf-journey__node.is-completed .cf-journey__label {
    color: rgba(255, 255, 255, 0.72);
}

.cf-journey__node.is-focus .cf-journey__dot {
    width: 3rem;
    height: 3rem;
    font-size: 1rem;
    background: radial-gradient(circle at 50% 30%, rgba(0, 224, 164, 0.35), rgba(0, 200, 150, 0.12));
    border: 2px solid var(--cf-primary, #00C896);
    color: #00e0a4;
    animation: cf-pulse 2s ease-in-out infinite;
}

.cf-journey__node.is-focus .cf-journey__label {
    color: var(--cf-primary, #00C896);
    font-weight: 700;
}

.cf-journey__node.is-pending .cf-journey__dot,
.cf-journey__node.is-upcoming .cf-journey__dot {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.12);
}

.cf-journey__node.is-failed .cf-journey__dot {
    width: 3rem;
    height: 3rem;
    background: #ef4444;
    color: #fff;
    box-shadow: 0 0 18px -2px rgba(239, 68, 68, 0.7);
}

.cf-journey__node.is-failed .cf-journey__label {
    color: #f87171;
    font-weight: 700;
}

.cf-journey__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    flex: 0 0 auto;
}

.cf-journey__chip--done {
    background: rgba(0, 200, 150, 0.14);
    color: #00e0a4;
    border-color: rgba(0, 200, 150, 0.3);
}

.cf-journey__chip-ic {
    font-size: 0.7rem;
}

/* Desplegable de detalle */
.cf-journey__more {
    margin-top: 1.25rem;
}

.cf-journey__more summary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    list-style: none;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.cf-journey__more summary::-webkit-details-marker {
    display: none;
}

.cf-journey__more summary::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.cf-journey__more[open] summary::before {
    transform: rotate(-135deg);
}

.cf-journey__more summary:hover {
    color: var(--cf-primary, #00C896);
    border-color: rgba(0, 200, 150, 0.4);
    background: rgba(0, 200, 150, 0.08);
}

.cf-journey__list {
    margin: 0.9rem 0 0;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.cf-journey__list-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.1rem;
    padding-left: 0.85rem;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.cf-journey__list-row.is-completed {
    border-left-color: #00a87a;
}

.cf-journey__list-row.is-current {
    border-left-color: var(--cf-primary, #00C896);
}

.cf-journey__list-row.is-failed {
    border-left-color: #ef4444;
}

@media (min-width: 640px) {
    .cf-journey__list-row {
        grid-template-columns: 3fr 9fr;
        gap: 0.75rem;
    }
}

.cf-journey__list-row dt {
    font-weight: 600;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
}

.cf-journey__list-row dd {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

.cf-journey__actor {
    color: rgba(255, 255, 255, 0.38);
}

@keyframes cf-pulse {
    0%, 100% {
        box-shadow: 0 0 0 6px rgba(0, 200, 150, 0.1), 0 0 22px -2px rgba(0, 200, 150, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 200, 150, 0.04), 0 0 32px 0 rgba(0, 200, 150, 0.85);
    }
}

@keyframes cf-shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

@media (max-width: 640px) {
    .cf-journey__head {
        flex-direction: column-reverse;
        align-items: flex-start;
    }
    .cf-journey__flow {
        overflow-x: auto;
        padding-bottom: 0.35rem;
    }
}

/* ── Línea de proceso en la franja superior (topbar) ── */
.cf-process-stepper {
    width: 100%;
    margin-bottom: 1rem;
}

.cf-process-stepper .cf-topline {
    padding: 0.65rem 1rem;
    border-radius: 14px;
    background: linear-gradient(155deg, rgba(17, 31, 53, 0.9) 0%, rgba(9, 20, 37, 0.98) 100%);
    border: 1px solid rgba(0, 200, 150, 0.18);
    box-shadow: 0 12px 32px -18px rgba(0, 200, 150, 0.35);
}

.cf-topline {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0 1.25rem;
}

.cf-topline__meta {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
    position: relative;
}

.cf-topline__pct {
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    color: var(--cf-primary, #00C896);
}

.cf-topline__more {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.cf-topline__chev {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    cursor: pointer;
    list-style: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.cf-topline__chev::-webkit-details-marker {
    display: none;
}

.cf-topline__chev::before {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    border-right: 2px solid rgba(255, 255, 255, 0.7);
    border-bottom: 2px solid rgba(255, 255, 255, 0.7);
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
}

.cf-topline__more[open] .cf-topline__chev::before {
    transform: translateY(1px) rotate(-135deg);
}

.cf-topline__chev:hover,
.cf-topline__more[open] .cf-topline__chev {
    border-color: rgba(0, 200, 150, 0.45);
    background: rgba(0, 200, 150, 0.12);
}

.cf-topline__chev:hover::before,
.cf-topline__more[open] .cf-topline__chev::before {
    border-color: #00e0a4;
}

.cf-topline__panel {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    z-index: 50;
    width: 22rem;
    min-width: 20rem;
    max-width: 25rem;
    max-height: min(28rem, 70vh);
    overflow-y: auto;
    padding: 0.95rem 1.05rem;
    border-radius: 14px;
    background: linear-gradient(155deg, rgba(17, 31, 53, 0.98), rgba(9, 20, 37, 0.99));
    border: 1px solid rgba(0, 200, 150, 0.22);
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.65);
}

/* Evitar que el topbar recorte el panel anclado a la flechita */
.fi-panel-admin .fi-topbar:has(.cf-topline__more[open]) {
    overflow: visible;
}

.fi-panel-admin .fi-topbar:has(.cf-topline__more[open]) > nav {
    overflow: visible;
}

.cf-topline__list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.cf-topline__list-row {
    padding-left: 0.7rem;
    border-left: 2px solid rgba(255, 255, 255, 0.12);
}

.cf-topline__list-row.is-completed {
    border-left-color: #00a87a;
}

.cf-topline__list-row.is-current {
    border-left-color: var(--cf-primary, #00C896);
}

.cf-topline__list-row.is-failed {
    border-left-color: #ef4444;
}

.cf-topline__list-row dt {
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.cf-topline__list-row dd {
    margin: 0;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
}

.cf-topline__actor {
    color: rgba(255, 255, 255, 0.4);
}

.cf-topline__steps {
    display: flex;
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cf-topline__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
}

.cf-topline__row {
    display: flex;
    width: 100%;
    align-items: center;
}

.cf-topline__line {
    height: 2px;
    flex: 1;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.cf-topline__line.is-done {
    background: linear-gradient(90deg, #00a87a, #00e0a4);
}

.cf-topline__spacer {
    flex: 1;
}

.cf-topline__dot {
    flex-shrink: 0;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.62rem;
    font-weight: 700;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.cf-topline__label {
    margin-top: 0.18rem;
    max-width: 100%;
    font-size: 0.58rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-topline__step.is-completed .cf-topline__dot {
    background: linear-gradient(145deg, #00e0a4, #00a87a);
    color: #04231a;
    border-color: transparent;
    box-shadow: 0 3px 10px -3px rgba(0, 200, 150, 0.6);
}

.cf-topline__step.is-completed .cf-topline__label {
    color: rgba(255, 255, 255, 0.7);
}

.cf-topline__step.is-focus .cf-topline__dot {
    background: radial-gradient(circle at 50% 30%, rgba(0, 224, 164, 0.4), rgba(0, 200, 150, 0.12));
    border: 2px solid var(--cf-primary, #00C896);
    color: #00e0a4;
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.12), 0 0 12px -1px rgba(0, 200, 150, 0.7);
    animation: cf-pulse-dot 2s ease-in-out infinite;
}

.cf-topline__step.is-focus .cf-topline__label {
    color: var(--cf-primary, #00C896);
    font-weight: 700;
}

.cf-topline__step.is-failed .cf-topline__dot {
    background: #ef4444;
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 14px -2px rgba(239, 68, 68, 0.7);
}

.cf-topline__step.is-failed .cf-topline__label {
    color: #f87171;
    font-weight: 700;
}

@keyframes cf-pulse-dot {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.12), 0 0 12px -1px rgba(0, 200, 150, 0.6);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(0, 200, 150, 0.06), 0 0 18px 0 rgba(0, 200, 150, 0.85);
    }
}

/* Wizard originación: pasos debajo del stepper macro, sin scroll horizontal */
.fi-panel-admin .fi-fo-wizard-header {
    overflow-x: visible;
}

.fi-panel-admin .fi-fo-wizard-header-step-buttons {
    flex-wrap: wrap;
    row-gap: 0.35rem;
}

/* Stat cards — KPI */
.fi-panel-admin .fi-wi-stats-overview-stat {
    background: linear-gradient(145deg, rgba(22, 38, 62, 0.7) 0%, rgba(10, 22, 40, 0.92) 100%) !important;
    border: 1px solid var(--cf-border) !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28) !important;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    position: relative;
}

.fi-panel-admin .fi-wi-stats-overview-stat::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 5rem;
    height: 5rem;
    background: radial-gradient(circle at 100% 0%, rgba(0, 200, 150, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.fi-panel-admin .fi-wi-stats-overview-stat:hover {
    border-color: rgba(0, 200, 150, 0.22) !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 200, 150, 0.08) !important;
}

.fi-panel-admin .fi-wi-stats-overview-stat-label {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.55) !important;
    letter-spacing: 0.01em;
}

.fi-panel-admin .fi-wi-stats-overview-stat-value {
    font-family: var(--cf-display) !important;
    font-weight: 700 !important;
    font-size: 1.65rem !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    color: #f1f5f9 !important;
}

.fi-panel-admin .fi-wi-stats-overview-stat-description {
    font-size: 0.72rem !important;
    color: rgba(255, 255, 255, 0.38) !important;
}

.fi-panel-admin .fi-wi-stats-overview-stat-chart {
    opacity: 0.9;
}

/* Chart widgets */
.fi-panel-admin .fi-wi-chart {
    background: linear-gradient(145deg, rgba(22, 38, 62, 0.55) 0%, rgba(10, 22, 40, 0.88) 100%) !important;
    border: 1px solid var(--cf-border) !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22) !important;
}

.fi-panel-admin .fi-wi-chart .fi-section-header-heading {
    font-family: var(--cf-display) !important;
    font-weight: 600 !important;
}

/* Buttons */
.fi-panel-admin .fi-btn-primary {
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 14px rgba(0, 200, 150, 0.25) !important;
}

.fi-panel-admin .fi-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 200, 150, 0.35) !important;
}

/* Tables */
.fi-panel-admin .fi-ta-header-cell {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    color: rgba(255, 255, 255, 0.45) !important;
}

.fi-panel-admin .fi-ta-row:hover {
    background: rgba(0, 200, 150, 0.04) !important;
}

/* Custom widgets */
.fi-panel-admin .fi-wi-widget .cf-panel,
.fi-panel-admin .fi-wi-widget .cf-hero {
    border-radius: 16px;
}

/* Hero */
.cf-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1.5rem 2rem;
    padding: 1.65rem 1.85rem;
    background:
        linear-gradient(125deg, rgba(0, 200, 150, 0.1) 0%, transparent 40%),
        linear-gradient(180deg, rgba(14, 28, 48, 0.95) 0%, rgba(6, 12, 22, 0.98) 100%);
    border: 1px solid rgba(0, 200, 150, 0.18);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.cf-hero::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -10%;
    width: 45%;
    height: 140%;
    background: radial-gradient(ellipse, rgba(0, 200, 150, 0.08) 0%, transparent 65%);
    pointer-events: none;
}

.cf-hero__saludo {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(0, 200, 150, 0.75);
    margin-bottom: 0.2rem;
    letter-spacing: 0.02em;
}

.cf-hero__name {
    font-family: var(--cf-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: #f9fafb;
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.cf-hero__date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.42);
    margin: 0.4rem 0 0.85rem;
    text-transform: capitalize;
}

.cf-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.cf-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.cf-badge--scope {
    background: rgba(0, 200, 150, 0.15);
    color: #00C896;
    border: 1px solid rgba(0, 200, 150, 0.28);
}

.cf-badge--branch {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.22);
}

.cf-badge--role {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cf-badge--muted {
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cf-hero__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(5rem, 1fr));
    gap: 0.75rem;
    align-items: stretch;
}

.cf-hero-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 5.5rem;
    padding: 0.9rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(4px);
}

.cf-hero-stat__value {
    font-family: var(--cf-display);
    font-size: 1.55rem;
    font-weight: 700;
    color: #00C896;
    line-height: 1;
    letter-spacing: -0.02em;
}

.cf-hero-stat__label {
    font-size: 0.62rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.42);
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* Panels */
.cf-panel {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(145deg, rgba(22, 38, 62, 0.5) 0%, rgba(10, 22, 40, 0.88) 100%);
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    height: 100%;
}

.cf-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cf-panel__title {
    font-family: var(--cf-display);
    font-size: 1rem;
    font-weight: 600;
    color: #f9fafb;
    margin: 0;
    letter-spacing: -0.02em;
}

.cf-panel__subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0.15rem 0 0;
}

.cf-panel__pill {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(0, 200, 150, 0.12);
    color: #00C896;
    border: 1px solid rgba(0, 200, 150, 0.2);
    white-space: nowrap;
}

.cf-panel__pill--ai {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.25);
}

/* Alerts */
.cf-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.cf-alert {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.cf-alert__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    flex-shrink: 0;
}

.cf-alert--warning .cf-alert__icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.cf-alert--primary .cf-alert__icon { background: rgba(0, 200, 150, 0.15); color: #00C896; }
.cf-alert--info .cf-alert__icon { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.cf-alert--danger .cf-alert__icon { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.cf-alert__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.cf-alert__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f3f4f6;
}

.cf-alert__count {
    font-family: var(--cf-display);
    font-size: 1rem;
    font-weight: 700;
    color: #00C896;
}

.cf-alert__detail {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    margin: 0.2rem 0 0;
}

/* Briefing */
.cf-briefing {
    font-size: 0.85rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
}

/* Activity */
.cf-activity {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cf-activity__item {
    display: flex;
    gap: 0.85rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cf-activity__item:last-child {
    border-bottom: none;
}

.cf-activity__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00C896;
    margin-top: 0.45rem;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(0, 200, 150, 0.5);
}

.cf-activity__top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.cf-activity__action {
    font-size: 0.85rem;
    font-weight: 500;
    color: #f3f4f6;
    text-transform: capitalize;
}

.cf-activity__time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}

.cf-activity__meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0.15rem 0 0;
}

.cf-empty {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
    padding: 0.5rem 0;
}

@media (max-width: 1024px) {
    .fi-panel-admin .fi-main-ctn::before {
        left: 0;
    }

    .cf-hero {
        grid-template-columns: 1fr;
    }

    .cf-hero__stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cf-hero {
        padding: 1.25rem;
    }

    .cf-hero__stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .cf-hero-stat {
        min-width: 0;
    }
}
