:root {
    --primary-color: #000000;
    --secondary-color: #333333;
    --accent-color: #E67E22;
    --success-color: #27AE60;
    --danger-color: #E74C3C;
    --warning-color: #F39C12;
    --light-bg: #ECF0F1;
    --dark-text: #000000;
    --white: #FFFFFF;
    --gray: #95A5A6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--light-bg);
    color: var(--dark-text);
}

/* Login Styles */
.login-body {
    height: 100vh;
    overflow: hidden;
}

.login-container {
    display: flex;
    height: 100vh;
}

.login-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    padding: 2rem;
}

.login-content {
    max-width: 400px;
    width: 100%;
}

.logo-login {
    width: 180px;
    margin-bottom: 2rem;
}

.login-left h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-left p {
    color: var(--gray);
    margin-bottom: 2rem;
}

.login-form {
    margin-top: 2rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group i:first-child {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.input-group input {
    width: 100%;
    padding: 15px 45px;
    border: 2px solid transparent;
    border-radius: 10px;
    background: var(--light-bg);
    font-size: 1rem;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--white);
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--gray);
}

.btn-login {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-login i {
    transition: transform 0.3s;
}

.btn-login:hover i {
    transform: translateX(5px);
}

.login-right {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    position: relative;
    overflow: hidden;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-content {
    text-align: center;
    color: var(--white);
    padding: 2rem;
}

.overlay-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
    justify-content: center;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.feature i {
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.2);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.feature span {
    font-size: 0.9rem;
    font-weight: 500;
}

.message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.message.error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.message.success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

/* Dashboard Styles */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--primary-color);
    color: var(--white);
    transition: all 0.3s;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header img {
    width: 150px;
    margin-bottom: 1rem;
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 300;
    color: var(--gray);
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-item {
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.menu-item:hover,
.menu-item.active {
    background: var(--secondary-color);
    border-left: 4px solid var(--accent-color);
}

.menu-item i {
    width: 20px;
    font-size: 1.2rem;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: var(--white);
    padding: 1rem 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.page-title {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.2rem;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    background: var(--light-bg);
    color: var(--primary-color);
    font-weight: 600;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--light-bg);
}

tr:hover {
    background: rgba(236, 240, 241, 0.3);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--secondary-color);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--light-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--light-bg);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Estilos específicos para el dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.stat-info .number {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }
    
    .login-left,
    .login-right {
        flex: none;
        height: auto;
    }
    
    .login-right {
        display: none;
    }
    
    .sidebar {
        width: 70px;
    }
    
    .sidebar-header h3,
    .menu-item span {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .menu-item {
        justify-content: center;
        padding: 1rem;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature {
        flex-direction: row;
        justify-content: flex-start;
        padding: 0.5rem 1rem;
    }
    
    .feature i {
        margin-bottom: 0;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* Grid de 5 columnas para las stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-card small {
    display: block;
    color: var(--gray);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Estilos para notificaciones y calendario */
.notification-badge {
    background: #E74C3C;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    margin-left: auto;
    min-width: 18px;
    text-align: center;
}

.notification-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 350px;
    max-height: 500px;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none;
}

.notification-panel.active {
    display: block;
}

.notification-header {
    background: linear-gradient(135deg, #2C3E50, #34495E);
    color: white;
    padding: 15px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.3s;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.urgente {
    border-left: 4px solid #E74C3C;
}

.notification-item.alta {
    border-left: 4px solid #E67E22;
}

.notification-item.media {
    border-left: 4px solid #F39C12;
}

.notification-item.baja {
    border-left: 4px solid #27AE60;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.notification-date {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 20px;
}

.calendario-dia {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    min-height: 100px;
    position: relative;
}

.calendario-dia.vencimiento {
    background: #fff3cd;
    border-color: #ffc107;
}

.calendario-dia.vencido {
    background: #f8d7da;
    border-color: #E74C3C;
}

.calendario-dia .dia-numero {
    font-weight: bold;
    margin-bottom: 5px;
}

.calendario-evento {
    font-size: 0.8rem;
    padding: 2px 4px;
    margin: 2px 0;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendario-evento.urgente {
    background: #E74C3C;
    color: white;
}

.calendario-evento.alta {
    background: #E67E22;
    color: white;
}

.calendario-evento.media {
    background: #F39C12;
    color: white;
}

.calendario-evento.baja {
    background: #27AE60;
    color: white;
}

.calendario-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendario-titulo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2C3E50;
}

.prioridad-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.prioridad-urgente { background: #E74C3C; }
.prioridad-alta { background: #E67E22; }
.prioridad-media { background: #F39C12; }
.prioridad-baja { background: #27AE60; }


/* Ajustes de z-index para modales */
.modal {
    z-index: 1000;
}

#modalDetalle {
    z-index: 1001;
}

#modalAgregarObservacion {
    z-index: 1002;
}

/* Para asegurar que el modal de observaciones siempre esté por encima */
.modal.active {
    display: flex !important;
}

/* Estilo para el overlay cuando hay múltiples modales */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}