/* Caregiver Portal Styles */
.portal-layout {
    min-height: 100vh;
    background-color: var(--bg-gray);
    display: flex;
    flex-direction: column;
}

.portal-content {
    padding: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

.portal-header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3.5rem;
}

.portal-greeting-area {
    display: flex;
    flex-direction: column;
}

.portal-meta-badges {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.badge-portal {
    background-color: #EFF6FF;
    color: var(--primary-blue);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-date {
    color: #9CA3AF;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.portal-greeting {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.portal-status-text {
    font-size: 1.125rem;
    color: #4B5563;
    margin: 0 0 1.5rem 0;
}

.portal-quick-actions {
    display: flex;
    gap: 1rem;
}

.btn-portal-action {
    background: var(--white);
    border: 1px solid #E5E7EB;
    color: #4B5563;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.btn-portal-action:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.action-icon-blue {
    color: var(--primary-blue);
}

.action-icon-red {
    color: #A03E21;
}

.progress-widget {
    background: var(--white);
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 1.5rem;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.progress-percentage {
    font-size: 0.9rem;
    font-weight: 800;
    color: #005F54;
}

.progress-bar-container {
    height: 8px;
    background-color: #F3F4F6;
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-bar-fill {
    height: 100%;
    background-color: #005F54;
    border-radius: 9999px;
}

.progress-fraction {
    text-align: right;
    font-size: 0.75rem;
    font-weight: 700;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0 0 2rem 0;
    letter-spacing: -0.01em;
}

.section-marker {
    width: 4px;
    height: 24px;
    background-color: var(--primary-blue);
    border-radius: 4px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Caregiver Module Cards */
.module-card {
    background: var(--white);
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.module-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.module-badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.35rem 0.8rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.module-badge.general {
    background: #ECFDF5;
    color: #005F54;
}

.module-badge.safety {
    background: #FEF2F2;
    color: #A03E21;
}

.module-badge.clinical {
    background: #EFF6FF;
    color: var(--primary-blue);
}

.module-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.module-icon.completed {
    background: #ECFDF5;
    color: #005F54;
}

.module-icon.past-due {
    background: #FEF2F2;
    color: #A03E21;
}

.module-icon.pending {
    background: #F3F4F6;
    color: #9CA3AF;
}

.module-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

.module-status {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.module-status.completed {
    color: #005F54;
}

.module-status.past-due {
    color: #A03E21;
}

.module-status.pending {
    color: #4B5563;
}

.module-desc {
    color: #6B7280;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 2rem 0;
    flex-grow: 1;
}

.btn-module {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-module.review {
    background: #F9FAFB;
    color: #6B7280;
    border: 1px solid #E5E7EB;
}

.btn-module.review:hover {
    background: #F3F4F6;
    color: #4B5563;
}

.btn-module.access {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-module.access:hover {
    background: var(--primary-blue-hover);
}

/* Reference & Resources Section */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.resource-card-dark {
    background: #0F172A;
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    color: var(--white);
    border: 1px solid #1E293B;
}

.resource-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.badge-critical {
    background: #451A1E;
    color: #F87171;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid #7F1D1D;
}

.icon-critical {
    width: 32px;
    height: 32px;
    background: #451A1E;
    color: #F87171;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border: 1px solid #7F1D1D;
}

.resource-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
}

.resource-subtitle {
    font-size: 0.75rem;
    font-weight: 800;
    color: #A03E21;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.resource-desc {
    color: #94A3B8;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0 0 2rem 0;
    flex-grow: 1;
}

.btn-critical {
    background: #A03E21;
    color: var(--white);
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-critical:hover {
    background: #A03E21;
}

/* Section Divider */
.portal-divider {
    height: 1px;
    background-color: #F1F5F9;
    margin: 4rem 0;
    width: 100%;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 1024px) {
    .portal-content {
        padding: 1.5rem;
    }

    .portal-header-section {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2rem;
        margin-bottom: 1rem !important; /* Collapse the huge desktop gap above Mandatory Training */
    }

    .portal-greeting {
        font-size: 1.75rem;
    }

    .portal-meta-badges {
        flex-wrap: wrap !important;
        gap: 0.5rem;
    }

    .badge-portal,
    .badge-date {
        font-size: 0.65rem;
    }

    .portal-quick-actions {
        flex-direction: column !important;
        width: 100%;
        margin-top: 1rem;
    }

    .btn-portal-action {
        width: 100%;
        justify-content: center;
    }

    .progress-widget {
        width: 100% !important;
        min-width: 0 !important;
        margin-bottom: 2rem !important;
    }

    .module-grid,
    .resource-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .portal-divider {
        margin: 2rem 0 !important; /* Cut the 4rem desktop divider whitespace in half for mobile */
    }
}