* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: white;
    min-height: 100vh;
    color: #334155;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 40px;
    line-height: 1.2;
}

/* Gender Selector in Modal */
.gender-selector-modal {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.gender-btn-modal {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.gender-btn-modal.active {
    background: #1e40af;
    color: white;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.2);
}

.gender-btn-modal:hover:not(.active) {
    background: #e2e8f0;
    color: #475569;
}

.gender-selector {
    display: flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 30px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.gender-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gender-btn.active {
    background: #1e40af;
    color: white;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

.gender-btn:hover:not(.active) {
    background: #e2e8f0;
    color: #475569;
}

.subtitle {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 30px;
}

/* Members Grid */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.additional-members {
    margin-top: 0;
    margin-bottom: 20px;
}

.member-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-height: 120px;
    justify-content: center;
}

.member-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 14px; 
}

.member-card:hover {
    border-color: #3b82f6;
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(30, 64, 175, 0.15);
}

.member-card:hover::before {
    opacity: 1;
}

.member-card.selected {
    border-color: #1e40af;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.2);
    transform: translateY(-2px);
}

.member-card.selected::before {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    opacity: 1;
}

.member-card:not(.selected):not(.add-member) {
    border-color: #cbd5e1;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    opacity: 0.7;
}

.member-card:not(.selected):not(.add-member):hover {
    border-color: #64748b;
    opacity: 1;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
}

.member-card:not(.selected):not(.add-member) .member-label {
    color: #64748b;
}

.member-card.selected .member-label {
    color: #1e40af;
    font-weight: 600;
}

.member-card.add-member {
    border-style: dashed;
    border-color: #3b82f6;
    background: linear-gradient(135deg, #fafbff 0%, #f0f9ff 100%);
}

.member-card.add-member:hover {
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    border-color: #1e40af;
}

.member-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-label {
    font-weight: 500;
    color: #1e293b;
    font-size: 0.95rem;
}

.remove-btn {
    position: absolute;
    top: 6px; 
    right: 6px;
    width: 28px;
    height: 28px;
    background: #ef4444;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.6);
}

.continue-btn {
    width: 100%;
    max-width: 300px;
    padding: 16px 30px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.continue-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.continue-btn:hover:not(.disabled) {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(30, 64, 175, 0.4);
}

.continue-btn:hover:not(.disabled)::before {
    left: 100%;
}

.continue-btn:active:not(.disabled) {
    transform: translateY(0);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.3);
}

.continue-btn.disabled {
    background: linear-gradient(135deg, #94a3b8 0%, #cbd5e1 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 25px 30px 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f1f5f9;
    color: #374151;
}

.modal-body {
    padding: 0 30px;
}

.form-group {
    margin-bottom: 20px;
}

/* NEW: Form row for name/lastname */
.form-row {
    display: flex;
    gap: 15px;
}

.form-group.half-width {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-group input:hover,
.form-group select:hover {
    border-color: #3b82f6;
    background-color: white;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.12);
    transform: translateY(-1px);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 18px;
    cursor: pointer;
    position: relative;
    background-color: #fafbff;
    padding-right: 45px;
}

/* NEW: Phone input container */
.phone-input-container {
    display: flex;
    gap: 8px;
}

.country-select {
    flex: 0 0 140px;
    padding: 14px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9rem;
    background: #fafbff;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    padding-right: 30px;
}

.phone-number-input {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.phone-number-input:focus,
.country-select:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.phone-format {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 6px;
    font-style: italic;
}

.modal-footer {
    padding: 20px 30px 30px;
}

.add-beneficiary-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.add-beneficiary-btn:hover:not(.disabled) {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.3);
}

.add-beneficiary-btn.disabled {
    background: linear-gradient(135deg, #94a3b8 0%, #cbd5e1 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================
   DISEASE ASSIGNMENT MODAL STYLES
   ============================================ */

#diseaseAssignmentModal {
    z-index: 10000 !important;
}

.disease-assignment-modal-content {
    max-width: 500px;
    overflow: hidden;
}

.disease-modal-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 30px 20px !important;
    position: relative;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

.disease-modal-header .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
}

.disease-modal-icon {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.15);
}

.disease-modal-header h2 {
    font-size: 1.3rem;
    color: #1e293b;
    margin: 0;
}

.disease-modal-body {
    padding: 25px 30px !important;
}

.disease-progress {
    margin-bottom: 20px;
}

.disease-progress span {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e40af, #3b82f6);
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.current-disease-name {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 15px 20px;
    text-align: center;
    margin-bottom: 20px;
}

.current-disease-name .disease-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #92400e;
}

.disease-modal-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 15px;
    text-align: center;
}

.members-selection-list {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 5px;
}

.members-selection-list::-webkit-scrollbar {
    width: 5px;
}

.members-selection-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.members-selection-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.member-selection-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.member-selection-item:last-child {
    margin-bottom: 0;
}

.member-selection-item:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateX(4px);
}

.member-selection-item.selected {
    border-color: #1e40af;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.15);
}

.member-selection-item .custom-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.member-selection-item.selected .custom-checkbox {
    background: #1e40af;
    border-color: #1e40af;
}

.member-selection-item .custom-checkbox svg {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.member-selection-item.selected .custom-checkbox svg {
    opacity: 1;
    transform: scale(1);
}

.member-selection-item .member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.member-selection-item .member-details {
    flex: 1;
    min-width: 0;
}

.member-selection-item .member-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.member-selection-item .member-relationship {
    font-size: 0.8rem;
    color: #64748b;
}

.disease-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px 25px !important;
    gap: 12px;
    border-top: 1px solid #e2e8f0;
}

.disease-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.disease-nav-btn.prev-btn {
    background: #f1f5f9;
    color: #475569;
}

.disease-nav-btn.prev-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.disease-nav-btn.next-btn {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    margin-left: auto;
}

.disease-nav-btn.next-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.3);
}

.disease-nav-btn.finish-btn {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    margin-left: auto;
}

.disease-nav-btn.finish-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

/* Medical History Screen */
.hidden {
    display: none;
}

.header-with-back {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    text-align: left;
}

.back-btn {
    background: #f1f5f9;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: #e2e8f0;
}

.medical-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 30px;
    text-align: left;
    line-height: 1.5;
}

.diseases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.disease-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.disease-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.disease-card:hover {
    border-color: #3b82f6;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(30, 64, 175, 0.15);
}

.disease-card:hover::before {
    opacity: 1;
}

.disease-card.selected {
    border-color: #1e40af;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.2);
    transform: translateY(-2px);
}

.disease-card.selected::before {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    opacity: 1;
}

.disease-card input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #1e40af;
    cursor: pointer;
    margin: 0;
    z-index: 2;
    position: relative;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.disease-card input[type="checkbox"]:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.disease-card label {
    flex: 1;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.4;
    z-index: 2;
    position: relative;
    transition: color 0.3s ease;
}

.disease-card:hover label {
    color: #1e40af;
}

.disease-card.selected label {
    color: #1e40af;
    font-weight: 600;
}

.disease-card[data-disease="ninguna"] {
    border-style: dashed;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.disease-card[data-disease="ninguna"]:hover {
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
}

.disease-card[data-disease="ninguna"].selected {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-style: solid;
}

.whatsapp-notifications {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.whatsapp-notifications span {
    font-weight: 500;
    color: #374151;
}

.toggle-switch {
    position: relative;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-label {
    display: block;
    width: 50px;
    height: 28px;
    background: #cbd5e1;
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-label::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="checkbox"]:checked + .toggle-label {
    background: #1e40af;
}

input[type="checkbox"]:checked + .toggle-label::after {
    transform: translateX(22px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    h1 {
        font-size: 1.6rem;
        margin-bottom: 30px;
    }
    
    .subtitle, .medical-subtitle {
        font-size: 1rem;
    }
    
    .members-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .member-card.add-member {
        order: -1;
    }
    
    .member-card {
        padding: 16px;
        min-height: 110px;
    }
    
    .member-icon {
        width: 45px;
        height: 45px;
    }
    
    .member-label {
        font-size: 0.9rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-header {
        padding: 20px 25px 0;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 0 25px;
    }
    
    .modal-footer {
        padding: 20px 25px 25px;
    }

    /* Form row responsive */
    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .form-group.half-width {
        flex: none;
    }
    
    .diseases-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .disease-card {
        padding: 16px;
    }
    
    .whatsapp-notifications {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 16px;
    }
    
    .continue-btn {
        font-size: 1rem;
        padding: 14px 25px;
    }
    
    .gender-selector-modal {
        gap: 2px;
        padding: 3px;
    }
    
    .gender-btn-modal {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    /* Phone input responsive */
    .phone-input-container {
        flex-direction: column;
        gap: 15px;
    }

    .country-select {
        flex: none;
        width: 100%;
    }

    /* Disease modal responsive */
    .disease-assignment-modal-content {
        width: 95%;
        margin: 3% auto;
    }

    .disease-modal-header {
        padding: 25px 20px 15px !important;
    }

    .disease-modal-body {
        padding: 20px !important;
    }

    .disease-modal-footer {
        padding: 15px 20px 20px !important;
        flex-wrap: wrap;
    }

    .disease-nav-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px 10px;
    }
    
    h1 {
        font-size: 1.4rem;
        line-height: 1.3;
    }
    
    .members-grid {
        grid-template-columns: 1fr;
        max-width: 250px;
        margin: 0 auto 30px;
    }
    
    .modal-content {
        width: 98%;
        margin: 2% auto;
    }
    
    .modal-header {
        padding: 15px 20px 0;
    }
    
    .modal-body {
        padding: 0 20px;
    }
    
    .modal-footer {
        padding: 15px 20px 20px;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
    .disease-card {
        padding: 14px;
    }
    
    .disease-card input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
    
    .disease-card label {
        font-size: 0.9rem;
    }
    
    .whatsapp-notifications {
        padding: 14px;
    }
    
    .continue-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .header-with-back h1 {
        font-size: 1.3rem;
    }

    .disease-modal-footer {
        gap: 8px;
    }

    .disease-nav-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 10px 8px;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    .member-card {
        padding: 12px;
        min-height: 100px;
    }
    
    .member-icon {
        width: 40px;
        height: 40px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .disease-card {
        padding: 12px;
        gap: 10px;
    }
    
    .continue-btn {
        max-width: 100%;
    }
}

/* FIX MAINSCREEN SOBREPUESTO EN MÓVIL */
body {
    padding-top: 155px !important;
}

#mainScreen {
    padding-top: 35px !important;
    margin-top: 0 !important;
    padding-bottom: 30px !important;
}

#medicalHistoryScreen {
    padding-top: 35px !important;
    margin-top: 0 !important;
    padding-bottom: 30px !important;
}

#mainScreen h1 {
    margin-top: 0 !important;
    padding-top: 15px !important;
    font-size: 1.8rem !important;
    line-height: 1.3 !important;
    margin-bottom: 25px !important;
}

@media (max-width: 768px) {
    body {
        padding-top: 140px !important;
    }
    
    #mainScreen {
        padding-top: 30px !important;
        padding-bottom: 25px !important;
    }
    
    #medicalHistoryScreen {
        padding-top: 30px !important;
        padding-bottom: 25px !important;
    }
    
    #mainScreen h1 {
        padding-top: 10px !important;
        font-size: 1.6rem !important;
        margin-bottom: 20px !important;
    }
}

@media (max-width: 576px) {
    body {
        padding-top: 130px !important;
    }
    
    #mainScreen {
        padding-top: 25px !important;
        padding-bottom: 20px !important;
    }
    
    #medicalHistoryScreen {
        padding-top: 25px !important;
        padding-bottom: 20px !important;
    }
    
    #mainScreen h1 {
        font-size: 1.4rem !important;
        margin-bottom: 20px !important;
        padding-top: 10px !important;
    }
}

@media (max-width: 360px) {
    body {
        padding-top: 125px !important;
    }
    
    #mainScreen {
        padding-top: 20px !important;
        padding-bottom: 15px !important;
    }
    
    #mainScreen h1 {
        font-size: 1.2rem !important;
        margin-bottom: 15px !important;
        padding-top: 8px !important;
    }
}

@media (min-width: 992px) {
    body {
        padding-top: calc(var(--topbar-height) + var(--navbar-height)) !important;
    }
    
    #mainScreen,
    #medicalHistoryScreen {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
    
    #mainScreen h1 {
        font-size: 2rem !important;
        margin-bottom: 40px !important;
        padding-top: 0 !important;
    }
}

#mainScreen .continue-btn,
#medicalHistoryScreen .continue-btn {
    margin-bottom: 30px !important;
}

footer,
.footer {
    margin-top: 40px !important;
}

@media (max-width: 768px) {
    footer,
    .footer {
        margin-top: 30px !important;
    }
    
    #mainScreen .continue-btn,
    #medicalHistoryScreen .continue-btn {
        margin-bottom: 25px !important;
    }
}

/* SOLUCIÓN ESPECÍFICA PARA MODAL Z-INDEX */
#beneficiaryModal {
    z-index: 9999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(4px) !important;
}

#beneficiaryModal[style*="block"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
}

#beneficiaryModal .modal-content {
    position: relative !important;
    z-index: 10000 !important;
    margin: 20px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
}

#beneficiaryModal .close-btn {
    position: absolute !important;
    top: 15px !important;
    right: 20px !important;
    z-index: 10001 !important;
    width: 35px !important;
    height: 35px !important;
    background: #f8f9fa !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 50% !important;
    font-size: 18px !important;
    color: #6c757d !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    font-weight: bold !important;
    line-height: 1 !important;
}

#beneficiaryModal .close-btn:hover {
    background: #e9ecef !important;
    color: #495057 !important;
    border-color: #adb5bd !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

#diseaseAssignmentModal[style*="block"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.nav-item .position-relative .badge {
    position: absolute !important;
    top: -2px !important;
    right: -2px !important;
    min-width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    font-size: 0.7rem !important;
    background: #dc3545 !important;
    color: white !important;
}