.perfiles-page { max-width: 1200px; padding: 1.25rem 1rem 2.5rem; }

.perf-top {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.perf-top h1 { margin: 0; font-size: 1.35rem; }
.perf-top p { margin: 0.2rem 0 0; color: #6b7280; font-size: 0.9rem; }

.perf-nav { display: flex; flex-wrap: wrap; gap: 0.65rem; font-size: 0.88rem; align-items: center; }
.perf-nav a { color: #4338ca; font-weight: 600; text-decoration: none; }
.perf-nav-primary {
    padding: 0.5rem 1rem;
    background: #4338ca;
    color: #fff !important;
    border-radius: 8px;
}

.perf-link-box {
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
}

.perf-link-box p { margin: 0 0 0.5rem; color: #312e81; }
.perf-link-url {
    display: block;
    padding: 0.65rem 0.85rem;
    background: #fff;
    border: 1px solid #a5b4fc;
    border-radius: 8px;
    font-size: 0.88rem;
    word-break: break-all;
    color: #1e1b4b;
}

.perf-link-hint { margin: 0.5rem 0 0 !important; font-size: 0.82rem; color: #6366f1 !important; }

.perf-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.perf-kpi-item {
    text-align: center;
    padding: 0.75rem;
    background: #eef2ff;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #312e81;
    border: 1px solid #c7d2fe;
}

.perf-kpi-item span { display: block; font-size: 1.5rem; font-weight: 800; }
.perf-kpi-item span small { font-size: 0.85rem; font-weight: 700; opacity: 0.85; }
.perf-kpi-item em { display: block; font-size: 0.72rem; font-style: normal; font-weight: 600; opacity: 0.85; margin-top: 0.15rem; }
.perf-kpi-green { background: #ecfdf5; color: #065f46; border-color: #6ee7b7; }
.perf-kpi-indigo { background: #eef2ff; color: #3730a3; border-color: #a5b4fc; }
.perf-kpi-orange { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.perf-kpi-blue { background: #eff6ff; color: #1e40af; border-color: #93c5fd; }
.perf-kpi-purple { background: #faf5ff; color: #6b21a8; border-color: #d8b4fe; }
.perf-kpi-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.perf-filter-active {
    margin: -0.35rem 0 1rem;
    padding: 0.65rem 0.85rem;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #1e3a8a;
}
.perf-filter-active a { margin-left: 0.5rem; font-weight: 700; }

.perf-muni-bloque { margin: 0 0 1rem 1rem; }
.perf-muni-bloque:last-child { margin-bottom: 0; }
.perf-muni-titulo {
    margin: 0 0 0.45rem;
    font-size: 0.88rem;
    color: #3730a3;
    font-weight: 700;
}
.perf-muni-titulo small { font-weight: 600; color: #64748b; }

.perf-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.65rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    align-items: flex-end;
}

.perf-bar label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.82rem; font-weight: 600; margin: 0; }
.perf-bar input, .perf-bar select { padding: 0.5rem; border: 1px solid #e5e7eb; border-radius: 8px; font: inherit; min-width: 140px; }

.perf-btn {
    padding: 0.5rem 1rem;
    background: #4338ca;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.perf-btn-outline { background: #fff; color: #4338ca; border: 1px solid #4338ca; }

.perf-resumen h2 { margin: 0 0 0.75rem; font-size: 1.05rem; }

.perf-prov-bloque { margin-bottom: 1.5rem; }
.perf-prov-bloque:last-child { margin-bottom: 0; }

.perf-prov-titulo {
    margin: 0 0 0.5rem;
    padding: 0.55rem 0.75rem;
    background: linear-gradient(90deg, #312e81, #4338ca);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 8px 8px 0 0;
}

.perf-prov-titulo small {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: none;
    opacity: 0.9;
}

.perfiles-page table.perf-table thead th {
    background-color: #312e81 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
}

.perf-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.perf-table td, .perf-table th { padding: 0.6rem 0.5rem; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.perf-exp { max-width: 320px; white-space: pre-wrap; line-height: 1.45; }
.perf-table-wide { min-width: 1100px; font-size: 0.8rem; }
.perf-muted { color: #6b7280; font-size: 0.85rem; }

.perf-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.perf-badge-si { background: #dcfce7; color: #166534; }
.perf-badge-no { background: #f1f5f9; color: #475569; }

.perf-form-section {
    margin: 1.25rem 0 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    color: #312e81;
}

.perf-form-section:first-child { margin-top: 0; }

.perf-form-card .perf-form label { margin-bottom: 1rem; }

.perf-fieldset {
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    padding: 0.85rem 1rem 1rem;
    margin-bottom: 1rem;
    background: #f8fafc;
}

.perf-fieldset legend {
    padding: 0 0.35rem;
    font-weight: 700;
    color: #312e81;
}

.perf-radio-row { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.perf-radio { flex-direction: row !important; align-items: center; gap: 0.45rem !important; font-weight: 600; margin: 0 !important; }
.perf-radio input { width: auto; margin: 0; }

.perf-check {
    flex-direction: row !important;
    align-items: flex-start;
    gap: 0.55rem !important;
    font-weight: 600;
    margin: 0.25rem 0 1rem !important;
    padding: 0.75rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.perf-check input { width: auto; margin-top: 0.15rem; flex-shrink: 0; }

.perf-input-readonly {
    background: #f1f5f9 !important;
    color: #475569;
    cursor: not-allowed;
}

.perf-edit-banner {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    color: #92400e;
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.perf-edit-banner[hidden] { display: none !important; }

.perf-edit-reset {
    margin-left: auto;
    font-size: 0.82rem;
    padding: 0.35rem 0.75rem;
}

.perf-busqueda-estado {
    margin-bottom: 1rem;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.45;
}

.perf-busqueda-estado[hidden] { display: none !important; }

.perf-busqueda-estado--info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.perf-busqueda-estado--ok {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.perf-busqueda-estado--empty {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #475569;
}

.perf-busqueda-estado--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.perf-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.perf-modal[hidden] { display: none !important; }

.perf-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.perf-modal-box {
    position: relative;
    z-index: 1;
    width: min(100%, 420px);
    padding: 1.25rem 1.35rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

.perf-modal-box h2 {
    margin: 0 0 0.65rem;
    font-size: 1.05rem;
    color: #312e81;
}

.perf-modal-box p {
    margin: 0 0 1rem;
    color: #475569;
    line-height: 1.5;
}

.perf-modal-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.perf-form textarea { resize: vertical; min-height: 120px; }

.perf-file-label input[type="file"] {
    margin-top: 0.35rem;
    padding: 0.45rem;
    border: 1px dashed #93c5fd;
    border-radius: 8px;
    background: #f8fafc;
    width: 100%;
    font: inherit;
}

.perf-file-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
}

.perf-docs { white-space: nowrap; }
.perf-doc-link {
    display: inline-block;
    margin: 0 0.15rem 0.15rem 0;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 700;
    font-size: 0.72rem;
    text-decoration: none;
}
.perf-doc-link:hover { background: #c7d2fe; }

@media (max-width: 700px) {
    .perf-exp { max-width: none; }
}
