html, body {
    font-family: 'Afacad', sans-serif !important;
}

/* Contenedor */
.page-container {
    padding: 1.5rem;
}

/* ── Badges de tipo de error / inteligencia (Matriz Atributos y Negocio) ── */
.badge-tipo {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 0.73rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
.badge-tipo-ecuf { background-color: #dc3545; }
.badge-tipo-ecn  { background-color: #0d6efd; }
.badge-tipo-ecc  { background-color: #fd7e14; }
.badge-tipo-enc  { background-color: #6c757d; }

.badge-tipo-in   { background-color: #dc3545; }
.badge-tipo-rc   { background-color: #0d6efd; }
.badge-tipo-rg   { background-color: #fd7e14; }
.badge-tipo-op   { background-color: #6c757d; }
.badge-tipo-fcr  { background-color: #0f9d7a; }
.badge-tipo-otro { background-color: #6f42c1; }

/* ── Badges de origen (Matriz Atributos) ── */
.badge-origen {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 0.73rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-origen-operador { background-color: #ffc107; color: #212529; }
.badge-origen-proceso  { background-color: #0d6efd; color: #fff; }
.badge-origen-ambos    { background-color: #f8f9fa; color: #212529; border: 1px solid #dee2e6; }

/* ── Badges de estado (global: usados dentro de tablas con CSS isolation) ── */
.estado-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
}

.estado-badge.activo {
    background: #d1f0e0;
    color: #0f7a40;
}

.estado-badge.inactivo {
    background: #fde8e8;
    color: #c0392b;
}

/* ── Autocompletado del navegador: quitar el amarillo nativo y usar celeste ── */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
.blazored-typeahead__input:-webkit-autofill,
.blazored-typeahead__input-mask:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #e8f4fb inset !important;
    box-shadow: 0 0 0 1000px #e8f4fb inset !important;
    -webkit-text-fill-color: #212529 !important;
    caret-color: #212529;
    transition: background-color 5000s ease-in-out 0s;
}

/* ── Blazor error UI: ocultar siempre ─────────────────── */
#blazor-error-ui {
    display: none !important;
}

/* ── Loading progress (pantalla de carga inicial) ─────── */
.loading-progress {
    position: fixed;
    inset: 0;
    margin: auto;
    width: 80px;
    height: 80px;
    z-index: 9999;
}

.loading-progress circle {
    fill: none;
    stroke-width: 6;
    transform-origin: center;
}

.loading-progress circle:first-child {
    stroke: #e8ecf4;
    r: 38%;
}

.loading-progress circle:last-child {
    stroke: #041476;
    r: 38%;
    stroke-dasharray: 238;
    stroke-dashoffset: 238;
    animation: loading-progress-spin 1.6s linear infinite;
    stroke-linecap: round;
}

.loading-progress-text {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 120px;
    color: #041476;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.loading-progress-text::after {
    content: "Cargando...";
}

@keyframes loading-progress-spin {
    0%   { stroke-dashoffset: 238; }
    50%  { stroke-dashoffset: 60; }
    100% { stroke-dashoffset: 238; transform: rotate(360deg); }
}

/* ── Caja de error API (global) ───────────────────────── */
.api-error-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    border-left-width: 4px;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    animation: fadeInDown 0.2s ease;
}

.api-error-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.875rem;
}

.api-error-body strong {
    font-size: 0.9rem;
}

.api-error-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.api-error-danger {
    background-color: #fff5f5;
    border-color: #f5c2c7;
    border-left-color: #dc3545;
    color: #842029;
}

.api-error-warning {
    background-color: #fffbf0;
    border-color: #ffe69c;
    border-left-color: #ffc107;
    color: #664d03;
}

.api-error-secondary {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    border-left-color: #6c757d;
    color: #495057;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Mensajes de validación de formulario ─────────────── */
.validation-message {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #842029;
    font-size: 0.8rem;
    margin-top: 0.35rem;
    padding: 0.3rem 0.6rem;
    background-color: #fff5f5;
    border-left: 3px solid #dc3545;
    border-radius: 0 4px 4px 0;
    animation: fadeInDown 0.15s ease;
}

.validation-message::before {
    content: "\F33A";
    font-family: "bootstrap-icons";
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* input inválido */
.invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.15) !important;
}

/* Tabla de errores / inteligencia (formulario de evaluación) */
.table-coaching {
    width: 100%;
    border-collapse: collapse;
}

.table-coaching th {
    background-color: #f1f1f4;
    color: #041476;
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.table-coaching td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #eceef2;
    vertical-align: middle;
}

/* Botones globales*/
.btn-corporativo {
    background-color: #041476;
    color: white;
    padding: 8px 20px;
    font-weight: bolder;
    font-size: 0.9rem;
    border-radius: 5px;
    border: none;
}

.btn-corporativo:hover {
    background-color: #020e4e;
    color: white;
}

.btn-corp-blue {
    background-color: #8bd3f5;
    color: white;
    padding: 8px 20px;
    font-weight: bolder;
    font-size: 0.9rem;
    border-radius: 5px;
    border: none;
}

.btn-corp-blue:hover {
    background-color: #147baa;
}

.btn-corp-gris {
    background-color: #FFFFFF;
    color: #555555;
    padding: 8px 20px;
    font-weight: bolder;
    font-size: 0.9rem;
    border-radius: 5px;
    border: 2px solid #E0E0E0;
    
}
.btn-corp-gris:hover {
    background-color: #2C2C2C;
    color: #FFFFFF;
}
.btn-corp-orange {
    background-color: #E47748;
    color: #FFFFFF;
    padding: 8px 20px;
    font-weight: bolder;
    font-size: 0.9rem;
    border-radius: 5px;
    border: none;
    
}
.btn-corp-orange:hover {
    background-color: #9a3d15;
    color: #FFFFFF;
}

.btn-corp-lila {
    background-color: #80188F;
    color: #FFFFFF;
    padding: 8px 20px;
    font-weight: bolder;
    font-size: 0.9rem;
    border-radius: 5px;
    border: none;
    
}
.btn-corp-lila:hover {
    background-color: #4c0f55;
    color: #FFFFFF;
}

.btn-uniform {
    width: 220px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Input y Select */
.inputDato-ext-container {
    position: relative;
    margin-top: 12px;
    margin-bottom: 20px;
}

.form-label-ext {
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    background-color: white;
    padding: 0 4px;
    z-index: 1;
    pointer-events: none;
}

.inputDato-ext-container .form-control,
.inputDato-ext-container .form-select {
    border-radius: 6px;
    font-size: 0.875rem;
}

.inputDato-ext-container .form-control:focus,
.inputDato-ext-container .form-select:focus {
    border-color: #041476;
    box-shadow: 0 0 0 0.15rem rgba(4, 20, 118, 0.15);
}

.inputDato-ext-container .form-control[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
}

/* BlazoredTypeahead — estilo global */
.blazored-typeahead__controls {
    display: flex;
    align-items: center;
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.blazored-typeahead__controls:focus-within {
    border-color: #041476;
    box-shadow: 0 0 0 0.15rem rgba(4, 20, 118, 0.15);
}

.blazored-typeahead__input {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: #212529;
    min-width: 0;
}

.blazored-typeahead__input::placeholder {
    color: #6c757d;
    opacity: 1;
}

.blazored-typeahead__input-icon {
    display: flex;
    align-items: center;
    padding-right: 0.5rem;
    color: #6c757d;
    flex-shrink: 0;
    border: none;
    background: transparent;
}

.blazored-typeahead__toggle-button {
    border: none !important;
    background: transparent;
    padding: 0 0.5rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Nav y Tab container */
.nav-tabs .nav-link {
    color: #000;
    background-color: #dee2e6;
    border: 1px solid transparent;
}
.nav-tabs .nav-link:hover {
    background-color: #929292;
    color: white;
}
.nav-tabs .nav-link.active {
    background-color: #888888;
    color: white;
    border-color: #888888 #888888 #fff;
}

@media (max-width: 575px) {
    .tabs-container { padding: 0.75rem 1rem 0; gap: 2px; }
    .tab            { font-size: 0.8rem; padding: 0.45rem 0.75rem; }
}



/* Avatar pequeño en tabla de usuario */
.avatar-xs {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #041476;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
/* Vista tarjetas usuario*/
.user-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    transition: box-shadow 0.15s;
}

.user-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.avatar-sm {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #041476;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-sm.inactivo {
    background: #adb5bd;
}
/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}
.form-card {
    padding: 2rem;
}

.avatar-lg {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #041476;
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 575px) {
    .page-container  { padding: 1rem; }
    .search-wrapper  { max-width: 100%; }
    .toolbar         { flex-direction: column; align-items: stretch !important; }
    .ms-auto         { margin-left: 0 !important; }
}
