* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* ================================
   LOGIN PACIENTE
================================ */
.login-container {
    display: flex;
    min-height: 100vh;
}

.login-left {
    flex: 1;
    background: #28a745;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 3rem 2rem;
    position: relative;
}

.login-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 25%, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.05) 50%, transparent 50%, transparent 75%, rgba(255,255,255,0.05) 75%);
    background-size: 20px 20px;
}

.login-left-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 400px;
}

.heart-icon {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.heart-icon::before {
    content: '♥';
    font-size: 3rem;
    color: #28a745;
}

.login-left h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.login-left p {
    font-size: 1.2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    padding: 2rem;
}

.login-form {
    width: 100%;
    max-width: 450px;
    padding: 2rem;
}

.form-tabs {
    display: flex;
    margin-bottom: 2.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 6px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-button {
    flex: 1;
    padding: 14px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    color: #6c757d;
}

.tab-button.active {
    background: white;
    color: #28a745;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    color: #495057;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: #adb5bd;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 16px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #218838 0%, #1ca085 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.form-link {
    text-align: center;
    color: #6c757d;
    font-size: 0.95rem;
}

.form-link a {
    color: #28a745;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.form-link a:hover {
    color: #218838;
    text-decoration: underline;
}

.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f1c2c7 100%);
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #f5c6cb;
    font-weight: 500;
}

/* ================================
   DASHBOARD PACIENTE
================================ */
.dashboard-split {
    display: flex;
    min-height: 100vh;
}

.dashboard-left {
    width: 30%;
    background: #28a745;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 3rem 2rem;
    position: relative;
}

.dashboard-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 25%, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.05) 50%, transparent 50%, transparent 75%, rgba(255,255,255,0.05) 75%);
    background-size: 20px 20px;
}

.patient-portal-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.patient-portal-content .heart-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
}

.patient-portal-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.patient-portal-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 3rem;
}

.portal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-outline {
    padding: 12px 28px;
    border: 2px solid white;
    background: transparent;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: white;
    color: #28a745;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.dashboard-right {
    flex: 1;
    background: #f8f9fc;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    background: linear-gradient(135deg, #20B2AA 0%, #17a2b8 100%);
    color: white;
    padding: 2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(32, 178, 170, 0.3);
}

.dashboard-header h1 {
    font-size: 1.8rem;
    margin: 0;
    font-weight: 700;
}

.dashboard-header small {
    opacity: 0.8;
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.user-details span {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
}

.user-details strong {
    font-size: 1rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.dashboard-content {
    flex: 1;
    padding: 2.5rem;
}

.welcome-section {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.date-header {
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.welcome-title {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: #333;
    font-weight: 700;
}

.btn-new-appointment {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-new-appointment:hover {
    background: linear-gradient(135deg, #218838 0%, #1ca085 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.stat-icon.upcoming { background: linear-gradient(135deg, #007bff 0%, #0056b3 100%); }
.stat-icon.completed { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); }
.stat-icon.wellness { background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%); }
.stat-icon.therapist { background: linear-gradient(135deg, #9c27b0 0%, #6a1b99 100%); }

.stat-content h3 {
    font-size: 2.2rem;
    margin: 0;
    color: #333;
    font-weight: 700;
}

.stat-content p {
    margin: 0;
    color: #6c757d;
    font-size: 0.95rem;
    font-weight: 500;
}

.sections-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.section-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #333;
    font-weight: 700;
}

.section-subtitle {
    color: #6c757d;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.therapist-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    border: 2px solid #f1f3f4;
    border-radius: 16px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.therapist-card:hover {
    border-color: #28a745;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.15);
    transform: translateY(-2px);
}

.therapist-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.therapist-info h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-weight: 700;
}

.therapist-info p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.therapist-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.rating {
    color: #ffc107;
    font-weight: 600;
}

.price {
    font-weight: 700;
    color: #28a745;
}

.status-available {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: auto;
}

.btn-schedule {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: auto;
    transition: all 0.3s ease;
}

.btn-schedule:hover {
    background: linear-gradient(135deg, #218838 0%, #1ca085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.appointment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.appointment-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.appointment-status {
    padding: 6px 16px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-confirmed {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

/* ================================
   LOGIN ADMIN
================================ */
.admin-login-container {
    display: flex;
    min-height: 100vh;
}

.admin-login-left {
    flex: 1;
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 3rem 2rem;
    position: relative;
}

.admin-login-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 25%, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.05) 50%, transparent 50%, transparent 75%, rgba(255,255,255,0.05) 75%);
    background-size: 20px 20px;
}

.admin-icon {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.admin-icon::before {
    content: '🛡️';
    font-size: 3rem;
}

/* ================================
   DASHBOARD ADMIN
================================ */
.admin-dashboard-split {
    display: flex;
    min-height: 100vh;
}

.admin-dashboard-left {
    width: 30%;
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 3rem 2rem;
    position: relative;
}

.admin-dashboard-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 25%, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.05) 50%, transparent 50%, transparent 75%, rgba(255,255,255,0.05) 75%);
    background-size: 20px 20px;
}

.admin-portal-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.admin-portal-content .admin-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
}

.admin-portal-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.admin-portal-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 3rem;
}

.admin-dashboard-header {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: white;
    padding: 2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3);
}

.admin-user-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.admin-stat-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.admin-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.admin-stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.admin-stat-icon.total-citas { background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); }
.admin-stat-icon.terapeutas { background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%); }
.admin-stat-icon.asistencias { background: linear-gradient(135deg, #27ae60 0%, #229954 100%); }
.admin-stat-icon.pendientes { background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%); }

.admin-sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.admin-section-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.admin-section-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.admin-section-icon {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.appointment-item-admin {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.appointment-item-admin:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.appointment-time {
    text-align: center;
    min-width: 90px;
}

.appointment-time .time {
    font-weight: bold;
    font-size: 1.2rem;
    color: #333;
}

.appointment-time .date {
    font-size: 0.8rem;
    color: #6c757d;
}

.appointment-patient {
    flex: 1;
}

.appointment-patient h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-weight: 700;
}

.appointment-patient p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.appointment-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-icon-small {
    background: rgba(108, 117, 125, 0.1);
    border: none;
    color: #6c757d;
    font-size: 1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-icon-small:hover {
    background: rgba(108, 117, 125, 0.2);
    color: #333;
    transform: translateY(-1px);
}

.btn-new-admin {
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3);
}

.btn-new-admin:hover {
    background: linear-gradient(135deg, #7d3c98 0%, #8e44ad 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(142, 68, 173, 0.4);
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
    .login-container,
    .dashboard-split,
    .admin-login-container,
    .admin-dashboard-split {
        flex-direction: column;
    }
    
    .login-left,
    .dashboard-left,
    .admin-login-left,
    .admin-dashboard-left {
        width: 100%;
        padding: 2rem 1rem;
    }
    
    .login-right {
        padding: 1rem;
    }
    
    .stats-grid,
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .sections-grid,
    .admin-sections-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-content {
        padding: 1rem;
    }
    
    .dashboard-header,
    .admin-dashboard-header {
        padding: 1.5rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .user-info {
        gap: 0.5rem;
    }
}