* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
}

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-container {
    max-width: 450px;
    margin: 50px auto;
    padding: 2.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.login-container h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.login-container p {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.login-container input {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.login-container input:focus {
    border-color: #3498db;
    outline: none;
}

.login-container button {
    width: 100%;
    padding: 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s;
}

.login-container button:hover {
    background: #2980b9;
}

.login-container button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Credenciales de prueba */
.credenciales-prueba {
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.credenciales-prueba h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.credenciales-prueba p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: #555;
}

/* Main Screen */
header {
    background: #2c3e50;
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#welcomeMessage {
    font-size: 1.2rem;
}

#logoutBtn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

#logoutBtn:hover {
    background: #c0392b;
}

/* Tabs */
.tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    padding: 1.2rem;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
}

.tab-btn.active {
    border-bottom-color: #3498db;
    color: #3498db;
    background: #f8f9fa;
}

.tab-btn:hover:not(.active) {
    background: #f8f9fa;
}

.tab-content {
    display: none;
    padding: 1.5rem;
    background: #f8f9fa;
    min-height: calc(100vh - 120px);
}

.tab-content.active {
    display: block;
}

/* Cards */
.card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.card h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 0.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #3498db;
    outline: none;
}

.familia-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.familia-item input {
    flex: 2;
    margin: 0;
}

.familia-item select {
    flex: 1;
    margin: 0;
}

.remove-familia {
    background: #e74c3c;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s;
}

.remove-familia:hover {
    background: #c0392b;
}

#addFamilia {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

#addFamilia:hover {
    background: #219a52;
}

.btn-primary {
    background: #3498db;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    width: 100%;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* List Styles */
.solicitudes-list,
.pagos-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.solicitud-item,
.pago-item {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 5px solid #3498db;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.solicitud-item:hover,
.pago-item:hover {
    transform: translateY(-2px);
}

.solicitud-item.pendiente {
    border-left-color: #f39c12;
}

.solicitud-item.entregado {
    border-left-color: #27ae60;
}

.solicitud-header,
.pago-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.solicitud-header h4,
.pago-header h4 {
    color: #2c3e50;
    margin: 0;
}

.estado-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.estado-pendiente { 
    background: #f39c12; 
    color: white; 
}

.estado-entregado { 
    background: #27ae60; 
    color: white; 
}

.urgente-badge {
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
}

.confirmar-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: 500;
    transition: background 0.3s;
}

.confirmar-btn:hover {
    background: #219a52;
}

.pago-confirmado {
    color: #27ae60;
    font-weight: 600;
    margin-top: 10px;
}

/* Estados vacíos */
.solicitud-vacia,
.pago-vacio {
    text-align: center;
    padding: 3rem 2rem;
    color: #7f8c8d;
}

.solicitud-vacia p:first-child,
.pago-vacio p:first-child {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal-content h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 1.5rem;
}

.modal-buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.modal-buttons button:first-child {
    background: #95a5a6;
    color: white;
}

.modal-buttons button:first-child:hover {
    background: #7f8c8d;
}

.error-message {
    color: #e74c3c;
    margin-top: 10px;
    display: none;
    padding: 10px;
    background: #fdf2f2;
    border-radius: 6px;
    border-left: 4px solid #e74c3c;
}

/* Responsive */
@media (max-width: 768px) {
    .login-container {
        margin: 20px 1rem;
        padding: 2rem;
    }
    
    .familia-item {
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 1rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .solicitud-header,
    .pago-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .modal-content {
        padding: 2rem 1.5rem;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .solicitud-item, .pago-item {
    animation: fadeIn 0.5s ease-out;
}