:root {
    --rentek-blue: #001F3D; /* Color Maestro Oficial */
    --rentek-blue-light: #003366; /* Hover (10% más claro aprox) */
    --rentek-gold: #D4AF37;
    --accent: #F59E0B; /* Naranja Vibrante / Ámbar solicitado */
    --white: #ffffff;
    --bg-workspace: #F0F2F5; /* Gris Neutro muy tenue */
    --danger: #EF4444;
    --success: #10B981;
    --emerald: #10B981;
    --warning: #F59E0B;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.beta-banner {
    display: none !important;
}

.beta-tag {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}
/* Global Layout Standardized */
.hidden {
    display: none !important;
}

#login-error:not(.hidden) {
    display: block !important;
}

/* Auth Alerts Pixel-Perfect */
.auth-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.5rem;
    animation: authFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}

.auth-alert-error {
    background-color: #FEF2F2;
    border-color: #FCA5A5;
    color: #991B1B;
}

.auth-alert-warning {
    background-color: #FFFBEB;
    border-color: #FDE68A;
    color: #92400E;
}

.auth-alert i {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* Micro-interacción: Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    opacity: 0.9;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spinAuth 0.8s linear infinite;
}

@keyframes spinAuth {
    to { transform: rotate(360deg); }
}

/* Sync Button Pixel-Perfect */
#btn-sync-auth {
    background: #fff !important;
    color: #10B981 !important;
    border: 2px solid #10B981 !important;
    transition: all 0.3s ease;
    font-weight: 700 !important;
}

#btn-sync-auth:hover {
    background: #f0fdf4 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Auth Status Dots */
.auth-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.auth-status-active { 
    background-color: var(--success); 
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); 
}
.auth-status-pending { 
    background-color: #cbd5e1; 
    opacity: 0.6;
}

.animate-in {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn-primary {
    background: var(--rentek-blue);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary:hover {
    background: var(--rentek-blue-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.success-modal {
    text-align: center !important;
    padding: 1.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
}

.success-modal p, .modal-confirm p, #modal-body p {
    text-align: center !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 1.5rem !important; /* Padding lateral para que no toque los bordes */
    line-height: 1.6 !important;
}

.modal-confirm {
    text-align: center !important;
    width: 450px;
    margin: 0 auto;
}

/* Layout */
#app-container {
    display: flex;
    min-height: 100vh;
    padding-top: 70px; /* Header ligeramente más compacto */
}

.sidebar {
    background: linear-gradient(180deg, #001F3D 0%, #003366 100%);
    color: var(--white);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 70px;
    left: 0;
    width: 280px;
    height: calc(100vh - 70px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 90;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.main-content {
    flex: 1;
    margin-left: 280px; /* Espacio para el sidebar fijo */
    background-color: var(--bg-workspace);
    min-height: calc(100vh - 70px);
}

/* Nav Items Cleanup */
.nav-item {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.875rem 1.25rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.nav-item i {
    width: 22px;
    height: 22px;
}

.nav-item:hover,
.nav-item.active {
    color: var(--white);
    background-color: var(--rentek-blue-light);
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-logout {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0.5rem;
}

.btn-logout:hover {
    color: var(--white);
}

/* Main Content */
.main-content {
    padding: 0;
    background: #EAF0F6 url('background_pattern_saro.png') repeat; /* FONDO AZUL WASH CORPORATIVO */
    background-size: 800px;
    position: relative;
    min-height: 100vh;
}

.top-bar,
.content-area,
.content-animate {
    position: relative;
    z-index: 1;
}

.top-bar {
    padding: 0;
    height: 71px; /* Incremento para solapar micro-gap de 1px */
    background-color: var(--rentek-blue);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    border: none;
    border-bottom: none;
}

.sidebar-header {
    padding: 20px 25px 0 25px;
    margin-bottom: 1.5rem; /* Reducido para evitar ocultar el menú de navegación */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-vertical {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left; /* Alineado a la izquierda para Sidebar */
    align-items: flex-start;
    width: 100%;
}

.brand-line-1 {
    display: none; /* Palabra Rentek removida según solicitud */
}

.brand-line-2 {
    font-size: 2.8rem; /* EROS SOBRESALIENTE */
    font-weight: 900;
    color: var(--white);
    line-height: 1;
    letter-spacing: -2px;
    text-transform: uppercase;
}

.brand-line-3 {
    font-size: 8.5px; /* Compactado proporcional */
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1.4;
    max-width: none;
    margin: 5px 0 0 0;
    text-align: left;
}

#view-title-container {
    position: absolute;
    left: 50vw; /* Centrado absoluto respecto a la pantalla */
    transform: translateX(-50%);
    text-align: center;
    width: auto;
}

#view-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.5px;
    margin: 0;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
    padding-right: 25px;
    z-index: 10;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    color: var(--text-muted);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger);
    color: var(--white);
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
}

.date-display {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.content-area {
    padding: 2.5rem;
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centralización de todos los elementos hijos */
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* 7 tarjetas incluyendo Hallazgos de Auditoría */
    gap: 1rem;
    margin-bottom: 2.5rem;
    width: 100%;
}

@media (max-width: 1550px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 950px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--white);
    padding: 1.15rem 0.85rem; /* Padding optimizado para 7 tarjetas */
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    min-height: 120px;
    transition: all 0.3s ease;
    text-align: center;
}

.stat-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-info h3 {
    font-size: 0.72rem; /* Tamaño optimizado para 7 tarjetas */
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 5px;
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    width: 28px;
    height: 28px;
}

.stat-icon.blue {
    background-color: #e0e7ff;
    color: #4338ca;
}

.stat-icon.green {
    background-color: #dcfce7;
    color: #15803d;
}

.stat-icon.amber {
    background-color: #fef3c7;
    color: #b45309;
}

.stat-icon.red {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* Dashboard Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Distribución simétrica 50/50 */
    gap: 1.5rem;
}

.chart-container {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    height: 450px;
    /* Altura generosa y fija para consistencia */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.chart-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    text-align: left;
    /* Títulos siempre a la izquierda según solicitud */
}

.chart-wrapper {
    flex: 1;
    min-height: 0;
    position: relative;
}

/* Forms and Content Cards */
.form-card {
    background: #FFFFFF;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12); /* Sombra alta definición para contraste */
    max-width: 900px;
    width: 100%;
    margin: 3rem auto;
    text-align: left;
    border: 1px solid rgba(0,0,0,0.08); /* Borde sutil para definición extra solicitado */
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: span 2;
}

label {
    font-size: 0.875rem;
    font-weight: 700; /* Mayor intensidad solicitada */
    color: var(--rentek-blue); /* Color maestro para mejor visibilidad */
    margin-bottom: 0.25rem;
    display: block;
}

input,
select,
textarea {
    padding: 0.6rem 1rem; /* Compactación de campos solicitada */
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
    background: #ffffff;
    color: var(--rentek-blue);
}

input::placeholder {
    color: var(--metallic);
    opacity: 0.7;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.05);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 6px;
    color: var(--primary);
    transition: transform 0.2s;
}

.tooltip-icon:hover {
    transform: scale(1.15);
}

.saro-tooltip {
    display: none;
    position: absolute;
    z-index: 10000;
    width: 320px;
    max-width: 85vw;
    background-color: #1e293b; /* Fondo oscuro corregido */
    color: #ffffff;
    text-align: left;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    line-height: 1.6;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
}

.saro-tooltip.tooltip-visible {
    display: block;
    animation: fadeInTooltip 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInTooltip {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.tooltip-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tooltip-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--danger);
}

/* Info Block */
.info-block {
    background: #f0f7ff;
    border-left: 4px solid var(--accent);
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #1e3a8a;
}

.info-block strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.file-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.file-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.btn-remove-file {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 16px;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.dropzone:hover {
    border-color: var(--accent);
    background-color: var(--accent-light);
}

/* Tables */
.table-container {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

thead {
    background-color: #f8fafc;
}

th {
    padding: 1rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    vertical-align: middle;
}

table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

tr:hover {
    background-color: #f1f5f9;
}

/* Multi-select Area Responsable */
.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 150px;
    overflow-y: auto;
}

.area-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: background 0.2s;
}

.area-checkbox:hover {
    background: #e2e8f0;
}

.area-checkbox input {
    cursor: pointer;
}

.status-pill {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tag-area {
    display: inline-block;
    background: #e2e8f0;
    color: #475569;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    margin: 2px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pendiente {
    background-color: #fef3c7;
    color: #b45309;
}

.status-aprobado {
    background-color: #dcfce7;
    color: #15803d;
}

.status-rechazado {
    background-color: #fee2e2;
    color: #b91c1c;
}

.status-finalizado-control-interno {
    background-color: #e2e8f0;
    color: #475569;
}

.status-nuevo {
    background-color: #dcfce7;
    color: #15803d;
}

.status-en-gestion,
.status-desarrollo-plan-de-accion {
    background-color: #e0f2fe;
    color: #0369a1;
}

.status-revision-plan-de-accion-control-interno {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.status-asignado,
.status-en-revision-control-interno {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.status-pendiente-de-aprobación {
    background-color: #fef3c7;
    color: #92400e;
}

.status-pendiente-revisión-evidencia {
    background-color: #dcfce7;
    color: #166534;
}

/* Modals */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #EAF0F6 url('background_pattern_saro.png') repeat; /* FONDO AZUL WASH CORPORATIVO */
    background-size: 850px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

/* Marca de Agua para Login */
.overlay::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 300px;
    background: url('https://rentek.com.co/wp-content/uploads/2021/05/logo-rentek-header.png') no-repeat center center;
    background-size: contain;
    opacity: 0.05; /* Marca de agua sutil al 5% */
    z-index: -1;
    pointer-events: none;
}

.login-card {
    background: var(--white);
    padding: 3rem 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); /* Sombra Depth corregida */
    max-width: 450px; /* Ancho ajustado a 450px para elegancia */
    width: 90%;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--rentek-gold);
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 31, 61, 0.45); /* Azul Rentek Profundo translucido */
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Anclaje superior forzado */
    padding-top: 12vh; /* Tercio superior aprox 12% a 15% */
    z-index: 10000;
    transition: all 0.3s ease;
}

.modal-content {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    width: 900px;
    max-width: 95vw;
    max-height: 80vh; /* Ajuste para evitar desbordamiento inferior */
    overflow-y: auto;
    position: relative;
    z-index: 10001;
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10002;
}

.modal-close-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.modal-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Centrado solo si se desea explícitamente */
.text-center { text-align: center; }

.modal-confirm {
    width: 450px;
}

/* Heatmap & Matrix Redesign */
.heatmap-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.heatmap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.heatmap-grid-wrapper {
    display: flex;
    gap: 1.5rem;
}

.axis-y-label {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.heatmap-body {
    flex: 1;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: 35px repeat(5, 1fr);
    grid-template-rows: repeat(5, 120px) 35px;
    gap: 8px;
    width: 100%;
}

.heatmap-cell {
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    align-content: flex-start;
    position: relative;
    transition: transform 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.heatmap-cell:hover {
    transform: scale(1.02);
    z-index: 10;
}

.heatmap-cell-label {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 0.65rem;
    font-weight: 800;
    opacity: 0.3;
}

.cell-bajo {
    background-color: #dcfce7;
    color: #15803d;
}

.cell-moderado {
    background-color: #fef3c7;
    color: #92400e;
}

.cell-alto {
    background-color: #ffedd5;
    color: #ea580c;
}

.cell-extremo {
    background-color: #fee2e2;
    color: #b91c1c;
}

.axis-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.axis-x-label {
    grid-column: 2 / span 5;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    padding-top: 5px;
}

.risk-badge {
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    border: 1px solid currentColor;
}

.risk-badge:hover {
    filter: brightness(0.9);
}

/* Certification & Accountability */
.certification-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    margin-top: 2rem;
}

.certification-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.certification-banner {
    background: #ecfdf5;
    border: 1px solid #10b981;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.id-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
}

.control-badge {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* Badges de Tipo y Modo de Control */
.badge-tipo-preventivo {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-block;
    white-space: nowrap;
}

.badge-tipo-detectivo {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-block;
    white-space: nowrap;
}

.badge-tipo-correctivo {
    background: #f5f3ff;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-block;
    white-space: nowrap;
}

.badge-modo-automatico {
    background: #ecfeff;
    color: #155e75;
    border: 1px solid #a5f3fc;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-block;
    white-space: nowrap;
}

.badge-modo-manual {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-block;
    white-space: nowrap;
}

.badge-modo-semiautomatico {
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-block;
    white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}

/* Custom Success Modal */
.success-modal {
    text-align: center;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.success-modal h2 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.success-modal p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.radicado-number {
    display: block;
    font-weight: 700;
    color: var(--accent);
    font-size: 1.5rem;
    margin-top: 0.5rem;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--success);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 320px;
    max-width: 450px;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
}

.toast.removing {
    animation: slideOutRight 0.3s ease forwards;
}

.toast-icon {
    width: 24px;
    height: 24px;
    color: var(--success);
    flex-shrink: 0;
}

/* Toast Variants */
.toast-success {
    border-left-color: var(--success);
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-warning .toast-icon {
    color: var(--warning);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-error .toast-icon {
    color: var(--danger);
}

.toast-info {
    border-left-color: var(--info);
}

.toast-info .toast-icon {
    color: var(--info);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Success Modal & Confirm Icons */
.confirm-icon {
    width: 64px;
    height: 64px;
    background: var(--warning);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.btn-icon-sm {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon-sm:hover {
    background: #f1f5f9;
    color: var(--primary);
}

/* Help Center / Accordion */
.help-container {
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 3rem;
}

.accordion-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.accordion-item.active {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.accordion-header {
    padding: 1.25rem 1.5rem;
    background: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.accordion-header:hover {
    background: #f8fafc;
}

.accordion-header h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.accordion-icon {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
    color: var(--accent);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
    background: #fcfcfd;
}

.accordion-item.active .accordion-content {
    max-height: 2000px;
    transition: max-height 0.3s cubic-bezier(1, 0, 1, 0);
}

.accordion-body {
    padding: 1.5rem;
    line-height: 1.8;
    color: #475569;
    border-top: 1px solid var(--border);
}

.accordion-body ul {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.accordion-body li {
    margin-bottom: 0.75rem;
}

.help-concept {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 3px solid var(--accent);
}

.help-concept strong {
    color: var(--primary);
    display: block;
    margin-bottom: 0.25rem;
}

.help-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 0.75rem;
}

/* --- Management Form Sections --- */
.mgmt-section {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.mgmt-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #eef2f6;
    color: var(--primary);
}

.mgmt-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.disabled-field {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(1);
}

.disabled-field input, .disabled-field select {
    background: #f1f5f9 !important;
}

/* --- Expiration Clock (Reloj de Vencimiento) --- */
.deadline-widget {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.deadline-clock {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
    line-height: 1;
    color: white;
}

.deadline-clock span {
    font-size: 0.6rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 2px;
}

.deadline-text {
    flex: 1;
}

.deadline-text h4 {
    color: var(--primary);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.deadline-text p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.deadline-safe { background: #10B981; border-bottom: 4px solid #059669; }
.deadline-warning { background: #F59E0B; border-bottom: 4px solid #D97706; }
.deadline-danger { background: #EF4444; border-bottom: 4px solid #B91C1C; }

/* Status Badges */
.status-badge-closed {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #1e293b;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.support-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
}

.support-item {
    background: #fff;
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.support-item:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

/* --- Admin Reset Button (Soft & Professional) --- */
.btn-reset-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #dc2626; /* Rojo ligeramente más profundo y serio */
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    height: 38px; /* Altura fija para facilitar el centrado vertical externo */
    line-height: 1;
}

.btn-reset-soft svg,
.btn-reset-soft i {
    width: 14px !important;
    height: 14px !important;
    stroke-width: 2.5; /* Trazo más nítido a tamaño pequeño */
    flex-shrink: 0;
}

.btn-reset-soft:hover {
    background: #fef2f2;
    color: #991b1b;
    border-color: #f87171;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.1);
}

.btn-reset-soft:active {
    transform: translateY(0);
}

/* --- Matriz de Hallazgos y Semáforos --- */
.bg-blue-100 { background-color: #dbeafe !important; }
.text-blue-800 { color: #1e40af !important; border-color: #bfdbfe; }

.bg-green-100 { background-color: #dcfce7 !important; }
.text-green-800 { color: #166534 !important; border-color: #bbf7d0; }

.bg-yellow-100 { background-color: #fef9c3 !important; }
.text-yellow-800 { color: #854d0e !important; }
.border-yellow-300 { border-color: #fde047 !important; }

.bg-red-100 { background-color: #fee2e2 !important; }
.text-red-800 { color: #991b1b !important; }
.border-red-300 { border-color: #fca5a5 !important; }

.status-abierto { background-color: #fee2e2; color: #b91c1c; }
.status-en-revisión { background-color: #e0f2fe; color: #0369a1; }
.status-cerrado { background-color: #dcfce7; color: #15803d; }

/* --- Hallazgos Workflow & Time Status --- */
.time-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.time-green {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}

.time-yellow {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}

.time-red {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.workflow-step {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.workflow-step h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.status-pendiente-aprobacion-plan { background: #e0e7ff; color: #4338ca; }
.status-en-ejecucion { background: #dcfce7; color: #166534; }
.status-pendiente-aprobacion-cierre { background: #fef9c3; color: #854d0e; }

/* ==========================================================================
   Dashboard Tabs and Segments (Added)
   ========================================================================== */
.dashboard-tabs-container {
    background: var(--white);
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    box-shadow: var(--shadow-sm);
    border-bottom: 2px solid #e2e8f0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.dashboard-tabs {
    display: flex;
    gap: 1.5rem;
    margin: 0;
    border-bottom: none;
    padding: 0;
}

.dashboard-tab {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    background: none;
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-muted);
    position: relative;
    transition: all 0.2s ease;
}

.dashboard-tab:hover {
    color: var(--rentek-blue-light);
}

.dashboard-tab.active {
    color: var(--rentek-blue) !important;
}

.dashboard-tab.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 100%;
    height: 3.5px;
    background-color: var(--rentek-blue);
    border-radius: 2px;
}

.regularizer-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.regularizer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
