/* Reset y estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', 'Roboto', sans-serif;
}

:root {
    --primary: #2a5ca9;
    --primary-dark: #1e3f7a;
    --primary-light: #4a7fd4;
    --secondary: #00b894;
    --secondary-dark: #00a085;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --gray: #95a5a6;
    --gray-light: #ecf0f1;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: var(--dark);
    overflow-x: hidden;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    display: flex;
    max-width: 1200px;
    width: 100%;
    height: 85vh;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    z-index: 10;
    position: relative;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-left h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.login-left .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 40px;
    font-weight: 300;
}

.features {
    margin-top: 30px;
}

.feature {
    margin-bottom: 30px;
    padding-left: 20px;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.feature i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--secondary);
}

.feature h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.feature p {
    opacity: 0.8;
    font-size: 0.95rem;
}

.login-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.login-card {
    width: 100%;
    max-width: 450px;
    background: white;
    border-radius: 15px;
    padding: 40px 35px;
    box-shadow: var(--shadow);
}

.login-card h2 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.login-instruction {
    color: var(--gray);
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.1rem;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid var(--gray-light);
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(42, 92, 169, 0.1);
}

.show-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 1.1rem;
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.remember-forgot label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.remember-forgot input {
    margin-right: 8px;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-login:hover {
    background: linear-gradient(to right, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(42, 92, 169, 0.3);
}

.demo-credentials {
    background: var(--gray-light);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.demo-credentials p {
    margin-bottom: 5px;
}

.role-selector {
    margin-bottom: 25px;
}

.role-selector p {
    margin-bottom: 15px;
    font-weight: 500;
}

.role-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.role-btn {
    padding: 12px;
    background: var(--gray-light);
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.role-btn:hover {
    background: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.role-btn i {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.role-btn[data-role="directiva"] i { color: #f1c40f; }
.role-btn[data-role="medico"] i { color: #e74c3c; }
.role-btn[data-role="rrhh"] i { color: #2ecc71; }
.role-btn[data-role="seguridad"] i { color: #3498db; }

.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-light);
    font-size: 0.85rem;
    color: var(--gray);
}

.login-footer i {
    color: var(--secondary);
    margin-right: 5px;
}

.copyright {
    margin-top: 10px;
    font-size: 0.8rem;
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Dashboard y layout general */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--dark);
    color: white;
    padding: 25px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 0 25px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 25px;
}

.sidebar-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
}

.sidebar-header h2 i {
    color: var(--secondary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 25px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.user-details h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.user-details p {
    font-size: 0.8rem;
    opacity: 0.7;
}

.sidebar-menu {
    list-style: none;
    padding: 0 15px;
}

.menu-item {
    margin-bottom: 5px;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition);
}

.menu-item a:hover, .menu-item a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.menu-item a i {
    width: 20px;
    text-align: center;
}

.menu-item a.active {
    background: var(--primary);
    font-weight: 500;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 25px;
    background: var(--light);
    min-height: 100vh;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-light);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb i {
    font-size: 0.8rem;
    color: var(--gray);
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--gray-light);
    border-radius: 20px;
    width: 250px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.notification-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--dark);
    cursor: pointer;
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-menu img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 2.2rem;
    color: var(--dark);
    margin-bottom: 10px;
}

.page-header p {
    color: var(--gray);
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 992px) {
    .login-container {
        flex-direction: column;
        height: auto;
    }
    
    .login-left, .login-right {
        width: 100%;
    }
    
    .login-left {
        padding: 30px;
    }
    
    .sidebar {
        width: 70px;
    }
    
    .sidebar-header h2 span, 
    .user-details, 
    .menu-item a span {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .sidebar:hover {
        width: 250px;
    }
    
    .sidebar:hover .sidebar-header h2 span,
    .sidebar:hover .user-details,
    .sidebar:hover .menu-item a span {
        display: block;
    }
    
    .sidebar:hover .user-info {
        flex-direction: row;
    }
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .role-buttons {
        grid-template-columns: 1fr;
    }
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal {
  background: white;
  padding: 30px;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--gray-light);
  text-align: left;
  font-size: 0.95rem;
}

.data-table th {
  background: var(--dark);
  color: white;
}

.badge {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

.badge.leve { background: #fdcb6e; color: #333; }
.badge.moderado { background: #e17055; }
.badge.grave { background: #d63031; }

.badge.estado {
  background: var(--info);
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.kpi-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.kpi-card .kpi-value {
  font-size: 2rem;
  font-weight: 700;
}

.kpi-card.success { border-left: 5px solid #2ecc71; }
.kpi-card.danger  { border-left: 5px solid #e74c3c; }
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.chart-container {
  padding: 24px;
}
