/* ============================================
   ALY ATS - Modern UI Stylesheet
   ============================================ */

:root {
    --ats-primary: #6366f1;
    --ats-primary-light: #818cf8;
    --ats-primary-dark: #4f46e5;
    --ats-primary-bg: rgba(99, 102, 241, 0.08);
    --ats-success: #22c55e;
    --ats-success-bg: rgba(34, 197, 94, 0.1);
    --ats-warning: #f59e0b;
    --ats-warning-bg: rgba(245, 158, 11, 0.1);
    --ats-danger: #ef4444;
    --ats-danger-bg: rgba(239, 68, 68, 0.1);
    --ats-info: #3b82f6;
    --ats-info-bg: rgba(59, 130, 246, 0.1);
    --ats-accent: #0f766e;
    --ats-accent-bg: rgba(15, 118, 110, 0.10);
    --ats-accent-light: #14b8a6;
    --ats-accent-soft: rgba(20, 184, 166, 0.06);
    --ats-insight-bg: rgba(20, 184, 166, 0.06);
    --ats-insight-border: rgba(15, 118, 110, 0.12);
    --ats-insight-icon-bg: #ffffff;
    --ats-insight-icon-color: #0f766e;

    --ats-page-bg: #f8f9fc;
    --ats-bg: #f8f9fc;
    --ats-surface: #ffffff;
    --ats-border: #e5e7eb;
    --ats-border-light: #f0f0f5;
    --ats-text: #1e293b;
    --ats-text-secondary: #64748b;
    --ats-text-muted: #94a3b8;
    --ats-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --ats-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --ats-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --ats-radius: 12px;
    --ats-radius-sm: 8px;
    --ats-radius-lg: 16px;
    --ats-topbar-height: 64px;
}

/* ============================================
   CHART WRAPPER
   ============================================ */
.ats-chart-wrap {
    height: 240px;
    position: relative;
}

[data-bs-theme="dark"] {
    --ats-page-bg:
        radial-gradient(circle at 18% 0%, rgba(39, 46, 93, 0.55) 0%, rgba(39, 46, 93, 0) 34%),
        linear-gradient(110deg, #080d26 0%, #111026 48%, #2b0b21 100%);
    --ats-bg: #100d20;
    --ats-surface: #171326;
    --ats-border: #34243d;
    --ats-border-light: #24182f;
    --ats-text: #f1f5f9;
    --ats-text-secondary: #94a3b8;
    --ats-text-muted: #64748b;
    --ats-accent: #2dd4bf;
    --ats-accent-bg: rgba(45, 212, 191, 0.12);
    --ats-accent-light: #5eead4;
    --ats-accent-soft: rgba(45, 212, 191, 0.08);
    --ats-insight-bg: rgba(45, 212, 191, 0.07);
    --ats-insight-border: rgba(45, 212, 191, 0.15);
    --ats-insight-icon-bg: #1a1a2e;
    --ats-insight-icon-color: #2dd4bf;
    --ats-shadow: 0 1px 3px rgba(4, 6, 18, 0.35);
    --ats-shadow-md: 0 4px 10px rgba(4, 6, 18, 0.38);
    --ats-shadow-lg: 0 14px 30px rgba(4, 6, 18, 0.42);
    --bs-body-bg: #100d20;
    --bs-body-color: #f1f5f9;
    --bs-tertiary-bg: #171326;
    --bs-border-color: #34243d;
    --bs-dropdown-bg: #171326;
    --bs-dropdown-border-color: #34243d;
    --bs-dropdown-link-color: #f1f5f9;
    --bs-dropdown-link-hover-bg: #21172d;
    --bs-modal-bg: #171326;
}

/* ---- Base ---- */
* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--ats-page-bg);
    color: var(--ats-text);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ats-primary); text-decoration: none; }
a:hover { color: var(--ats-primary-dark); }

/* ============================================
   TOP NAVIGATION BAR
   ============================================ */
.ats-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--ats-topbar-height);
    background: var(--ats-surface);
    border-bottom: 1px solid var(--ats-border);
    z-index: 1000;
    box-shadow: var(--ats-shadow);
}

.ats-topbar-inner {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 24px;
    max-width: 100%;
    gap: 8px;
}

.ats-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ats-text);
    flex-shrink: 0;
    margin-right: 16px;
}
.ats-brand:hover { color: var(--ats-text); }

.ats-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--ats-primary), #8b5cf6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.ats-brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Navigation Links */
.ats-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
    flex: 1;
}

.ats-nav-link {
    padding: 8px 16px;
    border-radius: var(--ats-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ats-text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.ats-nav-link:hover {
    color: var(--ats-text);
    background: var(--ats-primary-bg);
}

.ats-nav-link.active {
    color: var(--ats-primary);
    background: var(--ats-primary-bg);
    font-weight: 600;
}

.ats-nav-item .dropdown-toggle::after {
    margin-left: 6px;
    vertical-align: 0.1em;
}

.ats-nav-submenu {
    margin-top: 6px;
    min-width: 220px;
}

.ats-nav-submenu .dropdown-item.active {
    color: var(--ats-primary);
    background: var(--ats-primary-bg);
    font-weight: 600;
}

/* Right side items */
.ats-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.ats-search-box {
    display: flex;
    align-items: center;
    background: var(--ats-bg);
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    padding: 6px 12px;
    gap: 8px;
    width: 260px;
    transition: all 0.2s;
}

.ats-search-box:focus-within {
    border-color: var(--ats-primary);
    box-shadow: 0 0 0 3px var(--ats-primary-bg);
}

.ats-search-box i { color: var(--ats-text-muted); font-size: 0.85rem; }

.ats-search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.85rem;
    color: var(--ats-text);
    width: 100%;
}

.ats-search-box input::placeholder { color: var(--ats-text-muted); }

.ats-icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    background: transparent;
    color: var(--ats-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 1.05rem;
}

.ats-icon-btn:hover {
    background: var(--ats-bg);
    color: var(--ats-text);
}

.ats-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: var(--ats-danger);
    color: #fff;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User button */
.ats-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px;
}

.ats-user-btn::after { display: none; }

.ats-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ats-primary), #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.ats-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.ats-dropdown {
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius);
    box-shadow: var(--ats-shadow-lg);
    padding: 8px;
    background: var(--ats-surface);
    min-width: 200px;
}

.ats-dropdown .dropdown-item {
    border-radius: var(--ats-radius-sm);
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--ats-text);
}

.ats-dropdown .dropdown-item:hover {
    background: var(--ats-bg);
}

.ats-dropdown .dropdown-header {
    padding: 8px 12px;
}

/* Mobile Navigation */
.ats-mobile-nav {
    display: none;
    flex-direction: column;
    background: var(--ats-surface);
    border-bottom: 1px solid var(--ats-border);
    padding: 8px 16px;
    position: fixed;
    top: var(--ats-topbar-height);
    left: 0;
    right: 0;
    z-index: 999;
    box-shadow: var(--ats-shadow-md);
}

.ats-mobile-nav.show { display: flex; }

.ats-mobile-nav a {
    padding: 10px 12px;
    border-radius: var(--ats-radius-sm);
    color: var(--ats-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}

.ats-mobile-nav a:hover,
.ats-mobile-nav a.active {
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
}

.ats-mobile-group {
    border-radius: var(--ats-radius-sm);
    margin-bottom: 4px;
}

.ats-mobile-group-toggle {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--ats-text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--ats-radius-sm);
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 500;
}

.ats-mobile-group-toggle:hover,
.ats-mobile-group.active .ats-mobile-group-toggle {
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
}

.ats-mobile-group-items {
    display: none;
    padding-left: 12px;
}

.ats-mobile-group.open .ats-mobile-group-items,
.ats-mobile-group.active .ats-mobile-group-items {
    display: block;
}

.ats-mobile-group-chevron {
    transition: transform 0.15s ease;
}

.ats-mobile-group.open .ats-mobile-group-chevron,
.ats-mobile-group.active .ats-mobile-group-chevron {
    transform: rotate(180deg);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.ats-main {
    margin-top: var(--ats-topbar-height);
    padding: 28px 32px;
    min-height: calc(100vh - var(--ats-topbar-height));
}

@media (max-width: 768px) {
    .ats-main { padding: 20px 16px; }
}

/* ============================================
   CARDS & SURFACES
   ============================================ */
.ats-card {
    background: var(--ats-surface);
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius);
    box-shadow: var(--ats-shadow);
    padding: 24px;
    transition: box-shadow 0.2s;
}

.ats-card:hover {
    box-shadow: var(--ats-shadow-md);
}

.ats-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ats-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ats-text);
    margin: 0;
}

/* ============================================
   STAT CARDS (Dashboard)
   ============================================ */
.ats-stat-card {
    background: var(--ats-surface);
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.2s;
}

.ats-stat-card:hover {
    box-shadow: var(--ats-shadow-md);
    transform: translateY(-1px);
}

.ats-stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ats-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ats-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ats-text);
    line-height: 1.2;
}

.ats-stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ats-stat-trend.up { color: var(--ats-success); }
.ats-stat-trend.down { color: var(--ats-danger); }

.ats-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--ats-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ============================================
   TABLES
   ============================================ */
.ats-table-card {
    background: var(--ats-surface);
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius);
    overflow: hidden;
    box-shadow: var(--ats-shadow);
}

.ats-table {
    width: 100%;
    border-collapse: collapse;
}

.ats-table thead th {
    padding: 12px 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ats-text-muted);
    border-bottom: 1px solid var(--ats-border);
    background: var(--ats-bg);
    white-space: nowrap;
}

.ats-table tbody td {
    padding: 14px 20px;
    font-size: 0.875rem;
    color: var(--ats-text);
    border-bottom: 1px solid var(--ats-border-light);
    vertical-align: middle;
}

.ats-table tbody tr:hover {
    background: var(--ats-primary-bg);
}

.ats-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGES / STATUS
   ============================================ */
.ats-badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ats-badge-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.ats-badge-active {
    background: var(--ats-success-bg);
    color: var(--ats-success);
}
.ats-badge-active::before { background: var(--ats-success); }

.ats-badge-draft {
    background: var(--ats-warning-bg);
    color: var(--ats-warning);
}
.ats-badge-draft::before { background: var(--ats-warning); }

.ats-badge-closed {
    background: rgba(100,116,139,0.1);
    color: #64748b;
}
.ats-badge-closed::before { background: #64748b; }

.ats-badge-paused {
    background: var(--ats-info-bg);
    color: var(--ats-info);
}
.ats-badge-paused::before { background: var(--ats-info); }

.ats-badge-warning {
    background: var(--ats-warning-bg);
    color: var(--ats-warning);
}
.ats-badge-warning::before { background: var(--ats-warning); }

.ats-badge-info {
    background: var(--ats-info-bg);
    color: var(--ats-info);
}
.ats-badge-info::before { background: var(--ats-info); }

.ats-badge-danger {
    background: var(--ats-danger-bg);
    color: var(--ats-danger);
}
.ats-badge-danger::before { background: var(--ats-danger); }

/* ============================================
   BUTTONS
   ============================================ */
.ats-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--ats-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.ats-btn-primary {
    background: var(--ats-primary);
    color: #fff;
}
.ats-btn-primary:hover {
    background: var(--ats-primary-dark);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ats-btn-success {
    background: var(--ats-success);
    color: #fff;
}
.ats-btn-success:hover {
    background: #16a34a;
    color: #fff;
}

.ats-btn-danger {
    background: transparent;
    color: var(--ats-danger);
    border: 1px solid var(--ats-danger);
}
.ats-btn-danger:hover {
    background: var(--ats-danger);
    color: #fff;
}

.ats-btn-outline {
    background: transparent;
    color: var(--ats-text-secondary);
    border: 1px solid var(--ats-border);
}
.ats-btn-outline:hover {
    background: var(--ats-bg);
    color: var(--ats-text);
}

.ats-btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.ats-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: var(--ats-radius-sm);
}

/* ============================================
   TABS
   ============================================ */
.ats-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--ats-border-light);
    margin-bottom: 24px;
}

.ats-tab {
    padding: 10px 18px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ats-text-secondary);
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
}

.ats-tab:hover { color: var(--ats-text); }

.ats-tab.active {
    color: var(--ats-primary);
    font-weight: 600;
}

.ats-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--ats-primary);
    border-radius: 2px 2px 0 0;
}

.ats-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 6px;
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
}

/* ============================================
   KANBAN PIPELINE
   ============================================ */
.ats-kanban {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 500px;
}

.ats-kanban-column {
    min-width: 280px;
    max-width: 300px;
    flex-shrink: 0;
    background: var(--ats-bg);
    border-radius: var(--ats-radius);
    border: 1px solid var(--ats-border-light);
    display: flex;
    flex-direction: column;
}

.ats-kanban-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ats-kanban-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ats-text);
}

.ats-kanban-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.ats-kanban-count {
    background: var(--ats-surface);
    border: 1px solid var(--ats-border);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ats-text-secondary);
}

.ats-kanban-body {
    padding: 0 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 100px;
}

.ats-kanban-card {
    background: var(--ats-surface);
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    padding: 14px;
    cursor: grab;
    transition: all 0.15s ease;
}

.ats-kanban-card:hover {
    box-shadow: var(--ats-shadow-md);
    transform: translateY(-1px);
}

.ats-kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.ats-kanban-card-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--ats-text);
}

.ats-kanban-card-sub {
    font-size: 0.75rem;
    color: var(--ats-text-muted);
    margin-top: 2px;
}

.ats-kanban-card-score {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 8px;
}

.ats-score-high { background: var(--ats-success-bg); color: var(--ats-success); }
.ats-score-medium { background: var(--ats-warning-bg); color: var(--ats-warning); }
.ats-score-low { background: var(--ats-danger-bg); color: var(--ats-danger); }

.ats-kanban-card-tags {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.ats-tag {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 500;
    background: var(--ats-bg);
    color: var(--ats-text-secondary);
    border: 1px solid var(--ats-border-light);
}

.ats-kanban-dropzone {
    border: 2px dashed var(--ats-border);
    border-radius: var(--ats-radius-sm);
    padding: 24px;
    text-align: center;
    color: var(--ats-text-muted);
    font-size: 0.8rem;
    transition: all 0.2s;
}

.ats-kanban-dropzone.drag-over {
    border-color: var(--ats-primary);
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
}

.ats-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ats-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--ats-border);
    background: var(--ats-bg);
    font-size: 0.75rem;
    color: var(--ats-text-secondary);
    cursor: pointer;
}

.ats-filter-chip input {
    display: none;
}

.ats-filter-chip .ats-filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.ats-filter-chip input:checked + .ats-filter-dot {
    box-shadow: 0 0 0 3px var(--ats-primary-bg);
}

.ats-filter-chip input:checked ~ span {
    color: var(--ats-text);
    font-weight: 600;
}

.ats-qr-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    border-radius: var(--ats-radius);
    border: 1px dashed var(--ats-border);
    background: var(--ats-bg);
    margin-bottom: 16px;
}

.ats-qr-preview img {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    background: #fff;
    padding: 8px;
    box-shadow: var(--ats-shadow);
}

/* ============================================
   CHAT / MESSAGES (WhatsApp style)
   ============================================ */
.ats-chat-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: calc(100vh - var(--ats-topbar-height) - 56px);
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius);
    overflow: hidden;
    background: var(--ats-surface);
}

@media (max-width: 768px) {
    .ats-chat-layout { grid-template-columns: 1fr; }
    .ats-chat-sidebar { display: none; }
    .ats-chat-sidebar.show { display: block; position: absolute; z-index: 10; width: 300px; }
}

.ats-chat-sidebar {
    border-right: 1px solid var(--ats-border);
    display: flex;
    flex-direction: column;
    background: var(--ats-surface);
    min-height: 0;
}

.ats-chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--ats-border);
}

.ats-chat-search {
    display: flex;
    align-items: center;
    background: var(--ats-bg);
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    padding: 8px 12px;
    gap: 8px;
}

.ats-chat-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.85rem;
    color: var(--ats-text);
    width: 100%;
}

.ats-chat-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.ats-chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ats-border-light);
    cursor: pointer;
    transition: background 0.15s;
}

.ats-chat-item:hover,
.ats-chat-item.active {
    background: var(--ats-primary-bg);
}

.ats-chat-item-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ats-primary), #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
}

.ats-chat-item-info { flex: 1; min-width: 0; }

.ats-chat-item-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ats-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ats-chat-item-preview {
    font-size: 0.78rem;
    color: var(--ats-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.ats-chat-item-time {
    font-size: 0.7rem;
    color: var(--ats-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.ats-chat-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.ats-chat-unread {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ats-primary);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat main area */
.ats-chat-main {
    display: flex;
    flex-direction: column;
    background: var(--ats-bg);
    height: 100%;
    min-height: 0;
}

.ats-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--ats-surface);
    border-bottom: 1px solid var(--ats-border);
}

.ats-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ats-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ats-msg {
    max-width: 65%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    position: relative;
}

.ats-msg-in {
    align-self: flex-start;
    background: var(--ats-surface);
    border: 1px solid var(--ats-border);
    color: var(--ats-text);
    border-bottom-left-radius: 4px;
}

.ats-msg-out {
    align-self: flex-end;
    background: #dcf8c6;
    color: #1a1a1a;
    border-bottom-right-radius: 4px;
}

[data-bs-theme="dark"] .ats-msg-out {
    background: #0b5d33;
    color: #e2e8f0;
}

.ats-msg-ia {
    align-self: flex-end;
    background: linear-gradient(135deg, #e0e7ff, #ede9fe);
    color: #3730a3;
    border-bottom-right-radius: 4px;
}

[data-bs-theme="dark"] .ats-msg-ia {
    background: linear-gradient(135deg, #312e81, #4c1d95);
    color: #c7d2fe;
}

.ats-msg-system {
    align-self: center;
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 20px;
    padding: 6px 16px;
    max-width: 80%;
    text-align: center;
}

.ats-msg-sender {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ats-primary);
    margin-bottom: 4px;
}

.ats-msg-time {
    font-size: 0.65rem;
    color: var(--ats-text-muted);
    margin-top: 4px;
    text-align: right;
}

.ats-chat-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--ats-surface);
    border-top: 1px solid var(--ats-border);
}

.ats-chat-input input {
    flex: 1;
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    padding: 10px 14px;
    font-size: 0.875rem;
    color: var(--ats-text);
    background: var(--ats-bg);
    outline: none;
}

.ats-chat-input input:focus {
    border-color: var(--ats-primary);
    box-shadow: 0 0 0 3px var(--ats-primary-bg);
}

.ats-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ats-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.15s;
    flex-shrink: 0;
}

.ats-chat-send:hover {
    background: var(--ats-primary-dark);
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

/* ============================================
   CANDIDATE PROFILE
   ============================================ */
.ats-profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--ats-surface);
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.ats-profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ats-primary), #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
}

.ats-profile-info { flex: 1; }

.ats-profile-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ats-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ats-profile-role {
    font-size: 0.875rem;
    color: var(--ats-text-secondary);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ats-profile-score {
    font-size: 0.85rem;
    color: var(--ats-primary);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ats-profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Score circle */
.ats-score-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: conic-gradient(var(--ats-primary) calc(var(--score) * 3.6deg), var(--ats-border-light) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.ats-score-circle-inner {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: var(--ats-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ats-score-circle-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ats-primary);
}

.ats-score-circle-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ats-success);
}

/* ============================================
   FUNNEL
   ============================================ */
.ats-funnel-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.ats-funnel-item + .ats-funnel-item {
    border-top: 1px solid var(--ats-border-light);
}

.ats-funnel-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ats-text);
}

.ats-funnel-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ats-text-secondary);
}

.ats-funnel-bar {
    flex: 1;
    height: 6px;
    background: var(--ats-border-light);
    border-radius: 3px;
    margin: 0 16px;
    overflow: hidden;
}

.ats-funnel-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--ats-primary);
    transition: width 0.5s ease;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.ats-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--ats-border-light);
    overflow: hidden;
}

.ats-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ============================================
   COMMENTS
   ============================================ */
.ats-comment {
    display: flex;
    gap: 12px;
    padding: 14px 0;
}

.ats-comment + .ats-comment {
    border-top: 1px solid var(--ats-border-light);
}

.ats-comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ats-primary), #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.ats-comment-body { flex: 1; }

.ats-comment-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.ats-comment-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ats-text);
}

.ats-comment-role {
    font-size: 0.7rem;
    color: var(--ats-text-muted);
}

.ats-comment-time {
    font-size: 0.7rem;
    color: var(--ats-text-muted);
}

.ats-comment-text {
    font-size: 0.85rem;
    color: var(--ats-text);
    line-height: 1.5;
}

/* ============================================
   FORMS
   ============================================ */
.ats-form-group {
    margin-bottom: 16px;
}

.ats-form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ats-text);
    margin-bottom: 6px;
}

.ats-form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    font-size: 0.875rem;
    color: var(--ats-text);
    background: var(--ats-surface);
    outline: none;
    transition: border-color 0.2s;
}

.ats-form-control:focus {
    border-color: var(--ats-primary);
    box-shadow: 0 0 0 3px var(--ats-primary-bg);
}

.ats-form-control::placeholder { color: var(--ats-text-muted); }

select.ats-form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.ats-form-control {
    resize: vertical;
    min-height: 80px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.ats-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ats-bg);
    padding: 20px;
}

.ats-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--ats-surface);
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-lg);
    padding: 40px;
    box-shadow: var(--ats-shadow-lg);
}

/* ============================================
   TAB PANES
   ============================================ */
.tab-pane-ats {
    display: block;
}
.tab-pane-ats.d-none {
    display: none !important;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.ats-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--ats-text-muted);
}

.ats-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.ats-empty p {
    font-size: 0.9rem;
    margin: 0;
}

/* ============================================
   DOCUMENT CARDS
   ============================================ */
.ats-doc-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    transition: all 0.15s;
}

.ats-doc-card:hover {
    box-shadow: var(--ats-shadow);
}

.ats-doc-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--ats-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ats-doc-info { flex: 1; }

.ats-doc-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ats-text);
}

.ats-doc-status {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

/* ============================================
   BACKGROUND CHECK REPORTS
   ============================================ */
.bg-report-modal .modal-content {
    background: var(--ats-surface);
    color: var(--ats-text);
}

.bg-report-modal .modal-header {
    background: var(--ats-surface);
}

.bg-report-modal .modal-body {
    background: var(--ats-bg);
}

.bg-report {
    color: var(--ats-text);
}

.bg-report-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ats-border);
}

.bg-report-service {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ats-primary);
    text-transform: uppercase;
    letter-spacing: 0;
}

.bg-report-person {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ats-text);
    margin-top: 2px;
}

.bg-report-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--ats-text-muted);
}

.bg-report-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.bg-report-status,
.bg-result-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    padding: 8px 10px;
    font-size: 0.82rem;
}

.bg-result-inline {
    max-width: 280px;
}

.bg-report-status {
    white-space: nowrap;
    font-weight: 700;
}

.bg-report-tone-success {
    background: var(--ats-success-bg);
    border-color: rgba(34, 197, 94, 0.22);
    color: var(--ats-success);
}

.bg-report-tone-warning {
    background: var(--ats-warning-bg);
    border-color: rgba(245, 158, 11, 0.26);
    color: var(--ats-warning);
}

.bg-report-tone-danger {
    background: var(--ats-danger-bg);
    border-color: rgba(239, 68, 68, 0.24);
    color: var(--ats-danger);
}

.bg-report-tone-info {
    background: var(--ats-info-bg);
    border-color: rgba(59, 130, 246, 0.24);
    color: var(--ats-info);
}

.bg-report-tone-muted {
    background: var(--ats-bg);
    border-color: var(--ats-border);
    color: var(--ats-text-secondary);
}

.bg-report-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.bg-report-kpi {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: var(--ats-radius-sm);
    border: 1px solid var(--ats-border);
    min-width: 0;
}

.bg-report-kpi-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ats-radius-sm);
    background: rgba(255,255,255,0.58);
    flex-shrink: 0;
}

.bg-report-kpi-body {
    min-width: 0;
}

.bg-report-kpi-label {
    font-size: 0.72rem;
    color: var(--ats-text-secondary);
    font-weight: 600;
}

.bg-report-kpi-value {
    font-size: 1rem;
    line-height: 1.25;
    color: var(--ats-text);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.bg-report-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border-radius: var(--ats-radius-sm);
    border: 1px solid var(--ats-border);
    padding: 11px 12px;
    margin-bottom: 16px;
    font-size: 0.86rem;
}

.bg-report-section-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--ats-text);
    margin: 18px 0 10px;
}

.bg-report-expedientes {
    display: grid;
    gap: 12px;
}

.bg-report-entity-groups {
    display: grid;
    gap: 16px;
}

.bg-report-entity-group {
    display: grid;
    gap: 10px;
}

.bg-report-entity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--ats-radius-sm);
    background: var(--ats-surface);
    border: 1px solid var(--ats-border);
    color: var(--ats-text);
}

.bg-report-entity-head span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.84rem;
    font-weight: 800;
}

.bg-report-entity-head strong {
    min-width: 28px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--ats-info-bg);
    color: var(--ats-info);
    font-size: 0.72rem;
}

.bg-report-expediente {
    background: var(--ats-surface);
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    padding: 14px;
}

.bg-report-expediente-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ats-border-light);
}

.bg-report-expediente-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--ats-text);
}

.bg-report-expediente-sub {
    font-size: 0.76rem;
    color: var(--ats-text-muted);
    margin-top: 3px;
}

.bg-report-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--ats-radius-sm);
    background: var(--ats-bg);
    border: 1px solid var(--ats-border);
    color: var(--ats-text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.bg-report-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.bg-report-field {
    background: var(--ats-bg);
    border: 1px solid var(--ats-border-light);
    border-radius: var(--ats-radius-sm);
    padding: 9px 10px;
    min-width: 0;
}

.bg-report-field span {
    display: block;
    font-size: 0.7rem;
    color: var(--ats-text-muted);
    font-weight: 700;
}

.bg-report-field strong {
    display: block;
    margin-top: 2px;
    color: var(--ats-text);
    font-size: 0.85rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.bg-report-agreement-wrap {
    margin-top: 14px;
}

.bg-report-collapse-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    background: var(--ats-bg);
    color: var(--ats-text);
    padding: 10px 12px;
    font-size: 0.83rem;
    font-weight: 800;
    cursor: pointer;
}

.bg-report-collapse-btn span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 1;
}

.bg-report-collapse-count {
    min-width: 28px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
    font-size: 0.72rem;
}

.bg-report-collapse-icon {
    transition: transform .16s ease;
    color: var(--ats-text-muted);
}

.bg-report-collapse-btn:not(.collapsed) .bg-report-collapse-icon {
    transform: rotate(180deg);
}

.bg-report-collapse-body {
    padding-top: 8px;
}

.bg-report-agreements {
    display: grid;
    gap: 8px;
}

.bg-report-agreement {
    border: 1px solid var(--ats-border-light);
    border-radius: var(--ats-radius-sm);
    background: var(--ats-bg);
    padding: 10px;
}

.bg-report-agreement-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--ats-text-secondary);
    margin-bottom: 6px;
}

.bg-report-agreement-preview,
.bg-report-agreement-full {
    font-size: 0.82rem;
    line-height: 1.48;
    color: var(--ats-text);
    overflow-wrap: anywhere;
}

.bg-report-link {
    border: 0;
    background: transparent;
    color: var(--ats-primary);
    font-size: 0.78rem;
    font-weight: 800;
    padding: 6px 0 0;
    cursor: pointer;
}

.bg-report-empty,
.bg-report-empty-small {
    text-align: center;
    color: var(--ats-text-muted);
}

.bg-report-empty {
    padding: 34px 16px;
    border: 1px dashed var(--ats-border);
    border-radius: var(--ats-radius-sm);
    background: var(--ats-bg);
}

.bg-report-empty i {
    display: block;
    font-size: 2rem;
    margin-bottom: 8px;
}

.bg-report-empty p,
.bg-report-empty-small {
    margin: 0;
    font-size: 0.86rem;
}

.bg-report-loading {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--ats-text-secondary);
    font-size: 0.9rem;
}

.bg-report-error {
    color: var(--ats-danger);
}

.bg-request-layout {
    display: grid;
    gap: 16px;
}

.bg-request-panel {
    background: var(--ats-surface);
    border: 1px solid var(--ats-border);
    border-radius: 8px;
    padding: 16px;
}

.bg-request-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.bg-request-panel-head h6 {
    margin: 4px 0 0;
    font-weight: 700;
    color: var(--ats-text);
}

.bg-request-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--ats-info-bg);
    color: var(--ats-info);
    font-weight: 700;
    font-size: 12px;
}

.bg-request-search-results {
    max-height: 260px;
    overflow: auto;
    margin: 12px 0;
}

.bg-request-candidate-card {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--ats-border);
    border-radius: 8px;
    background: var(--ats-bg);
    color: var(--ats-text);
    text-align: left;
    transition: border-color .15s ease, background .15s ease;
}

.bg-request-candidate-card:hover,
.bg-request-candidate-card.is-selected {
    border-color: var(--ats-primary);
    background: var(--ats-info-bg);
}

.bg-request-candidate-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.bg-request-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--ats-border);
    color: var(--ats-secondary);
    font-size: 12px;
    line-height: 1.2;
}

.background-quick-range {
    min-height: 30px;
}

.background-status-multi {
    min-height: 96px;
}

.background-status-native-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.background-status-trigger {
    min-height: 40px;
}

.background-status-menu {
    min-width: 260px;
    border-radius: 8px;
}

.background-status-item {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    cursor: pointer;
    user-select: none;
}

.background-status-item:hover {
    background: var(--ats-bg);
}

.background-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: var(--ats-secondary);
    font-weight: 700;
    padding: 0;
    cursor: pointer;
}

.background-sort-btn i {
    color: var(--ats-text-muted);
    font-size: 12px;
}

.background-sort-btn.is-active {
    color: var(--ats-primary);
}

.background-sort-btn.is-active i {
    color: var(--ats-primary);
}

.bg-request-selected {
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--ats-success-border, var(--ats-border));
    border-radius: 8px;
    background: var(--ats-success-bg);
}

.bg-request-service-summary-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 14px;
    align-items: start;
}

.bg-request-service-column {
    min-width: 0;
}

.bg-request-summary-card {
    position: sticky;
    top: 12px;
    padding: 14px;
    border: 1px solid var(--ats-border);
    border-radius: 8px;
    background: var(--ats-bg);
    box-shadow: var(--ats-shadow-sm);
}

.bg-request-summary-card h6 {
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ats-border);
    color: var(--ats-text);
    font-weight: 800;
}

.bg-request-summary-rows {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.bg-request-summary-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    color: var(--ats-secondary);
    font-size: 13px;
}

.bg-request-summary-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.bg-request-summary-row strong {
    color: var(--ats-text);
    white-space: nowrap;
}

.bg-request-summary-empty {
    color: var(--ats-secondary);
    font-size: 13px;
    padding: 4px 0;
}

.bg-request-summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    margin-top: 6px;
    border-top: 1px solid var(--ats-border);
    border-bottom: 1px solid var(--ats-border);
}

.bg-request-summary-total span {
    color: var(--ats-text);
    font-weight: 800;
}

.bg-request-summary-total strong {
    color: var(--ats-primary);
    font-size: 24px;
    line-height: 1;
}

.bg-request-summary-wallet {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0;
}

.bg-request-summary-wallet > div {
    border: 1px solid var(--ats-border);
    border-radius: 8px;
    padding: 9px;
    background: var(--ats-surface);
}

.bg-request-summary-wallet span {
    display: block;
    color: var(--ats-secondary);
    font-size: 11px;
    margin-bottom: 4px;
}

.bg-request-summary-wallet strong {
    display: block;
    color: var(--ats-text);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.bg-request-summary-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    border: 1px solid var(--ats-border);
    border-radius: 8px;
    color: var(--ats-secondary);
    font-size: 12px;
    background: var(--ats-surface);
}

.bg-request-warning {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--ats-warning-border, var(--ats-border));
    background: var(--ats-warning-bg);
    color: var(--ats-warning);
    font-size: 13px;
}

.bg-request-service-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--ats-border);
    border-radius: 8px;
    background: var(--ats-bg);
    cursor: pointer;
}

.bg-request-service-card:has(input:checked),
.bg-request-service-card.is-selected {
    border-color: var(--ats-primary);
    background: var(--ats-info-bg);
}

.bg-request-service-card.is-disabled {
    opacity: .6;
    cursor: not-allowed;
}

.bg-request-service-main {
    flex: 1;
    min-width: 0;
}

.bg-request-service-side {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.bg-request-service-price {
    color: var(--ats-secondary);
    font-size: 12px;
    white-space: nowrap;
}

.bg-request-judicial-detail-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ats-secondary);
    cursor: pointer;
}

.bg-request-help-icon {
    color: var(--ats-text-muted);
    font-size: 13px;
}

.background-tab-pane {
    min-width: 0;
}

.background-service-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.background-service-chip {
    background: var(--ats-surface);
}

.background-case-offcanvas {
    width: min(720px, 100vw) !important;
}

.background-case-summary {
    display: grid;
    gap: 12px;
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid var(--ats-border);
    border-radius: 8px;
    background: var(--ats-bg);
}

.background-case-services,
.background-history-list,
.background-profile-services {
    display: grid;
    gap: 10px;
}

.background-case-service,
.background-history-case {
    padding: 14px;
    border: 1px solid var(--ats-border);
    border-radius: 8px;
    background: var(--ats-surface);
}

.background-case-service-head,
.background-history-case-head,
.background-history-service,
.background-profile-service {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.background-history-services {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.background-history-service,
.background-profile-service {
    padding: 10px;
    border: 1px solid var(--ats-border);
    border-radius: 8px;
    background: var(--ats-bg);
}

.background-profile-services {
    margin-top: 12px;
}

.background-subject-list {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.background-subject-card {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, .9fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--ats-border);
    border-radius: 8px;
    background: var(--ats-surface);
}

.background-subject-main,
.background-subject-result {
    min-width: 0;
}

.background-subject-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.background-subject-stats span {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border: 1px solid var(--ats-border);
    border-radius: 999px;
    color: var(--ats-secondary);
    font-size: 12px;
    background: var(--ats-bg);
}

@media (max-width: 900px) {
    .bg-report-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .background-subject-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

@media (max-width: 640px) {
    .bg-report-header,
    .bg-report-expediente-head {
        flex-direction: column;
    }

    .bg-report-status {
        white-space: normal;
    }

    .bg-report-kpis,
    .bg-report-fields {
        grid-template-columns: 1fr;
    }

    .bg-request-panel-head,
    .bg-request-candidate-card {
        flex-direction: column;
    }

    .bg-request-service-summary-layout {
        grid-template-columns: 1fr;
    }

    .bg-request-summary-card {
        position: static;
    }

    .bg-request-service-price {
        white-space: normal;
    }

    .bg-request-service-side {
        justify-items: start;
    }

    .background-case-service-head,
    .background-history-case-head,
    .background-history-service,
    .background-profile-service {
        flex-direction: column;
    }
}

/* ============================================
   MODAL OVERRIDES
   ============================================ */
.modal-content {
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-lg);
    box-shadow: var(--ats-shadow-lg);
    background: var(--ats-surface);
}

.modal-header {
    border-bottom: 1px solid var(--ats-border);
    padding: 20px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--ats-border);
    padding: 16px 24px;
}

/* ============================================
   SEARCHABLE SELECT
   ============================================ */
.ats-searchable-select {
    position: relative;
}

.ats-searchable-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 200px;
    overflow-y: auto;
    background: var(--ats-surface);
    border: 1px solid var(--ats-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ats-searchable-dropdown.show {
    display: block;
}

.ats-searchable-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.ats-searchable-option:hover {
    background: var(--ats-primary-bg);
}

.ats-searchable-option.active {
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
    font-weight: 600;
}

.ats-searchable-empty {
    padding: 12px;
    text-align: center;
    color: var(--ats-text-muted);
    font-size: 0.8rem;
}

/* ============================================
   SCREENING QUESTION CARD
   ============================================ */
.ats-question-card {
    border: 1px solid var(--ats-border-light);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: var(--ats-surface);
    transition: border-color 0.15s;
}

.ats-question-card:hover {
    border-color: var(--ats-primary);
}

.ats-question-card.is-dragging {
    opacity: 0.7;
    transform: rotate(1deg);
}

.ats-question-card.drag-over {
    border-color: var(--ats-primary);
    box-shadow: 0 0 0 2px var(--ats-primary-bg);
}

.ats-question-drag-handle {
    cursor: grab;
    color: var(--ats-text-muted);
}

.ats-question-drag-handle:active {
    cursor: grabbing;
}

.ats-question-card .q-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ats-screening-progress {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.ats-screening-progress-active {
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
}

.ats-screening-progress-pending {
    background: var(--ats-warning-bg);
    color: var(--ats-warning);
}

.ats-screening-progress-done {
    background: var(--ats-success-bg);
    color: var(--ats-success);
}

.ats-screening-progress-done-muted {
    background: var(--ats-bg);
    color: var(--ats-text-muted);
    border: 1px solid var(--ats-border-light);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-ats-primary { color: var(--ats-primary) !important; }
.text-ats-success { color: var(--ats-success) !important; }
.text-ats-warning { color: var(--ats-warning) !important; }
.text-ats-danger { color: var(--ats-danger) !important; }
.text-ats-muted { color: var(--ats-text-muted) !important; }
.text-ats-secondary { color: var(--ats-text-secondary) !important; }

.bg-ats-primary { background: var(--ats-primary-bg) !important; }
.bg-ats-success { background: var(--ats-success-bg) !important; }
.bg-ats-warning { background: var(--ats-warning-bg) !important; }
.bg-ats-danger { background: var(--ats-danger-bg) !important; }

.gap-ats { gap: 16px; }

/* ============================================
   WIZARD — Vacancy Create/Edit
   ============================================ */

/* Stepper */
.wz-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 8px 20px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--ats-border-light);
}

.wz-step-item {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.wz-step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid var(--ats-border);
    background: var(--ats-surface);
    color: var(--ats-text-muted);
    transition: all 0.25s ease;
    flex-shrink: 0;
    cursor: default;
}

.wz-step-item.completed .wz-step-dot {
    background: var(--ats-primary);
    border-color: var(--ats-primary);
    color: #fff;
}

.wz-step-item.active .wz-step-dot {
    border-color: var(--ats-primary);
    color: var(--ats-primary);
    box-shadow: 0 0 0 4px var(--ats-primary-bg);
}

.wz-step-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ats-text-muted);
    margin-left: 6px;
    white-space: nowrap;
    transition: color 0.2s;
}

.wz-step-item.active .wz-step-label { color: var(--ats-primary); }
.wz-step-item.completed .wz-step-label { color: var(--ats-text); }

.wz-step-line {
    width: 32px;
    height: 2px;
    background: var(--ats-border);
    margin: 0 6px;
    border-radius: 1px;
    transition: background 0.25s;
    flex-shrink: 0;
}

.wz-step-item.completed + .wz-step-line,
.wz-step-line.done {
    background: var(--ats-primary);
}

@media (max-width: 768px) {
    .wz-step-label { display: none; }
    .wz-step-line { width: 16px; }
}

/* Wizard panes */
.wz-pane {
    display: none;
    animation: wzFadeIn 0.25s ease;
}

.wz-pane.active {
    display: block;
}

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

/* Wizard cards (section blocks inside panes) */
.wz-card {
    background: var(--ats-surface);
    border: 1px solid var(--ats-border-light);
    border-radius: var(--ats-radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.wz-card-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ats-text-muted);
    margin-bottom: 16px;
}

/* Wizard footer navigation */
.wz-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--ats-border);
    background: var(--ats-surface);
}

.wz-footer .wz-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--ats-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 4px;
    transition: color 0.15s;
}

.wz-footer .wz-btn-back:hover { color: var(--ats-text); }

.wz-footer .wz-btn-next {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--ats-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: var(--ats-primary);
    color: #fff;
    transition: all 0.15s ease;
}

.wz-footer .wz-btn-next:hover {
    background: var(--ats-primary-dark);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.wz-footer .wz-btn-next:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Pane header */
.wz-pane-header {
    margin-bottom: 20px;
}

.wz-pane-header h5 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ats-text);
    margin: 0 0 4px;
}

.wz-pane-header p {
    font-size: 0.85rem;
    color: var(--ats-text-secondary);
    margin: 0;
}

/* Modalidad pills */
.wz-pill-group {
    display: inline-flex;
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    overflow: hidden;
}

.wz-pill-group label {
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ats-text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    border-right: 1px solid var(--ats-border);
    user-select: none;
}

.wz-pill-group label:last-child { border-right: none; }

.wz-pill-group input { display: none; }

.wz-pill-group input:checked + span,
.wz-pill-group label:has(input:checked) {
    background: var(--ats-primary);
    color: #fff;
}

/* Contract type radio cards */
.wz-radio-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ats-text);
    transition: all 0.15s;
    background: var(--ats-surface);
}

.wz-radio-card:hover { border-color: var(--ats-primary); }

.wz-radio-card input[type="radio"] {
    accent-color: var(--ats-primary);
}

.wz-radio-card.selected {
    border-color: var(--ats-primary);
    background: var(--ats-primary-bg);
}

/* Settings-style row for capture / documents */
.wz-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ats-border-light);
    transition: background 0.1s;
}

.wz-setting-row:last-child { border-bottom: none; }

.wz-setting-row:hover { background: rgba(99, 102, 241, 0.02); }

.wz-setting-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--ats-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
    flex-shrink: 0;
}

.wz-setting-info {
    flex: 1;
    margin-left: 12px;
}

.wz-setting-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ats-text);
}

.wz-setting-desc {
    font-size: 0.75rem;
    color: var(--ats-text-muted);
    margin-top: 1px;
}

/* Team member card */
.wz-team-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--ats-border-light);
    border-radius: var(--ats-radius);
    margin-bottom: 10px;
    background: var(--ats-surface);
    transition: all 0.15s;
}

.wz-team-card:hover { border-color: var(--ats-primary-light); }

.wz-team-card.selected {
    border-color: var(--ats-primary);
    background: var(--ats-primary-bg);
}

.wz-team-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ats-primary), #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* Preview cards */
.wz-preview-block {
    background: var(--ats-bg);
    border: 1px solid var(--ats-border-light);
    border-radius: var(--ats-radius);
    padding: 20px;
    margin-bottom: 12px;
}

.wz-preview-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ats-text-muted);
    margin-bottom: 6px;
}

.wz-preview-value {
    font-size: 0.9rem;
    color: var(--ats-text);
    line-height: 1.5;
}

/* Screening card modern */
.wz-question-card {
    border: 1px solid var(--ats-border-light);
    border-radius: var(--ats-radius);
    padding: 20px;
    margin-bottom: 12px;
    background: var(--ats-surface);
    transition: all 0.15s;
    position: relative;
}

.wz-question-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 2px;
    background: var(--ats-primary);
}

.wz-question-card:hover { border-color: var(--ats-primary-light); }

.wz-question-card.is-dragging {
    opacity: 0.6;
    transform: rotate(1deg);
}

.wz-question-card.drag-over {
    border-color: var(--ats-primary);
    box-shadow: 0 0 0 3px var(--ats-primary-bg);
}

.wz-question-card.killer::before {
    background: var(--ats-danger);
}

.wz-question-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
}

/* Importance button group */
.wz-importance-group {
    display: inline-flex;
    border: 1px solid var(--ats-border);
    border-radius: 6px;
    overflow: hidden;
}

.wz-importance-group button {
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border: none;
    background: var(--ats-surface);
    color: var(--ats-text-muted);
    cursor: pointer;
    border-right: 1px solid var(--ats-border);
    transition: all 0.1s;
}

.wz-importance-group button:last-child { border-right: none; }
.wz-importance-group button:hover { background: var(--ats-bg); }

.wz-importance-group button.active {
    background: var(--ats-primary);
    color: #fff;
}

/* Validation error */
.wz-field-error {
    border-color: var(--ats-danger) !important;
    box-shadow: 0 0 0 3px var(--ats-danger-bg) !important;
}

.wz-error-msg {
    font-size: 0.72rem;
    color: var(--ats-danger);
    margin-top: 4px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ats-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ats-text-muted); }

/* ============================================
   TIMELINE DE VACANTE
   ============================================ */

/* Métricas rápidas */
.vac-timeline-metrics {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.vac-tl-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--ats-card-bg, #fff);
    border: 1px solid var(--ats-border);
    border-radius: 10px;
    padding: 12px 20px;
    min-width: 110px;
    flex: 1;
}
.vac-tl-metric-val {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ats-text);
    line-height: 1;
}
.vac-tl-metric-label {
    font-size: 0.7rem;
    color: var(--ats-text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Lista de eventos */
.vac-tl-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.vac-tl-group {
    margin-bottom: 24px;
}

.vac-tl-day-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ats-text-muted);
    padding: 4px 0 10px 0;
    border-bottom: 1px solid var(--ats-border-light, var(--ats-border));
    margin-bottom: 2px;
    text-transform: capitalize;
}

.vac-tl-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    align-items: flex-start;
    position: relative;
}

.vac-tl-item--alert .vac-tl-title {
    color: var(--ats-danger, #dc2626);
}

.vac-tl-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.vac-tl-body {
    flex: 1;
    min-width: 0;
}
.vac-tl-body--sep {
    border-bottom: 1px solid var(--ats-border-light, var(--ats-border));
    padding-bottom: 10px;
}

.vac-tl-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ats-text);
    line-height: 1.35;
}

.vac-tl-desc {
    font-size: 0.78rem;
    color: var(--ats-text-secondary, var(--ats-text-muted));
    margin-top: 2px;
    line-height: 1.45;
}

.vac-tl-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
    font-size: 0.7rem;
    color: var(--ats-text-muted);
}

.vac-tl-actor {
    color: var(--ats-primary, #3b82f6);
}

.vac-tl-badge-audit {
    background: var(--ats-primary-bg, #eff6ff);
    color: var(--ats-primary, #3b82f6);
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* Responsive */
@media (max-width: 640px) {
    .vac-timeline-metrics {
        gap: 8px;
    }
    .vac-tl-metric {
        min-width: 80px;
        padding: 10px 12px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   REPORTES — Analytics de Velocidad de Reclutamiento
   ═══════════════════════════════════════════════════════════════════════ */

/* ── KPI cards ─────────────────────────────────────────────────────── */
.rpt-kpi-card {
    background: var(--ats-surface, #fff);
    border: 1px solid var(--ats-border, #e5e7eb);
    border-radius: 12px;
    padding: 18px 20px;
    transition: box-shadow .15s;
}
.rpt-kpi-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }

.rpt-kpi-val {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ats-text, #111827);
}
.rpt-kpi-sm  { padding: 14px 16px; }
.rpt-kpi-val-sm {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ats-text, #111827);
}

/* ── Icon helpers ───────────────────────────────────────────────────── */
.rpt-icon-warning { color: var(--ats-warning, #f59e0b); }
.rpt-icon-primary { color: var(--ats-primary, #6366f1); }
.rpt-icon-info    { color: var(--ats-info, #06b6d4); }
.rpt-icon-success { color: var(--ats-success, #22c55e); }
.rpt-icon-danger  { color: var(--ats-danger, #ef4444); }

/* ── SLA badges ─────────────────────────────────────────────────────── */
.rpt-sla-badge {
    border-radius: 12px;
    padding: 14px 18px;
    text-align: center;
    border: 2px solid transparent;
}
.rpt-sla-green    { background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.25); }
.rpt-sla-yellow   { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.25); }
.rpt-sla-red      { background: rgba(239,68,68,.08);  border-color: rgba(239,68,68,.25); }
.rpt-sla-critical { background: rgba(239,68,68,.14);  border-color: rgba(239,68,68,.45); }

.rpt-sla-count {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
}
.rpt-sla-label { font-size: .75rem; font-weight: 600; margin-bottom: 2px; letter-spacing: .03em; text-transform: uppercase; }
.rpt-sla-sub   { font-size: .7rem; color: var(--ats-text-muted, #6b7280); margin-top: 2px; }

/* ── Section title ─────────────────────────────────────────────────── */
.rpt-section-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ats-text-muted, #6b7280);
    margin-bottom: 12px;
}

/* ── Detail tabs ─────────────────────────────────────────────────────  */
.rpt-tab-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: .875rem;
    font-weight: 500;
    color: var(--ats-text-muted, #6b7280);
    background: transparent;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.rpt-tab-btn:hover     { background: var(--ats-primary-bg, #eff6ff); color: var(--ats-primary, #6366f1); }
.rpt-tab-btn.active    { background: var(--ats-primary-bg, #eff6ff); color: var(--ats-primary, #6366f1);
                          border-color: var(--ats-primary, #6366f1); font-weight: 600; }

.rpt-tab-panel { animation: rptFadeIn .2s ease; }
@keyframes rptFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Loading row ────────────────────────────────────────────────────── */
.rpt-loading-row {
    padding: 20px 0;
    color: var(--ats-text-muted, #6b7280);
    font-size: .875rem;
    display: flex;
    align-items: center;
}

/* ── Bottleneck stage rows ───────────────────────────────────────────  */
.rpt-stage-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--ats-border, #e5e7eb);
}
.rpt-stage-row:last-child { border-bottom: none; }
.rpt-stage-hot .rpt-stage-name { color: var(--ats-warning, #f59e0b); }
.rpt-stage-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.rpt-stage-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.rpt-stage-name { font-size: .875rem; font-weight: 600; }
.rpt-stage-meta { font-size: .8rem; color: var(--ats-text-muted, #6b7280); }

.rpt-stage-bars   { display: flex; flex-direction: column; gap: 4px; }
.rpt-bar-row      { display: flex; align-items: center; gap: 8px; }
.rpt-bar-label    { font-size: .7rem; color: var(--ats-text-muted, #6b7280); min-width: 64px; }
.rpt-bar-bg       { flex: 1; height: 6px; background: var(--ats-border, #e5e7eb); border-radius: 4px; overflow: hidden; }
.rpt-bar-fill     { height: 100%; border-radius: 4px; transition: width .4s ease; }
.rpt-bar-val      { font-size: .7rem; font-weight: 600; min-width: 32px; text-align: right; }

/* ── Document rows ──────────────────────────────────────────────────── */
.rpt-doc-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--ats-border, #e5e7eb);
}
.rpt-doc-row:last-child { border-bottom: none; }

/* ── x-small utility ────────────────────────────────────────────────── */
.x-small { font-size: .7rem; }

/* ============================================
   PSICOMETRICOS HUB — Redesign v2
   Enterprise operations dashboard
   ============================================ */

/* ── V3 Command Center ── */
.psico-v3-hero {
    position: relative;
    overflow: hidden;
    border: none;
    border-bottom: 1px solid var(--ats-border);
    border-radius: 0;
    padding: 18px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    background: transparent;
    color: var(--ats-text);
    box-shadow: none;
}
.psico-v3-hero::after {
    content: none;
}
.psico-v3-hero-copy,
.psico-v3-hero-actions {
    position: relative;
    z-index: 1;
}
.psico-v3-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.psico-v3-title {
    font-size: clamp(1.45rem, 2.6vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -.04em;
    margin: 12px 0 8px;
}
.psico-v3-subtitle {
    max-width: 680px;
    color: var(--ats-text-secondary);
    font-size: .95rem;
    line-height: 1.55;
}

/* ── Resultado V3 por instrumento (modal RH) ── */
.psico-results-modal .modal-dialog {
    max-width: min(1280px, 96vw);
}
.psico-results-modal .modal-content {
    border: 1px solid var(--ats-border);
    border-radius: 16px;
    overflow: hidden;
}
.psico-results-body {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    padding: 16px;
}
.psico-v3-result-host {
    background: #ffffff;
    border: 1px solid var(--ats-border);
    border-radius: 14px;
    padding: 16px;
}
.psico-v3-surface {
    display: grid;
    gap: 10px;
}
.psico-v3-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.psico-v3-meta-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border: 1px solid #dbe4f0;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font-size: .76rem;
    font-weight: 600;
    line-height: 1.25;
    padding: 7px 12px;
}
.psico-v3-quality {
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    background: #fffdf5;
    padding: 11px 12px;
}
.psico-v3-quality-title {
    font-size: .76rem;
    font-weight: 800;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}
.psico-v3-quality-list {
    margin: 0;
    padding-left: 18px;
    color: #334155;
    font-size: .8rem;
    line-height: 1.45;
}
.psico-v3-quality-list li + li {
    margin-top: 4px;
}
.psico-v3-result-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
}
.psico-v3-score {
    border: 1px solid #bae6fd;
    border-radius: 10px;
    background: #f0f9ff;
    color: #0c4a6e;
    font-size: .85rem;
    font-weight: 600;
    padding: 8px 10px;
    margin-bottom: 10px;
}
.psico-v3-summary {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    font-size: .82rem;
    line-height: 1.45;
    padding: 10px 11px;
    margin-bottom: 10px;
}
.psico-v3-summary ul {
    margin: 6px 0 0 18px;
}
.psico-v3-section-title {
    font-size: .72rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 10px 0 7px;
}
.psico-v3-chart {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}
.psico-v3-dim-row {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    padding: 8px 10px;
}
.psico-v3-dim-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: .8rem;
    color: #0f172a;
    font-weight: 600;
}
.psico-v3-bar {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-top: 6px;
}
.psico-v3-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
}
.psico-v3-dim-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}
.psico-v3-dim-foot small {
    color: #64748b;
}
.psico-v3-semaforo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
    padding: 4px 8px;
    border: 1px solid transparent;
}
.psico-v3-semaforo-verde {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
}
.psico-v3-semaforo-amarillo {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}
.psico-v3-semaforo-rojo {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}
.psico-v3-semaforo-neutral {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #3730a3;
}
.psico-v3-disclaimer {
    color: #64748b;
    font-size: .75rem;
    margin: 0;
}
.psico-v3-cleaver-report {
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #fff;
    padding: 12px;
    margin-bottom: 10px;
}
.psico-v3-cleaver-head {
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 10px;
    padding-bottom: 8px;
}
.psico-v3-cleaver-quickread {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}
.psico-v3-cleaver-quickcard {
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    padding: 10px;
}
.psico-v3-cleaver-quickcard-title {
    font-size: .67rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}
.psico-v3-cleaver-quickcard-value {
    font-size: .86rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}
.psico-v3-cleaver-quickcard-detail {
    margin-top: 4px;
    font-size: .7rem;
    color: #475569;
    line-height: 1.4;
}
.psico-v3-cleaver-title {
    font-size: .94rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: .02em;
}
.psico-v3-cleaver-pattern {
    color: #1d4ed8;
    font-size: .76rem;
    font-weight: 700;
    margin-top: 2px;
    line-height: 1.45;
}
.psico-v3-cleaver-factorl {
    color: #64748b;
    font-size: .72rem;
    margin-top: 2px;
}
.psico-v3-cleaver-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
}
.psico-v3-cleaver-graphs {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    gap: 8px;
}
.psico-v3-cleaver-chart-col {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    padding: 6px 6px 4px;
}
.psico-v3-cleaver-chart-title {
    font-size: .67rem;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
}
.psico-v3-cleaver-chart-sub {
    font-size: .62rem;
    color: #64748b;
    text-align: center;
    margin-bottom: 2px;
}
.psico-v3-cleaver-line {
    width: 100%;
    height: auto;
    display: block;
}
.psico-v3-cleaver-text h4 {
    font-size: .73rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: .03em;
    text-transform: uppercase;
    margin: 0 0 4px;
}
.psico-v3-cleaver-text p {
    margin: 0 0 8px;
    color: #334155;
    font-size: .75rem;
    line-height: 1.45;
}
.psico-v3-cleaver-combo {
    color: #334155;
    font-size: .73rem;
    line-height: 1.4;
    margin-bottom: 6px;
}
.psico-v3-cleaver-signals {
    border: 1px solid #fde68a;
    border-radius: 10px;
    background: #fffdf5;
    padding: 9px 10px;
    margin: 0 0 8px;
}
.psico-v3-cleaver-signals-title {
    font-size: .68rem;
    font-weight: 800;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 5px;
}
.psico-v3-cleaver-signal-item {
    font-size: .73rem;
    color: #334155;
    line-height: 1.45;
    margin-bottom: 4px;
}
.psico-v3-cleaver-signal-item:last-child {
    margin-bottom: 0;
}
.psico-v3-cleaver-strip {
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
    padding-top: 8px;
}
.psico-v3-cleaver-strip h5 {
    font-size: .72rem;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin: 0 0 3px;
}
.psico-v3-cleaver-strip ul {
    margin: 0;
    padding-left: 18px;
}
.psico-v3-cleaver-strip li {
    color: #334155;
    font-size: .74rem;
    line-height: 1.45;
    margin: 0 0 4px;
}
.psico-v3-cleaver-strip li:last-child {
    margin-bottom: 0;
}
/* Pattern explanation */
.psico-v3-cleaver-explanation {
    background: #f0f7ff;
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 8px 0;
    color: #1e3a5f;
    font-size: .78rem;
    line-height: 1.5;
}
.psico-v3-cleaver-fitrows {
    display: grid;
    gap: 6px;
    margin-top: 6px;
}
.psico-v3-cleaver-fitrow {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 7px 9px;
}
.psico-v3-cleaver-fitrow-name {
    font-size: .72rem;
    font-weight: 800;
    color: #0f172a;
}
.psico-v3-cleaver-fitrow-metrics {
    font-size: .71rem;
    color: #475569;
    text-align: right;
}
/* Recommendations block */
.psico-v3-recommendations {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 10px 0;
    background: #fafbfc;
}
.psico-v3-recommendations-title {
    font-size: .82rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
}
.psico-v3-rec-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 5px;
    font-size: .74rem;
    line-height: 1.4;
}
.psico-v3-rec-label {
    font-weight: 700;
    color: #475569;
    min-width: 140px;
}
.psico-v3-rec-value {
    color: #334155;
    flex: 1;
}
.edo-report { display: flex; flex-direction: column; gap: 14px; margin-bottom: 10px; color: #0f172a; }
.edo-hero { border-radius: 18px; padding: 18px 20px; display: flex; justify-content: space-between; gap: 18px; align-items: stretch; color: #fff; box-shadow: 0 16px 38px rgba(15,23,42,.16); }
.edo-hero-low { background: radial-gradient(circle at 15% 20%, rgba(255,255,255,.22), transparent 32%), linear-gradient(135deg, #065f46 0%, #10b981 100%); }
.edo-hero-medium { background: radial-gradient(circle at 15% 20%, rgba(255,255,255,.2), transparent 32%), linear-gradient(135deg, #92400e 0%, #f59e0b 100%); }
.edo-hero-high { background: radial-gradient(circle at 15% 20%, rgba(255,255,255,.18), transparent 32%), linear-gradient(135deg, #7f1d1d 0%, #ef4444 100%); }
.edo-hero-main { flex: 1; min-width: 0; }
.edo-kicker { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; opacity: .82; }
.edo-title { font-size: clamp(1.35rem, 2vw, 1.9rem); font-weight: 900; line-height: 1.05; margin-top: 4px; }
.edo-sub { font-size: .82rem; opacity: .92; margin-top: 8px; line-height: 1.45; max-width: 760px; }
.edo-hero-kpis { display: grid; grid-template-columns: repeat(3, minmax(82px, 1fr)); gap: 8px; min-width: 310px; }
.edo-kpi { border: 1px solid rgba(255,255,255,.28); border-radius: 14px; padding: 10px 12px; background: rgba(255,255,255,.13); backdrop-filter: blur(4px); }
.edo-kpi span { display: block; font-size: .62rem; text-transform: uppercase; letter-spacing: .07em; opacity: .78; }
.edo-kpi strong { display: block; font-size: 1.05rem; margin-top: 4px; }
.edo-summary-grid { display: grid; grid-template-columns: minmax(280px, 1.35fr) minmax(230px, .65fr); gap: 12px; }
.edo-grid { display: grid; grid-template-columns: minmax(260px, 1.2fr) minmax(220px, .8fr); gap: 12px; }
.edo-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px 16px; box-shadow: 0 8px 22px rgba(15,23,42,.04); }
.edo-card-accent { border-left: 5px solid #2563eb; }
.edo-card-title { font-size: .72rem; font-weight: 900; color: #0f172a; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.edo-summary-text { margin: 0; color: #334155; font-size: .82rem; line-height: 1.55; }
.edo-pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.edo-pill-row span { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 999px; color: #475569; font-size: .72rem; padding: 6px 10px; }
.edo-pill-row strong { color: #0f172a; }
.edo-section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 4px 2px -2px; }
.edo-section-head span { display: block; color: #64748b; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.edo-section-head strong { display: block; color: #0f172a; font-size: 1rem; margin-top: 2px; }
.edo-section-head p { margin: 0; color: #64748b; font-size: .76rem; line-height: 1.35; max-width: 410px; text-align: right; }
.edo-factor-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.edo-factor-grid-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.edo-factor-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 15px; padding: 13px; display: flex; flex-direction: column; gap: 10px; min-height: 210px; box-shadow: 0 8px 22px rgba(15,23,42,.04); }
.edo-factor-card-compact { min-height: 170px; }
.edo-factor-top { display: flex; gap: 9px; align-items: flex-start; }
.edo-factor-top span { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: #eff6ff; color: #1d4ed8; font-size: .68rem; font-weight: 900; }
.edo-factor-top strong { color: #0f172a; font-size: .86rem; line-height: 1.2; }
.edo-factor-score { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.edo-factor-score small { display: block; color: #94a3b8; font-size: .62rem; text-transform: uppercase; letter-spacing: .05em; }
.edo-factor-score b { color: #0f172a; font-size: 1rem; }
.edo-track { height: 9px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.edo-track span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22c55e, #f59e0b 58%, #ef4444); }
.edo-factor-card p { margin: 0; color: #475569; font-size: .74rem; line-height: 1.42; }
.edo-explain-grid { display: grid; grid-template-columns: minmax(240px, .85fr) minmax(280px, 1.15fr); gap: 14px; }
.edo-leiter-list { display: flex; flex-direction: column; gap: 8px; }
.edo-leiter-row { display: grid; grid-template-columns: minmax(140px, 1fr) auto; gap: 10px; align-items: center; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; background: #f8fafc; }
.edo-leiter-row strong { display: block; font-size: .8rem; color: #0f172a; }
.edo-leiter-row span { color: #64748b; font-size: .7rem; }
.edo-leiter-values { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.edo-leiter-values b { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 10px; background: #1e293b; color: #fff; font-size: .8rem; }
.edo-reco-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.edo-reco { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; }
.edo-reco strong { display: block; font-size: .78rem; color: #0f172a; margin-bottom: 6px; }
.edo-reco ul { margin: 0; padding-left: 16px; color: #475569; font-size: .74rem; line-height: 1.45; }
.edo-note { color: #64748b; font-size: .72rem; line-height: 1.4; margin: 10px 0 0; }
.edo-bar-row { margin-bottom: 9px; }
.edo-bar-row:last-child { margin-bottom: 0; }
.edo-bar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .78rem; color: #334155; font-weight: 700; margin-bottom: 4px; }
.edo-metric { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #f1f5f9; padding: 8px 0; font-size: .76rem; }
.edo-metric:last-child { border-bottom: none; }
.edo-metric span { color: #64748b; }
.edo-metric strong { color: #0f172a; text-align: right; }
.edo-table-wrap { overflow-x: auto; }
.edo-table { width: 100%; border-collapse: collapse; font-size: .74rem; }
.edo-table th { text-align: left; color: #475569; background: #f8fafc; border-bottom: 1px solid #e2e8f0; padding: 8px; white-space: nowrap; }
.edo-table td { border-bottom: 1px solid #f1f5f9; padding: 8px; color: #334155; vertical-align: top; }
.edo-level { display: inline-flex; border-radius: 999px; background: #eef2ff; color: #3730a3; padding: 4px 8px; font-weight: 900; font-size: .64rem; white-space: nowrap; font-style: normal; }
.edo-level-very-high { background: #fee2e2; color: #991b1b; }
.edo-level-high { background: #ffedd5; color: #9a3412; }
.edo-level-medium { background: #fef3c7; color: #92400e; }
.edo-level-low { background: #dcfce7; color: #166534; }
.edo-level-neutral { background: #eef2ff; color: #3730a3; }

/* ═════════════════════════════════════════
   BDI-II Depression Inventory
   ═════════════════════════════════════════ */
.bdi2-report { display: flex; flex-direction: column; gap: 14px; margin-bottom: 10px; color: #0f172a; }
.bdi2-hero { border-radius: 18px; padding: 18px 20px; display: flex; align-items: stretch; gap: 16px; color: #fff; box-shadow: 0 16px 38px rgba(15,23,42,.16); }
.bdi2-hero-low { background: radial-gradient(circle at 14% 20%, rgba(255,255,255,.22), transparent 34%), linear-gradient(135deg, #285f56, #4f9f8d); }
.bdi2-hero-medium { background: radial-gradient(circle at 14% 20%, rgba(255,255,255,.2), transparent 34%), linear-gradient(135deg, #94630b, #d4a017); }
.bdi2-hero-medium_high { background: radial-gradient(circle at 14% 20%, rgba(255,255,255,.18), transparent 34%), linear-gradient(135deg, #a34817, #e0732a); }
.bdi2-hero-high { background: radial-gradient(circle at 14% 20%, rgba(255,255,255,.18), transparent 34%), linear-gradient(135deg, #7f1d1d, #c44b4b); }
.bdi2-hero-icon { flex: 0 0 44px; }
.bdi2-hero-content { flex: 1; }
.bdi2-hero-kicker { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.bdi2-hero-score { font-size: 2.4rem; font-weight: 900; line-height: 1.05; margin-top: 4px; }
.bdi2-hero-score small { font-size: 55%; font-weight: 600; opacity: .7; }
.bdi2-hero-level { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 5px 14px; border-radius: 99px; font-size: .82rem; font-weight: 700; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); }
.bdi2-hero-dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; flex-shrink: 0; }
.bdi2-hero-kpis { display: grid; grid-template-columns: repeat(3, minmax(78px, 1fr)); gap: 8px; min-width: 300px; }
.bdi2-kpi { border: 1px solid rgba(255,255,255,.28); border-radius: 14px; padding: 10px 12px; background: rgba(255,255,255,.13); }
.bdi2-kpi span { display: block; font-size: .62rem; text-transform: uppercase; letter-spacing: .07em; opacity: .78; }
.bdi2-kpi strong { display: block; font-size: 1rem; margin-top: 4px; }

.bdi2-alert-critical { display: flex; align-items: flex-start; gap: 12px; background: #fef2f2; border: 1px solid #fca5a5; border-left: 4px solid #dc2626; border-radius: 12px; padding: 14px 16px; color: #991b1b; margin: 0; }
.bdi2-alert-icon { flex: 0 0 22px; margin-top: 2px; color: #dc2626; }
.bdi2-alert-body strong { display: block; font-size: .82rem; margin-bottom: 4px; }
.bdi2-alert-body p { font-size: .78rem; color: #7f1d1d; margin: 0; line-height: 1.45; }
.bdi2-main-grid { display: grid; grid-template-columns: minmax(280px, 1.3fr) minmax(230px, .7fr); gap: 12px; }
.bdi2-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px 16px; box-shadow: 0 8px 22px rgba(15,23,42,.04); }
.bdi2-card-accent { border-left: 5px solid #8b5cf6; }
.bdi2-card-title { font-size: .72rem; font-weight: 900; color: #0f172a; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.bdi2-card p { color: #334155; font-size: .82rem; line-height: 1.55; margin: 0; }
.bdi2-metric { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #f1f5f9; padding: 8px 0; font-size: .76rem; }
.bdi2-metric:last-child { border-bottom: none; }
.bdi2-metric span { color: #64748b; }
.bdi2-metric strong { color: #0f172a; text-align: right; }
.bdi2-explain-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bdi2-explain-list div { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; color: #475569; font-size: .76rem; line-height: 1.45; }
.bdi2-section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 4px 2px -2px; }
.bdi2-section-head span { display: block; color: #64748b; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.bdi2-section-head strong { display: block; color: #0f172a; font-size: 1rem; margin-top: 2px; }
.bdi2-section-head p { margin: 0; color: #64748b; font-size: .76rem; line-height: 1.35; max-width: 410px; text-align: right; }
.bdi2-symptom-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.bdi2-symptom-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px; }
.bdi2-symptom-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.bdi2-symptom-head strong { color: #0f172a; font-size: .78rem; line-height: 1.25; }
.bdi2-symptom-head span { font-size: .68rem; font-weight: 900; text-transform: uppercase; }
.bdi2-symptom-score { color: #334155; font-size: .9rem; font-weight: 900; margin-top: 10px; }
.bdi2-symptom-track { height: 8px; border-radius: 999px; background: #f1f5f9; overflow: hidden; margin-top: 7px; }
.bdi2-symptom-track span { display: block; height: 100%; border-radius: 999px; }
.bdi2-reco-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bdi2-reco { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; }
.bdi2-reco strong { display: block; font-size: .78rem; color: #0f172a; margin-bottom: 6px; }
.bdi2-reco ul { margin: 0; padding-left: 16px; color: #475569; font-size: .74rem; line-height: 1.45; }
.bdi2-note { background: #f8fafc; border: 1px solid #e2e8f0; border-left: 4px solid #64748b; border-radius: 12px; padding: 12px 14px; color: #475569; font-size: .76rem; line-height: 1.45; }
.bdi2-note strong { color: #0f172a; }

.bdi2-gauge { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px 18px; }
.bdi2-gauge-header { display: flex; justify-content: space-between; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin-bottom: 10px; }
.bdi2-gauge-bar { position: relative; height: 14px; border-radius: 99px; background: #f1f5f9; overflow: visible; margin-bottom: 8px; }
.bdi2-gauge-bar > span { position: absolute; top: 0; height: 100%; border-radius: 0; }
.bdi2-gauge-bar > span:first-of-type { border-radius: 99px 0 0 99px; }
.bdi2-gauge-bar > span:last-of-type { border-radius: 0 99px 99px 0; }
.bdi2-gauge-marker { position: absolute; top: -5px; width: 3px; height: 24px; background: #1e293b; border-radius: 2px; z-index: 2; transform: translateX(-50%); }
.bdi2-gauge-label { position: absolute; top: 16px; font-size: .64rem; color: #94a3b8; transform: translateX(-50%); white-space: nowrap; }
.bdi2-gauge-label-active { color: #1e293b; font-weight: 700; }
.bdi2-gauge-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.bdi2-gauge-legend-item { display: flex; align-items: center; gap: 6px; font-size: .72rem; color: #64748b; }
.bdi2-gauge-legend-item em { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.bdi2-gauge-legend-active { font-weight: 700; color: #1e293b; }

.bdi2-score-table { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; background: #fff; }
.bdi2-score-row { display: grid; grid-template-columns: 150px auto 180px; gap: 12px; padding: 10px 12px; align-items: center; border-bottom: 1px solid #f1f5f9; font-size: .78rem; }
.bdi2-score-row:last-child { border-bottom: none; }
.bdi2-score-row-head { background: #f8fafc; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .04em; font-size: .66rem; }
.bdi2-score-label { color: #475569; font-weight: 600; }
.bdi2-score-value { color: #1e293b; font-weight: 600; }
.bdi2-score-range { color: #94a3b8; font-size: .7rem; text-align: right; line-height: 1.35; }

.bdi2-indicators { margin-top: 0; }
.bdi2-indicators-title { font-size: .82rem; font-weight: 800; color: #0f172a; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.bdi2-indicators-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.bdi2-indicator-card { background: #fff; border: 1px solid #e2e8f0; border-left: 4px solid #6366f1; border-radius: 10px; padding: 10px 12px; }
.bdi2-indicator-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; color: #475569; }
.bdi2-indicator-head span { font-size: .78rem; font-weight: 700; color: #0f172a; }
.bdi2-indicator-card p { font-size: .74rem; color: #475569; line-height: 1.45; margin: 0; }
@media (max-width: 768px) {
    .bdi2-score-row { grid-template-columns: 1fr 1fr; gap: 6px; }
    .bdi2-score-range { grid-column: 1 / -1; text-align: left; }
    .bdi2-indicators-grid, .bdi2-main-grid, .bdi2-explain-list, .bdi2-symptom-grid, .bdi2-reco-grid { grid-template-columns: 1fr; }
    .bdi2-hero { flex-direction: column; text-align: center; }
    .bdi2-hero-kpis { min-width: 0; width: 100%; grid-template-columns: 1fr; text-align: left; }
    .bdi2-section-head { align-items: flex-start; flex-direction: column; }
    .bdi2-section-head p { text-align: left; }
}

/* ═════════════════════════════════════════
   Barsit — Prueba de aptitud intelectual
   ═════════════════════════════════════════ */
.barsit-report { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.barsit-hero { background: linear-gradient(135deg, #1e293b, #334155); border-radius: 14px; padding: 18px 20px; display: flex; align-items: center; gap: 16px; color: #fff; }
.barsit-hero-icon { flex: 0 0 48px; color: #38bdf8; }
.barsit-hero-content { flex: 1; }
.barsit-hero-kicker { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.barsit-hero-score { font-size: 2.2rem; font-weight: 900; line-height: 1.05; margin-top: 4px; }
.barsit-hero-score small { font-size: 50%; font-weight: 600; opacity: .55; }
.barsit-hero-level { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 5px 14px; border-radius: 99px; font-size: .82rem; font-weight: 700; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); }
.barsit-hero-dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; flex-shrink: 0; }
.barsit-hero-stats { flex: 0 0 auto; text-align: center; border-left: 1px solid rgba(255,255,255,.15); padding-left: 18px; }
.barsit-hero-stat-val { display: block; font-size: 1.35rem; font-weight: 900; color: #38bdf8; }
.barsit-hero-stat-label { display: block; font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; opacity: .65; margin-top: 3px; }

.barsit-dim-section { border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; padding: 14px; box-shadow: 0 10px 28px rgba(15,23,42,.05); }
.barsit-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.barsit-section-head span { color: #0f172a; font-size: .9rem; font-weight: 800; }
.barsit-section-head p { color: #64748b; font-size: .75rem; line-height: 1.35; margin: 0; max-width: 420px; text-align: right; }
.barsit-dim-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.barsit-dim-card { border: 1px solid #e2e8f0; border-radius: 12px; background: linear-gradient(180deg,#fff,#f8fafc); padding: 12px; min-width: 0; }
.barsit-dim-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 34px; }
.barsit-dim-name { color: #0f172a; font-size: .8rem; font-weight: 800; line-height: 1.25; }
.barsit-dim-level { display: inline-flex; border-radius: 999px; padding: 3px 9px; font-weight: 800; font-size: .68rem; border: 1px solid; white-space: nowrap; }
.barsit-dim-metrics { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 10px 0 8px; }
.barsit-dim-metrics strong { color: #0f172a; font-size: 1.35rem; font-weight: 900; line-height: 1; }
.barsit-dim-metrics span { color: #64748b; font-size: .72rem; font-weight: 700; text-align: right; }
.barsit-insight { margin-top: 12px; border-radius: 10px; background: #f8fafc; border: 1px solid #e2e8f0; color: #475569; font-size: .78rem; line-height: 1.45; padding: 10px 12px; }
.barsit-insight strong, .barsit-insight b { color: #0f172a; }
.barsit-bar { height: 9px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.barsit-bar span { display: block; height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.4,0,.2,1); }

@media (max-width: 768px) {
    .barsit-hero { flex-direction: column; text-align: center; }
    .barsit-hero-stats { border-left: none; border-top: 1px solid rgba(255,255,255,.15); padding: 12px 0 0; }
    .barsit-section-head { flex-direction: column; gap: 4px; }
    .barsit-section-head p { text-align: left; }
    .barsit-dim-grid { grid-template-columns: 1fr; }
}

/* ═════════════════════════════════════════
   Raven — Matrices Progresivas (SPM)
   ═════════════════════════════════════════ */
.raven-report { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.raven-hero { background: linear-gradient(135deg, #1a1025, #2d1b3d); border-radius: 14px; padding: 18px 20px; display: flex; align-items: center; gap: 16px; color: #fff; }
.raven-hero-icon { flex: 0 0 48px; color: #a78bfa; }
.raven-hero-content { flex: 1; }
.raven-hero-kicker { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.raven-hero-score { font-size: 2.2rem; font-weight: 900; line-height: 1.05; margin-top: 4px; }
.raven-hero-score small { font-size: 50%; font-weight: 600; opacity: .55; }
.raven-hero-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.raven-hero-level { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 99px; font-size: .82rem; font-weight: 700; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); }
.raven-hero-dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; flex-shrink: 0; }
.raven-hero-percentile { font-size: .76rem; opacity: .9; padding: 4px 12px; border-radius: 99px; background: rgba(167,139,250,.18); border: 1px solid rgba(167,139,250,.3); color: #c4b5fd; white-space: nowrap; }
.raven-hero-percentile strong { color: #ddd6fe; margin: 0 4px; }
.raven-hero-stats { flex: 0 0 auto; text-align: center; border-left: 1px solid rgba(255,255,255,.15); padding-left: 18px; }
.raven-hero-stat-val { display: block; font-size: 1.35rem; font-weight: 900; color: #a78bfa; }
.raven-hero-stat-label { display: block; font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; opacity: .65; margin-top: 3px; }

/* Raven combined table + inline bars */
.raven-table { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; background: #fff; }
.raven-table-header { display: grid; grid-template-columns: 100px minmax(150px,1fr) 70px 90px; gap: 10px; padding: 9px 12px; background: #f8fafc; font-size: .66rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .04em; align-items: center; }
.raven-table-row { display: grid; grid-template-columns: 100px minmax(150px,1fr) 70px 90px; gap: 10px; padding: 11px 12px; align-items: center; border-bottom: 1px solid #f1f5f9; font-size: .78rem; }
.raven-table-row:last-child { border-bottom: none; }
.raven-table-series { font-weight: 700; color: #0f172a; }
.raven-table-bar-cell { display: flex; align-items: center; gap: 8px; }
.raven-table-bar { flex: 1; height: 8px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.raven-table-bar span { display: block; height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.4,0,.2,1); }
.raven-table-pct { font-size: .78rem; font-weight: 700; color: #334155; min-width: 36px; text-align: right; }
.raven-table-score { font-weight: 600; color: #334155; font-variant-numeric: tabular-nums; }
.raven-table-level { font-weight: 700; font-size: .74rem; }
.raven-discrepancy { border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; background: #fff; }
.raven-discrepancy-title { padding: 10px 12px; background: #f8fafc; color: #0f172a; font-size: .78rem; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid #e2e8f0; }
.raven-discrepancy-matrix { display: grid; grid-template-columns: minmax(110px, 1.2fr) repeat(5, minmax(58px, 1fr)); }
.raven-discrepancy-matrix > * { padding: 9px 10px; border-bottom: 1px solid #e2e8f0; border-right: 1px solid #eef2f7; color: #334155; font-size: .74rem; text-align: center; font-variant-numeric: tabular-nums; }
.raven-discrepancy-matrix > *:nth-child(6n) { border-right: none; }
.raven-discrepancy-matrix span { background: #fbfdff; color: #0f172a; font-weight: 850; line-height: 1.25; }
.raven-discrepancy-label { text-align: left; font-weight: 850; color: #0f172a; background: #fff; }
.raven-discrepancy-matrix strong, .raven-discrepancy-matrix em { font-style: normal; font-weight: 800; }
.raven-discrepancy-above_expected { color: #166534 !important; background: #f0fdf4; }
.raven-discrepancy-below_expected { color: #9a3412 !important; background: #fff7ed; }
.raven-discrepancy-expected { color: #334155 !important; }
.raven-discrepancy-note { margin: 0; padding: 9px 12px; border-top: 1px solid #f1f5f9; color: #64748b; font-size: .7rem; line-height: 1.45; background: #fcfcfd; }
.raven-insight-grid { display: grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 12px; }
.raven-insight-card { border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; background: #fff; }
.raven-insight-good { background: #f0fdf4; border-color: #bbf7d0; }
.raven-insight-warn { background: #fff7ed; border-color: #fed7aa; }
.raven-insight-wide { grid-column: 1 / -1; background: #f8fafc; }
.raven-insight-card h5 { margin: 0 0 9px; font-size: .74rem; font-weight: 850; color: #0f172a; text-transform: uppercase; letter-spacing: .05em; }
.raven-insight-card ul { margin: 0; padding-left: 17px; color: #334155; font-size: .76rem; line-height: 1.5; }
.raven-insight-card li + li { margin-top: 6px; }
.raven-insight-card li strong { display: block; color: #0f172a; }
.raven-insight-card li span { display: block; }
.raven-disclaimer { color: #94a3b8; font-size: .74rem; text-align: center; margin: 0; padding: 4px 0; }

@media (max-width: 768px) {
    .raven-hero { flex-direction: column; text-align: center; }
    .raven-hero-stats { border-left: none; border-top: 1px solid rgba(255,255,255,.15); padding: 12px 0 0; }
    .raven-hero-meta { justify-content: center; }
    .raven-table-header, .raven-table-row { grid-template-columns: 80px 1fr 60px; }
    .raven-table-level { display: none; }
    .raven-discrepancy-matrix { grid-template-columns: minmax(92px, 1.1fr) repeat(5, minmax(42px, 1fr)); overflow-x: auto; }
    .raven-discrepancy-matrix > * { padding: 8px 6px; font-size: .68rem; }
    .raven-insight-grid { grid-template-columns: 1fr; }
    .raven-insight-wide { grid-column: auto; }
}
.edo-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 10px; }
.edo-detail { background: #fff; border: 1px solid #e2e8f0; border-left: 4px solid #6366f1; border-radius: 12px; padding: 11px 12px; }
.edo-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.edo-detail-head strong { flex: 1; color: #0f172a; font-size: .8rem; }
.edo-detail-head em { font-style: normal; font-size: .66rem; font-weight: 800; color: #475569; background: #f8fafc; border-radius: 999px; padding: 3px 7px; }
.edo-icon { width: 26px; height: 26px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: #f1f5f9; color: #0f172a; font-size: .62rem; font-weight: 900; }
.edo-detail p { margin: 0; color: #475569; font-size: .74rem; line-height: 1.45; }
@media (max-width: 768px) {
    .edo-hero { align-items: flex-start; flex-direction: column; }
    .edo-hero-kpis { width: 100%; min-width: 0; grid-template-columns: 1fr; }
    .edo-grid, .edo-detail-grid, .edo-summary-grid, .edo-explain-grid, .edo-factor-grid, .edo-factor-grid-compact, .edo-reco-grid { grid-template-columns: 1fr; }
    .edo-section-head { align-items: flex-start; flex-direction: column; }
    .edo-section-head p { text-align: left; }
    .edo-leiter-row { grid-template-columns: 1fr; }
    .edo-leiter-values { justify-content: flex-start; }
}
/* ═══════════════════════════════════════════
   MMPI-2-RF Premium Enterprise Design
   ═══════════════════════════════════════════ */
.mmpi2-report { display: flex; flex-direction: column; gap: 14px; font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; }

/* ── Hero ── */
.mmpi2-hero { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); border-radius: 12px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mmpi2-hero-main { display: flex; flex-direction: column; gap: 8px; }
.mmpi2-hero-status { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; padding: 6px 16px; border-radius: 99px; }
.mmpi2-hero-ok { background: rgba(52,211,153,0.15); color: #34d399; }
.mmpi2-hero-warn { background: rgba(251,191,36,0.15); color: #fbbf24; }
.mmpi2-hero-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.mmpi2-hero-meta span { font-size: .68rem; color: #cbd5e1; background: rgba(255,255,255,0.06); border-radius: 999px; padding: 5px 9px; }
.mmpi2-hero-kpis { display: flex; gap: 6px; flex-wrap: wrap; }
.mmpi2-kpi { display: flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 8px; font-size: .66rem; font-weight: 600; }
.mmpi2-kpi-ok { background: rgba(255,255,255,0.06); color: #cbd5e1; }
.mmpi2-kpi-warn { background: rgba(251,191,36,0.12); color: #fbbf24; }
.mmpi2-kpi-dot { width: 7px; height: 7px; border-radius: 99px; display: inline-block; flex-shrink: 0; }
.mmpi2-kpi-dot-ok { background: #34d399; }
.mmpi2-kpi-dot-warn { background: #fbbf24; }
.mmpi2-kpi-label { opacity: .8; }
.mmpi2-kpi-val { margin-left: 2px; }

/* ── Grid ── */
.mmpi2-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.3fr); gap: 14px; }
.mmpi2-col-left { display: flex; flex-direction: column; gap: 14px; }
.mmpi2-col-right { display: flex; flex-direction: column; gap: 14px; }

/* ── Cards ── */
.mmpi2-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 16px; }
.mmpi2-card-title { font-size: .72rem; font-weight: 700; color: #0f172a; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #f1f5f9; }
.mmpi2-card-subtitle { font-size: .72rem; font-weight: 700; color: #1e293b; margin: 12px 0 8px; }

/* ── Validity rows ── */
.mmpi2-vrow { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid #f8fafc; font-size: .7rem; line-height: 1.4; }
.mmpi2-vrow:last-child { border-bottom: none; }
.mmpi2-vrow-icon { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 99px; display: flex; align-items: center; justify-content: center; font-size: .65rem; font-weight: 700; }
.mmpi2-vrow-icon-ok { background: #ecfdf5; color: #10b981; }
.mmpi2-vrow-icon-warn { background: #fef3c7; color: #d97706; }
.mmpi2-vrow-text { color: #475569; }
.mmpi2-vrow-text strong { color: #1e293b; }

/* ── MMPI data cards ── */
.mmpi2-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.mmpi2-data-item { border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.mmpi2-data-item span { font-size: .62rem; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.mmpi2-data-item strong { font-size: .78rem; color: #0f172a; }
.mmpi2-mini-list { display: flex; flex-direction: column; gap: 8px; }
.mmpi2-mini-item { font-size: .72rem; line-height: 1.45; color: #475569; border-top: 1px solid #f1f5f9; padding-top: 8px; }
.mmpi2-mini-item:first-child { border-top: none; padding-top: 0; }
.mmpi2-summary-text { font-size: .72rem; line-height: 1.5; color: #475569; margin-top: 10px; }

/* ── Bars ── */
.mmpi2-bar { border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: #f8fafc; border: 1px solid #e2e8f0; }
.mmpi2-bar:last-child { margin-bottom: 0; }
.mmpi2-bar-info { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.mmpi2-bar-copy { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.mmpi2-bar-name { font-size: .72rem; font-weight: 700; color: #1e293b; }
.mmpi2-bar-desc { font-size: .64rem; color: #64748b; line-height: 1.45; }
.mmpi2-bar-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 86px; }
.mmpi2-bar-score { font-size: .7rem; font-weight: 700; color: #334155; }
.mmpi2-bar-level { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.mmpi2-bar-track { position: relative; height: 6px; background: #e2e8f0; border-radius: 99px; overflow: visible; }
.mmpi2-bar-track span { display: block; height: 100%; border-radius: 99px; transition: width .3s ease; }
.mmpi2-bar-track em { position: absolute; top: -3px; bottom: -3px; width: 1px; background: #cbd5e1; opacity: .7; }
.mmpi2-bar-note { margin-top: 7px; font-size: .64rem; color: #475569; line-height: 1.45; }
.mmpi2-band-low { color: #94a3b8; }
.mmpi2-band-expected { color: #3b82f6; }
.mmpi2-band-elevated { color: #f59e0b; }
.mmpi2-band-high { color: #ef4444; }

@media (max-width: 768px) {
    .mmpi2-grid { grid-template-columns: 1fr; }
    .mmpi2-hero { flex-direction: column; align-items: flex-start; }
    .mmpi2-hero-kpis { width: 100%; }
    .mmpi2-data-grid { grid-template-columns: 1fr; }
    .mmpi2-bar-info { flex-direction: column; }
    .mmpi2-bar-meta { align-items: flex-start; min-width: 0; }
}
.psico-v3-disc-wrap {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
    gap: 12px;
    margin-bottom: 10px;
}
.psico-v3-disc-panel,
.psico-v3-disc-context {
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #fff;
    padding: 10px;
}
.psico-v3-disc-panel-title {
    font-size: .78rem;
    font-weight: 700;
    color: #0c4a6e;
    margin-bottom: 8px;
}
.psico-v3-disc-canvas-wrap {
    position: relative;
    min-height: 260px;
}
.psico-v3-disc-canvas-wrap canvas {
    width: 100% !important;
    height: 260px !important;
}
.psico-v3-predominant-card {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    padding: 9px;
    margin-bottom: 9px;
}
.psico-v3-predominant-kicker {
    color: #64748b;
    font-size: .67rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.psico-v3-predominant-name {
    color: #0f172a;
    font-size: .92rem;
    font-weight: 700;
}
.psico-v3-predominant-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}
.psico-v3-disc-legend-title {
    color: #0f172a;
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: 7px;
}
.psico-v3-disc-legend-row {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) auto auto auto;
    gap: 8px;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    padding: 7px 8px;
    margin-bottom: 6px;
}
.psico-v3-disc-legend-row.is-predominant {
    border-color: #38bdf8;
    background: #f0f9ff;
}
.psico-v3-disc-legend-name {
    font-size: .75rem;
    font-weight: 700;
    color: #0f172a;
}
.psico-v3-disc-legend-score {
    font-size: .74rem;
    font-weight: 700;
    color: #0f172a;
}
.psico-v3-disc-legend-level {
    font-size: .72rem;
    color: #64748b;
}
@media (max-width: 992px) {
    .psico-v3-cleaver-quickread {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .psico-v3-cleaver-main {
        grid-template-columns: 1fr;
    }
    .psico-v3-cleaver-graphs {
        grid-template-columns: 1fr;
    }
    .psico-v3-disc-wrap {
        grid-template-columns: 1fr;
    }
}
.psico-v3-hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    min-width: 245px;
    gap: 18px;
}
.psico-v3-trust-grid {
    display: grid;
    gap: 8px;
    width: 100%;
}
.psico-v3-trust-grid span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 12px;
    background: rgba(255,255,255,.10);
    color: rgba(255,255,255,.86);
    font-size: .76rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}
.psico-governance-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.psico-governance-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius);
    background: linear-gradient(180deg, var(--ats-surface), var(--ats-bg));
}
.psico-governance-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--ats-accent);
    background: var(--ats-accent-bg);
}
.psico-governance-item strong {
    display: block;
    color: var(--ats-text);
    font-size: .82rem;
    margin-bottom: 2px;
}
.psico-governance-item small {
    display: block;
    color: var(--ats-text-muted);
    line-height: 1.45;
}

/* ── KPI Stat Row ── */
.psico-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}
.psico-kpi {
    background: var(--ats-surface);
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow .2s, transform .15s;
    cursor: default;
}
.psico-kpi:hover {
    box-shadow: var(--ats-shadow-md);
    transform: translateY(-1px);
}
.psico-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--ats-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.psico-kpi-icon--warning {
    background: var(--ats-warning-bg);
    color: var(--ats-warning);
}
.psico-kpi-icon--muted {
    background: var(--ats-bg);
    color: var(--ats-text-secondary);
}
.psico-kpi-icon--success {
    background: var(--ats-success-bg);
    color: var(--ats-success);
}
.psico-kpi-icon--primary {
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
}
.psico-kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ats-text);
    letter-spacing: -.02em;
}
.psico-kpi-label {
    font-size: .72rem;
    font-weight: 500;
    color: var(--ats-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.psico-kpi-track {
    margin-top: 6px;
    height: 3px;
    border-radius: 4px;
    background: var(--ats-border);
    overflow: hidden;
}
.psico-kpi-track-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--ats-success);
    transition: width .6s ease;
}

/* ── Segmented Tabs (estado pills) ── */
.psico-seg {
    display: inline-flex;
    background: var(--ats-bg);
    border: 1px solid var(--ats-border);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
    flex-wrap: wrap;
}
.psico-seg-btn {
    padding: 6px 16px;
    font-size: .8rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--ats-text-secondary);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.psico-seg-btn:hover {
    background: var(--ats-surface);
    color: var(--ats-text);
}
.psico-seg-btn.active {
    background: var(--ats-surface);
    color: var(--ats-primary);
    box-shadow: var(--ats-shadow);
}
.psico-seg-btn .psico-seg-count {
    display: inline-block;
    min-width: 20px;
    font-size: .68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 6px;
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
}
.psico-seg-btn.active .psico-seg-count {
    background: var(--ats-primary);
    color: #fff;
}

/* ── Toolbar Row ── */
.psico-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 0;
}
.psico-search-input {
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    padding: 8px 12px 8px 36px;
    font-size: .85rem;
    background: var(--ats-surface);
    color: var(--ats-text);
    width: 280px;
    max-width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
.psico-search-input:focus {
    outline: none;
    border-color: var(--ats-primary);
    box-shadow: 0 0 0 3px var(--ats-primary-bg);
}
.psico-search-wrap {
    position: relative;
}
.psico-search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ats-text-muted);
    font-size: .85rem;
    pointer-events: none;
}

/* ── Offcanvas Filters ── */
.psico-offcanvas-title {
    font-size: 1rem;
    font-weight: 700;
}
.psico-filter-group {
    margin-bottom: 20px;
}
.psico-filter-label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ats-text-muted);
    margin-bottom: 6px;
}

/* ── Clean Table Rows ── */
.psico-table-clean thead th {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ats-text-muted);
    background: var(--ats-bg);
    padding: 10px 16px;
    border-bottom: 1px solid var(--ats-border);
    white-space: nowrap;
}
.psico-table-clean tbody td {
    padding: 14px 16px;
    font-size: .85rem;
    color: var(--ats-text);
    border-bottom: 1px solid var(--ats-border-light);
    vertical-align: middle;
}
.psico-table-clean tbody tr {
    transition: background .12s;
}
.psico-table-clean tbody tr:hover {
    background: var(--ats-primary-bg);
}
.psico-table-clean tbody tr:last-child td {
    border-bottom: none;
}

/* ── Progress mini bar ── */
.psico-progress-mini {
    display: flex;
    align-items: center;
    gap: 8px;
}
.psico-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--ats-border);
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}
.psico-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--ats-primary);
    transition: width .4s ease;
}
.psico-progress-fill.complete { background: var(--ats-success); }
.psico-progress-text {
    font-size: .72rem;
    font-weight: 600;
    color: var(--ats-text-secondary);
    white-space: nowrap;
}

/* ── Action dots (compact actions) ── */
.psico-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.psico-action-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ats-radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--ats-text-secondary);
    font-size: .85rem;
    cursor: pointer;
    transition: all .12s;
}
.psico-action-btn:hover {
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
    border-color: var(--ats-border);
}
.psico-action-btn.danger:hover {
    background: var(--ats-danger-bg);
    color: var(--ats-danger);
}

/* ── Pagination Clean ── */
.psico-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 0;
    font-size: .82rem;
    color: var(--ats-text-muted);
}
.psico-page-btns {
    display: flex;
    gap: 4px;
}
.psico-page-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ats-radius-sm);
    border: 1px solid var(--ats-border);
    background: var(--ats-surface);
    color: var(--ats-text-secondary);
    font-size: .82rem;
    cursor: pointer;
    transition: all .12s;
}
.psico-page-btn:hover:not(:disabled) {
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
    border-color: var(--ats-primary);
}
.psico-page-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}
.psico-page-btn.active {
    background: var(--ats-primary);
    color: #fff;
    border-color: var(--ats-primary);
}

/* ── Wizard Step Indicator ── */
.psico-wiz-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
}
.psico-wiz-step {
    display: flex;
    align-items: center;
    gap: 8px;
}
.psico-wiz-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    border: 2px solid var(--ats-border);
    background: var(--ats-surface);
    color: var(--ats-text-muted);
    transition: all .2s;
    flex-shrink: 0;
}
.psico-wiz-step.active .psico-wiz-circle,
.psico-wiz-step.done .psico-wiz-circle {
    background: var(--ats-primary);
    border-color: var(--ats-primary);
    color: #fff;
}
.psico-wiz-step-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--ats-text-muted);
}
.psico-wiz-step.active .psico-wiz-step-label { color: var(--ats-primary); }
.psico-wiz-step.done .psico-wiz-step-label { color: var(--ats-text-secondary); }
.psico-wiz-connector {
    width: 48px;
    height: 2px;
    background: var(--ats-border);
    margin: 0 8px;
    border-radius: 1px;
}
.psico-wiz-step.done + .psico-wiz-connector { background: var(--ats-primary); }

.psico-wiz-copy {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    background: var(--ats-bg);
}

.psico-wiz-copy-title {
    color: var(--ats-text);
    font-size: .92rem;
    font-weight: 800;
}

.psico-wiz-copy-help {
    color: var(--ats-text-secondary);
    font-size: .78rem;
    line-height: 1.45;
    max-width: 520px;
}

.psico-wiz-inline-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(99,102,241,.16);
    border-radius: var(--ats-radius-sm);
    background: var(--ats-primary-bg);
    color: var(--ats-text-secondary);
    font-size: .8rem;
    line-height: 1.45;
}

.psico-wiz-inline-note i {
    color: var(--ats-primary);
    margin-top: 1px;
}

/* ── Exam Card (for wizard) ── */
.psico-exam-card {
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: all .15s;
    background: var(--ats-surface);
}
.psico-exam-card:hover {
    border-color: var(--ats-primary-light);
    box-shadow: 0 0 0 2px var(--ats-primary-bg);
}
.psico-exam-card.selected {
    border-color: var(--ats-primary);
    background: var(--ats-primary-bg);
    box-shadow: 0 0 0 2px rgba(99,102,241,.12);
}
.psico-exam-card .form-check-input:checked ~ .psico-exam-info .psico-exam-name {
    color: var(--ats-primary);
}
.psico-exam-info { flex: 1; min-width: 0; }
.psico-exam-name {
    font-size: .85rem;
    font-weight: 600;
    color: var(--ats-text);
    margin-bottom: 2px;
}
.psico-exam-desc {
    font-size: .72rem;
    color: var(--ats-text-muted);
    line-height: 1.4;
}
.psico-exam-meta {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}
.psico-exam-tag {
    font-size: .65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* ── Mode Selector (Individual / Lote) ── */
.psico-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.psico-mode-option {
    border: 2px solid var(--ats-border);
    border-radius: var(--ats-radius);
    padding: 16px 20px;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 14px;
}
.psico-mode-option:hover { border-color: var(--ats-primary-light); }
.psico-mode-option.active {
    border-color: var(--ats-primary);
    background: var(--ats-primary-bg);
}
.psico-mode-option.active::after {
    content: "\F26A";
    font-family: "bootstrap-icons";
    color: var(--ats-primary);
    font-size: 1rem;
    margin-left: auto;
}
.psico-mode-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--ats-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.psico-mode-title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--ats-text);
}
.psico-mode-desc {
    font-size: .75rem;
    color: var(--ats-text-muted);
}

/* ── Delivery Channel Toggle ── */
.psico-channel {
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: border-color .15s;
}
.psico-channel.active { border-color: var(--ats-primary); }
.psico-channel-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.psico-channel-icon {
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Lote Banner ── */
.psico-lote-banner {
    background: var(--ats-primary-bg);
    border: 1px solid rgba(99,102,241,.12);
    border-radius: var(--ats-radius-sm);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ── Section Nav (secondary tabs like Resultados, Analítica...) ── */
.psico-section-nav {
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius) var(--ats-radius) 0 0;
    display: flex;
    gap: 6px;
    margin-bottom: 0;
    padding: 8px;
    background: var(--ats-surface);
    overflow-x: auto;
    scrollbar-width: thin;
}
.psico-section-btn {
    position: relative;
    min-width: 150px;
    padding: 10px 14px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--ats-text-secondary);
    border: 1px solid transparent;
    border-radius: calc(var(--ats-radius-sm) + 2px);
    background: transparent;
    cursor: pointer;
    transition: all .15s;
    text-align: left;
    display: grid;
    grid-template-columns: 22px 1fr;
    column-gap: 8px;
    row-gap: 1px;
    align-items: center;
    flex: 0 0 auto;
}
.psico-section-btn i {
    grid-row: span 2;
    color: var(--ats-text-muted);
    font-size: 1rem;
}
.psico-section-btn span {
    color: inherit;
    line-height: 1.1;
}
.psico-section-btn small {
    color: var(--ats-text-muted);
    font-size: .66rem;
    font-weight: 600;
    line-height: 1.15;
}
.psico-section-btn:hover {
    color: var(--ats-text);
    background: var(--ats-bg);
}
.psico-section-btn.active {
    color: var(--ats-accent);
    border-color: var(--ats-accent-bg);
    background: linear-gradient(180deg, var(--ats-accent-soft), transparent);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.psico-section-btn.active i {
    color: var(--ats-accent);
}
.psico-section-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    font-size: .62rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
}

/* ── Section Context Header ── */
.psico-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    padding: 18px 20px;
    border-left: 1px solid var(--ats-border);
    border-right: 1px solid var(--ats-border);
    background:
        linear-gradient(90deg, var(--ats-accent-bg), transparent 42%),
        var(--ats-surface);
}
.psico-section-head h5 {
    margin: 2px 0 4px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ats-text);
}
.psico-section-head p {
    margin: 0;
    max-width: 720px;
    color: var(--ats-text-muted);
    font-size: .82rem;
    line-height: 1.45;
}
.psico-section-kicker {
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ats-accent);
}
.psico-section-head-meta {
    border: 1px solid var(--ats-border);
    border-radius: 999px;
    padding: 6px 10px;
    background: var(--ats-bg);
    color: var(--ats-text-secondary);
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}

.psico-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 0 12px;
}
.psico-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--ats-insight-border);
    border-radius: 999px;
    padding: 5px 9px;
    background: var(--ats-insight-bg);
    color: var(--ats-accent);
    font-size: .72rem;
    font-weight: 700;
}
.psico-filter-chip button {
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    line-height: 1;
    opacity: .75;
}
.psico-filter-chip button:hover { opacity: 1; }

.psico-row-title {
    color: var(--ats-text);
    font-weight: 800;
    line-height: 1.25;
}
.psico-row-subtitle {
    color: var(--ats-text-muted);
    font-size: .74rem;
    margin-top: 2px;
}
.psico-action-cluster {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-wrap: wrap;
}

.psico-empty-state {
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 18px;
    color: var(--ats-text-muted);
}
.psico-empty-state i {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ats-accent-bg);
    color: var(--ats-accent);
    font-size: 1.35rem;
}
.psico-empty-state strong {
    color: var(--ats-text);
    font-size: .95rem;
}
.psico-empty-state span {
    max-width: 480px;
    font-size: .8rem;
    line-height: 1.45;
}
.psico-empty-state-sm {
    padding: 8px 4px;
}
.psico-empty-state-sm i {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 1.05rem;
}

.psico-analytics-card {
    height: 100%;
    border: 1px solid var(--ats-border);
    border-radius: 18px;
    padding: 16px;
    background: var(--ats-surface);
}
.psico-insight-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.psico-insight-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 13px 14px;
    border: 1px solid var(--ats-insight-border);
    border-radius: 16px;
    background: var(--ats-insight-bg);
    border-left: 3px solid var(--card-accent, var(--ats-accent));
}
.psico-insight-card > span {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ats-insight-icon-bg);
    color: var(--ats-insight-icon-color);
    flex-shrink: 0;
}
.psico-insight-card strong {
    display: block;
    color: var(--ats-text);
    font-size: .82rem;
    margin-bottom: 2px;
}
.psico-insight-card small {
    display: block;
    color: var(--ats-text-muted);
    font-size: .76rem;
    line-height: 1.4;
}
.psico-insight-bar {
    margin-top: 7px;
    height: 3px;
    border-radius: 4px;
    background: var(--ats-border);
    overflow: hidden;
}
.psico-insight-bar span {
    display: block;
    height: 100%;
    border-radius: 4px;
    transition: width .6s ease;
}
.psico-guidance-list {
    display: grid;
    gap: 10px;
}
.psico-guidance-list > div {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--ats-text-secondary);
    font-size: .82rem;
    line-height: 1.45;
}
.psico-guidance-list i {
    color: var(--ats-accent);
    margin-top: 2px;
}

/* ── Summary Card (for wizard confirmation) ── */
.psico-wiz-summary-pane {
    background: var(--ats-bg);
}

.psico-summary-card {
    background: var(--ats-surface);
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius);
    padding: 14px;
    color: var(--ats-text);
}
.psico-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: .85rem;
}
.psico-summary-label {
    color: var(--ats-text-muted);
    font-weight: 500;
}
.psico-summary-value {
    color: var(--ats-text);
    font-weight: 600;
}
.psico-summary-stack {
    display: grid;
    gap: 12px;
}
.psico-summary-section {
    border: 1px solid var(--ats-border-light);
    border-radius: var(--ats-radius-sm);
    background: var(--ats-bg);
    padding: 12px;
}
.psico-summary-kicker {
    color: var(--ats-text-muted);
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
    margin-bottom: 3px;
}
.psico-summary-title {
    color: var(--ats-text);
    font-size: .88rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 0;
    overflow-wrap: anywhere;
}
.psico-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.psico-summary-metric {
    min-width: 0;
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    background: var(--ats-surface);
    padding: 8px;
}
.psico-summary-metric span {
    display: block;
    color: var(--ats-text-muted);
    font-size: .68rem;
    font-weight: 700;
}
.psico-summary-metric strong {
    display: block;
    color: var(--ats-text);
    font-size: .82rem;
    line-height: 1.35;
    margin-top: 2px;
    overflow-wrap: anywhere;
}
.psico-summary-chips,
.psico-selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.psico-summary-pill,
.psico-summary-empty-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--ats-border);
    border-radius: 999px;
    padding: 4px 8px;
    background: var(--ats-surface);
    color: var(--ats-text-secondary);
    font-size: .72rem;
    font-weight: 700;
    max-width: 100%;
}
.psico-summary-pill {
    background: var(--ats-primary-bg);
    border-color: rgba(99,102,241,.18);
    color: var(--ats-primary);
}
.psico-summary-empty-pill {
    color: var(--ats-text-muted);
}
.psico-selected-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 5px 7px 5px 9px;
    border: 1px solid rgba(99,102,241,.22);
    border-radius: 999px;
    background: var(--ats-primary-bg);
    color: var(--ats-primary);
    font-size: .74rem;
    font-weight: 700;
}
.psico-selected-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.psico-chip-remove {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(99,102,241,.16);
    color: var(--ats-primary);
    padding: 0;
    line-height: 1;
}
.psico-chip-remove:hover {
    background: var(--ats-danger-bg);
    color: var(--ats-danger);
}
.psico-summary-card .bg-light,
.psico-summary-card .bg-white {
    background: var(--ats-surface) !important;
    color: var(--ats-text) !important;
}
.psico-summary-card .text-dark {
    color: var(--ats-text) !important;
}
#modalNuevaEvaluacion .alert-light {
    background: var(--ats-bg);
    color: var(--ats-text-secondary);
    border-color: var(--ats-border) !important;
}

/* ── Responsive tweaks ── */
@media (max-width: 768px) {
    .psico-results-modal .modal-dialog {
        max-width: calc(100vw - 10px);
        margin: 6px auto;
    }
    .psico-results-body {
        padding: 10px;
    }
    .psico-v3-result-host {
        padding: 10px;
    }
    .psico-v3-hero { flex-direction: column; padding: 16px 0; }
    .psico-v3-hero-actions { align-items: stretch; min-width: 0; }
    .psico-v3-cleaver-quickread { grid-template-columns: 1fr; }
    .psico-v3-cleaver-fitrow { flex-direction: column; gap: 3px; }
    .psico-v3-cleaver-fitrow-metrics { text-align: left; }
    .psico-governance-strip { grid-template-columns: 1fr; }
    .psico-section-head { flex-direction: column; align-items: flex-start; padding: 14px; }
    .psico-section-head-meta { white-space: normal; }
    .psico-section-btn { min-width: 138px; }
    .psico-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .psico-kpi { padding: 14px; gap: 10px; }
    .psico-kpi-value { font-size: 1.2rem; }
    .psico-seg { flex-wrap: wrap; }
    .psico-seg-btn { padding: 5px 12px; font-size: .75rem; }
    .psico-search-input { width: 100%; }
    .psico-toolbar { flex-direction: column; align-items: stretch; }
    .psico-wiz-connector { width: 24px; }
    .psico-wiz-copy { flex-direction: column; gap: 4px; }
    .psico-summary-grid { grid-template-columns: 1fr; }
}

/* ============================================
   PSYCHOMETRIC PREMIUM ENHANCEMENTS
   ============================================ */

/* Interactive KPIs */
.psico-kpi {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}
.psico-kpi:hover {
    transform: translateY(-4px);
    background: var(--ats-surface);
    box-shadow: var(--ats-shadow-lg);
    border-color: var(--ats-primary-bg);
}
.psico-kpi:active {
    transform: translateY(-2px);
}

/* Row Selection */
tr.selected {
    background: var(--ats-primary-bg) !important;
}

/* Floating Bulk Toolbar */
.psico-bulk-toolbar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
    z-index: 1060;
    min-width: 400px;
    animation: bulkSlideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes bulkSlideUp {
    from { transform: translateX(-50%) translateY(100px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.psico-bulk-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
}

.psico-bulk-divider {
    width: 1px;
    height: 20px;
    background: #334155;
}

[data-bs-theme="dark"] .psico-bulk-toolbar {
    background: #171326;
    border: 1px solid #34243d;
    box-shadow: 0 14px 30px rgba(4, 6, 18, 0.42);
}

[data-bs-theme="dark"] .psico-bulk-divider {
    background: #34243d;
}

[data-bs-theme="dark"] .psico-analytics-card {
    background: linear-gradient(180deg, rgba(255,255,255,.03), transparent), var(--ats-surface);
}

.psico-bulk-btn {
    background: transparent;
    border: none;
    color: #f1f5f9;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.psico-bulk-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.psico-bulk-btn i {
    font-size: 1rem;
}

/* Status Pulse Animation */
.psico-pulse {
    position: relative;
    display: flex;
    align-items: center;
}
.psico-pulse::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: inherit;
    border-radius: 50%;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% { transform: translateY(-50%) scale(1); opacity: 0.8; }
    70% { transform: translateY(-50%) scale(2.5); opacity: 0; }
    100% { transform: translateY(-50%) scale(1); opacity: 0; }
}

/* Tooltip Detail */
.psico-tooltip-inner {
    max-width: 250px;
    font-size: 0.75rem;
    text-align: left;
}

/* ============================================
   Segmented Button Group
   ============================================ */
.ats-btn-group-segmented {
    display: inline-flex;
    border: 1px solid var(--ats-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--ats-bg);
}
.ats-btn-group-segmented .ats-btn-seg {
    border: none;
    border-radius: 0;
    border-right: 1px solid var(--ats-border);
    padding: 6px 12px;
    font-size: 0.82rem;
}
.ats-btn-group-segmented .ats-btn-seg:last-child { border-right: none; }
.ats-btn-group-segmented .ats-btn-seg.active,
.ats-btn-group-segmented .ats-btn-seg.ats-btn-primary {
    background: var(--ats-primary);
    color: #fff;
    border-color: var(--ats-primary);
}

/* ============================================
   Step Pills for Modal Wizards
   ============================================ */
.ats-step-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    background: var(--ats-bg-secondary, #f3f4f6);
    color: var(--ats-text-secondary, #6b7280);
    transition: all 0.2s ease;
}
.ats-step-pill.active {
    background: var(--ats-primary);
    color: #fff;
}
.ats-step-pill.completed {
    background: #dcfce7;
    color: #166534;
}
.ats-step-divider {
    width: 24px;
    height: 2px;
    background: var(--ats-border, #e5e7eb);
    flex-shrink: 0;
}

/* ============================================
   Entry Mode Cards
   ============================================ */
.ats-entry-mode-card {
    border: 2px solid var(--ats-border, #e5e7eb);
    border-radius: 12px;
    transition: all 0.2s ease;
    background: var(--ats-bg);
}
.ats-entry-mode-card:hover {
    border-color: var(--ats-primary);
    background: rgba(99, 102, 241, 0.03);
}
.ats-entry-mode-card.active {
    border-color: var(--ats-primary);
    background: rgba(99, 102, 241, 0.06);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* ============================================
   Compare Mode
   ============================================ */
.ats-compare-bar {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ats-text, #1e293b);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-width: 400px;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    z-index: 1060;
    transition: bottom 0.3s ease;
    font-size: 0.85rem;
}
.ats-compare-bar.show { bottom: 24px; }
.ats-compare-bar .ats-btn-outline { color: #fff; border-color: rgba(255,255,255,0.3); }
.ats-compare-bar .ats-btn-outline:hover { background: rgba(255,255,255,0.1); }

.ats-kanban-card.ats-compare-mode { cursor: pointer; }
.ats-kanban-card.ats-compare-selected {
    outline: 2px solid var(--ats-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
#listViewBody tr.ats-compare-mode { cursor: pointer; }
#listViewBody tr.ats-compare-selected {
    background: rgba(99, 102, 241, 0.06);
    box-shadow: inset 3px 0 0 var(--ats-primary);
}

/* ============================================
   Comparison Modal Layout
   ============================================ */
.ats-compare-headers {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: start;
}
.ats-compare-col { padding: 0 8px; }
.ats-compare-divider {
    width: 1px;
    background: var(--ats-border, #e5e7eb);
    align-self: stretch;
}

.ats-compare-metrics { border-top: 1px solid var(--ats-border, #e5e7eb); }
.ats-compare-metric {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 8px;
    border-bottom: 1px solid var(--ats-border, #e5e7eb);
}
.ats-compare-metric-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ats-text-secondary, #6b7280);
    white-space: nowrap;
    min-width: 100px;
}
.ats-compare-metric-left { text-align: center; }
.ats-compare-metric-right { text-align: center; }

.ats-compare-bar-track {
    flex-grow: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--ats-bg-secondary, #f3f4f6);
    overflow: hidden;
}
.ats-compare-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

@media (max-width: 768px) {
    .ats-compare-bar { min-width: auto; max-width: calc(100vw - 32px); padding: 10px 16px; font-size: 0.8rem; }
    .ats-compare-headers { grid-template-columns: 1fr; gap: 12px; }
    .ats-compare-divider { width: auto; height: 1px; }
    .ats-compare-metric { grid-template-columns: 1fr; gap: 4px; text-align: center; }
    .ats-compare-metric-label { order: -1; }
}

/* ── Psicométrico V3 — ZAVIC component ── */
.psico-v3-zavic-report { display: flex; flex-direction: column; gap: 16px; border: 1px solid #e2e8f0; border-radius: 18px; background: #fff; padding: 16px; box-shadow: 0 16px 40px rgba(15,23,42,.06); }
.psico-v3-zavic-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .75fr); gap: 16px; padding: 16px; border-radius: 16px; background: linear-gradient(135deg, #0f172a, #1e3a8a); color: #fff; }
.psico-v3-zavic-kicker { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #bae6fd; margin-bottom: 5px; }
.psico-v3-zavic-hero h4 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 850; color: #fff; }
.psico-v3-zavic-hero p { margin: 0; color: #dbeafe; font-size: .82rem; line-height: 1.5; }
.psico-v3-zavic-hero-metrics { display: grid; gap: 8px; }
.psico-v3-zavic-hero-metrics div { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16); }
.psico-v3-zavic-hero-metrics span { display: block; font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #bfdbfe; margin-bottom: 4px; }
.psico-v3-zavic-hero-metrics strong { display: block; color: #fff; font-size: .75rem; line-height: 1.35; }
.psico-v3-zavic-layout { display: grid; grid-template-columns: minmax(190px, .85fr) minmax(260px, 1.15fr); gap: 14px; }
.psico-v3-zavic-left { display: flex; flex-direction: column; gap: 8px; }
.psico-v3-zavic-section { border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; background: #f8fafc; }
.psico-v3-zavic-section-title { font-size: .68rem; font-weight: 700; color: #0f172a; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.psico-v3-zavic-bar-row { margin-bottom: 5px; }
.psico-v3-zavic-bar-head { display: flex; justify-content: space-between; font-size: .7rem; color: #334155; margin-bottom: 2px; }
.psico-v3-zavic-right { display: flex; flex-direction: column; gap: 4px; }
.psico-v3-zavic-row { display: flex; align-items: flex-start; gap: 7px; border-bottom: 1px solid #f1f5f9; padding: 5px 0; }
.psico-v3-zavic-row:last-child { border-bottom: none; }
.psico-v3-zavic-row-icon { flex: 0 0 18px; margin-top: 1px; }
.psico-v3-zavic-row-body { flex: 1; min-width: 0; }
.psico-v3-zavic-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.psico-v3-zavic-row-name { font-size: .72rem; font-weight: 700; color: #0f172a; }
.psico-v3-zavic-row-level { font-size: .65rem; font-weight: 600; padding: 1px 7px; border-radius: 99px; white-space: nowrap; display: inline-block; }
.psico-v3-zavic-row-desc { font-size: .68rem; color: #334155; line-height: 1.4; margin-top: 2px; }
.psico-v3-zavic-row-interp { font-size: .66rem; color: #475569; line-height: 1.4; margin-top: 3px; padding-top: 3px; border-top: 1px dashed #e2e8f0; }

/* Level badge colors */
.psico-v3-zavic-badge-alto { background: #fef2f2; color: #991b1b; }
.psico-v3-zavic-badge-medio { background: #fefce8; color: #92400e; }
.psico-v3-zavic-badge-bajo { background: #f0fdf4; color: #166534; }
.psico-v3-zavic-badge-predominante { background: #ede9fe; color: #5b21b6; }
.psico-v3-zavic-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.psico-v3-zavic-insight { border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px; background: #f8fafc; }
.psico-v3-zavic-insight-risk { background: #fff7ed; border-color: #fed7aa; }
.psico-v3-zavic-insight-protective { background: #f0fdf4; border-color: #bbf7d0; }
.psico-v3-zavic-insight-wide { grid-column: 1 / -1; }
.psico-v3-zavic-insight h5 { margin: 0 0 8px; font-size: .72rem; font-weight: 850; color: #0f172a; text-transform: uppercase; letter-spacing: .05em; }
.psico-v3-zavic-insight ul { margin: 0; padding-left: 16px; color: #334155; font-size: .72rem; line-height: 1.5; }
.psico-v3-zavic-insight li + li { margin-top: 5px; }

@media (max-width: 768px) {
    .psico-v3-zavic-hero,
    .psico-v3-zavic-layout,
    .psico-v3-zavic-footer { grid-template-columns: 1fr; }
    .psico-v3-zavic-insight-wide { grid-column: auto; }
}

/* ============================================
   MODERN MODAL & OFFCANVAS — Psicometricos
   ============================================ */

/* ── Modern Modal Base ── */
#modalNuevaEvaluacion .modal-content {
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,.15);
    overflow: hidden;
}
#modalNuevaEvaluacion .modal-header {
    background: var(--ats-surface);
    border-bottom: 1px solid var(--ats-border);
    padding: 18px 28px;
}
#modalNuevaEvaluacion .modal-header .modal-title {
    color: var(--ats-text);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
#modalNuevaEvaluacion .modal-header .btn-close {
    background: transparent;
    opacity: 0.5;
    transition: opacity .2s;
    width: 32px; height: 32px;
    border-radius: 50%;
}
#modalNuevaEvaluacion .modal-header .btn-close:hover {
    opacity: 1;
    background: var(--ats-bg);
}
#modalNuevaEvaluacion .modal-footer {
    border-top: 1px solid var(--ats-border);
    padding: 16px 28px;
    background: var(--ats-bg);
    gap: 10px;
}

/* ── Modern Wizard Stepper ── */
.psico-wiz-steps-modern {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 0 4px;
}
.psico-wiz-step-modern {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    position: relative;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ats-border-light);
    transition: border-color .3s;
}
.psico-wiz-step-modern.active {
    border-bottom-color: var(--ats-primary);
}
.psico-wiz-step-modern.done {
    border-bottom-color: var(--ats-success);
}
.psico-wiz-step-circle {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    background: var(--ats-bg);
    color: var(--ats-text-muted);
    border: 2px solid var(--ats-border);
    transition: all .3s;
    flex-shrink: 0;
}
.psico-wiz-step-modern.active .psico-wiz-step-circle {
    background: var(--ats-primary);
    color: #fff;
    border-color: var(--ats-primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,.15);
}
.psico-wiz-step-modern.done .psico-wiz-step-circle {
    background: var(--ats-success);
    color: #fff;
    border-color: var(--ats-success);
}
.psico-wiz-step-label-modern {
    font-size: .8rem;
    font-weight: 600;
    color: var(--ats-text-muted);
    white-space: nowrap;
    transition: color .3s;
}
.psico-wiz-step-modern.active .psico-wiz-step-label-modern {
    color: var(--ats-primary);
}
.psico-wiz-step-modern.done .psico-wiz-step-label-modern {
    color: var(--ats-success);
}

/* ── Wizard Section Titles ── */
.psico-wiz-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ats-text);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.psico-wiz-section-subtitle {
    font-size: .85rem;
    color: var(--ats-text-muted);
    margin-bottom: 22px;
    line-height: 1.5;
}

/* ── Modern Select ── */
.psico-select-wrap {
    position: relative;
}
.psico-select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 10px 36px 10px 14px;
    font-size: .88rem;
    font-weight: 500;
    color: var(--ats-text);
    background: var(--ats-surface);
    border: 1.5px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    cursor: pointer;
    transition: all .15s;
}
.psico-select-wrap select:hover {
    border-color: var(--ats-primary-light);
}
.psico-select-wrap select[size] {
    appearance: auto;
    -webkit-appearance: menulist;
    padding: 8px;
    cursor: default;
}
.psico-select-wrap select[size] ~ ::after {
    display: none;
}
.psico-select-wrap select:focus {
    outline: none;
    border-color: var(--ats-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.psico-select-wrap::after {
    content: "\F282";
    font-family: "bootstrap-icons";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .75rem;
    color: var(--ats-text-muted);
    pointer-events: none;
}

/* ── Modern Floating Input ── */
.psico-floating-group {
    position: relative;
    margin-bottom: 16px;
}
.psico-floating-group input,
.psico-floating-group select {
    width: 100%;
    padding: 12px 14px;
    font-size: .9rem;
    color: var(--ats-text);
    background: var(--ats-surface);
    border: 1.5px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    transition: all .15s;
    outline: none;
}
.psico-floating-group input:focus,
.psico-floating-group select:focus {
    border-color: var(--ats-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.10);
}
.psico-floating-group label {
    position: absolute;
    left: 14px;
    top: -8px;
    background: var(--ats-surface);
    padding: 0 6px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--ats-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: color .15s;
}
.psico-floating-group input:focus ~ label,
.psico-floating-group select:focus ~ label {
    color: var(--ats-primary);
}
.psico-floating-group input::placeholder {
    color: var(--ats-text-muted);
    opacity: 0.6;
}

/* ── Modern Card (inner) ── */
.psico-card-modern {
    background: var(--ats-surface);
    border: 1.5px solid var(--ats-border);
    border-radius: var(--ats-radius);
    padding: 20px;
    transition: border-color .2s, box-shadow .2s;
}
.psico-card-modern:hover {
    border-color: var(--ats-primary-light);
    box-shadow: var(--ats-shadow-md);
}

/* ── Modern Drop Zone ── */
.psico-dropzone {
    border: 2px dashed var(--ats-border);
    border-radius: var(--ats-radius);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all .25s;
    background: var(--ats-bg);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.psico-dropzone:hover {
    border-color: var(--ats-primary);
    background: rgba(99,102,241,.03);
}
.psico-dropzone.drag-over {
    border-color: var(--ats-primary);
    background: rgba(99,102,241,.06);
    transform: scale(1.01);
}

/* ── Modern Mode Selector ── */
.psico-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.psico-mode-card {
    position: relative;
    border: 2px solid var(--ats-border);
    border-radius: var(--ats-radius);
    padding: 22px 18px;
    cursor: pointer;
    transition: all .2s;
    background: var(--ats-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}
.psico-mode-card:hover {
    border-color: var(--ats-primary-light);
    transform: translateY(-2px);
    box-shadow: var(--ats-shadow-md);
}
.psico-mode-card.active {
    border-color: var(--ats-primary);
    background: rgba(99,102,241,.03);
    box-shadow: 0 0 0 4px rgba(99,102,241,.08), var(--ats-shadow-md);
}
.psico-mode-card.active::after {
    content: "\F26B";
    font-family: "bootstrap-icons";
    position: absolute;
    top: 10px; right: 10px;
    width: 22px; height: 22px;
    background: var(--ats-primary);
    color: #fff;
    border-radius: 50%;
    font-size: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.psico-mode-card-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.psico-mode-card-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--ats-text);
}
.psico-mode-card-desc {
    font-size: .78rem;
    color: var(--ats-text-muted);
    line-height: 1.45;
}

/* ── Modern Search Input ── */
.psico-search-modern {
    position: relative;
}
.psico-search-modern input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    font-size: .88rem;
    border: 1.5px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    background: var(--ats-surface);
    color: var(--ats-text);
    transition: all .15s;
    outline: none;
}
.psico-search-modern input:focus {
    border-color: var(--ats-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.10);
}
.psico-search-modern i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ats-text-muted);
    font-size: .9rem;
    pointer-events: none;
}

/* ── Modern Offcanvas ── */
#offcanvasFilters {
    width: 380px;
    border-left: 1px solid var(--ats-border);
    box-shadow: -10px 0 40px rgba(0,0,0,.08);
}
#offcanvasFilters .offcanvas-header {
    padding: 22px 26px;
    border-bottom: 1px solid var(--ats-border);
    background: var(--ats-surface);
}
#offcanvasFilters .offcanvas-header .offcanvas-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ats-text);
    display: flex;
    align-items: center;
    gap: 10px;
}
#offcanvasFilters .offcanvas-body {
    padding: 26px;
    background: var(--ats-bg);
}
.psico-filter-section {
    margin-bottom: 24px;
}
.psico-filter-section-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ats-text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Modern Channel Toggle ── */
.psico-channel-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border: 1.5px solid var(--ats-border);
    border-radius: var(--ats-radius);
    background: var(--ats-surface);
    transition: all .2s;
    cursor: pointer;
}
.psico-channel-modern:hover {
    border-color: var(--ats-primary-light);
}
.psico-channel-modern.active {
    border-color: var(--ats-primary);
    background: rgba(99,102,241,.03);
}
.psico-channel-info-modern {
    display: flex;
    align-items: center;
    gap: 12px;
}
.psico-channel-icon-modern {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.psico-channel-text-modern strong {
    font-size: .88rem;
    color: var(--ats-text);
    display: block;
}
.psico-channel-text-modern span {
    font-size: .75rem;
    color: var(--ats-text-muted);
}

/* ── Modern Switch ── */
.psico-switch {
    position: relative;
    display: inline-block;
    width: 44px; height: 24px;
}
.psico-switch input {
    opacity: 0;
    width: 0; height: 0;
}
.psico-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--ats-border);
    border-radius: 24px;
    transition: .25s;
}
.psico-switch-slider::before {
    content: "";
    position: absolute;
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: .25s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.psico-switch input:checked + .psico-switch-slider {
    background: var(--ats-primary);
}
.psico-switch input:checked + .psico-switch-slider::before {
    transform: translateX(20px);
}

/* ── Modern Alert ── */
.psico-alert-modern {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--ats-radius-sm);
    font-size: .82rem;
    line-height: 1.5;
    border: 1px solid;
}
.psico-alert-modern.info {
    background: var(--ats-info-bg);
    color: var(--ats-info);
    border-color: rgba(59,130,246,.15);
}
.psico-alert-modern.success {
    background: var(--ats-success-bg);
    color: var(--ats-success);
    border-color: rgba(34,197,94,.15);
}

/* ── Advanced Toggle (Accordion) ── */
.psico-advanced-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--ats-bg);
    border: 1.5px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    font-size: .88rem;
    font-weight: 600;
    color: var(--ats-text);
    cursor: pointer;
    transition: all .2s;
    text-align: left;
}
.psico-advanced-toggle-btn:hover {
    border-color: var(--ats-primary-light);
    background: rgba(99,102,241,.04);
}
.psico-advanced-toggle-btn .toggle-icon {
    transition: transform .25s;
    color: var(--ats-text-muted);
    font-size: .8rem;
}
.psico-advanced-toggle-btn.open .toggle-icon {
    transform: rotate(180deg);
}

/* ── Responsive modal adjustments ── */
@media (max-width: 991px) {
    .psico-mode-grid { grid-template-columns: 1fr; }
    #modalNuevaEvaluacion .modal-dialog { margin: 10px; }
}
