/**
 * Team of Teams - Additional Styles
 * أنماط إضافية لميزات فريق الفرق
 *
 * @package Smart_Hospital
 */

/* ========================================
   Team of Teams Color Variables
======================================== */
:root {
    --team-rehabilitation: #0077b6;
    --team-nursing: #e63946;
    --team-physical-therapy: #2a9d8f;
    --team-occupational-therapy: #e9c46a;
    --team-speech-therapy: #f4a261;
    --team-nutrition: #8ac926;
    --team-social-work: #9b5de5;
    --team-psychology: #f72585;
    --team-long-term: #7209b7;
    
    --goal-functional: #0077b6;
    --goal-mobility: #2a9d8f;
    --goal-cognitive: #9b5de5;
    --goal-speech: #f4a261;
    --goal-nutrition: #8ac926;
    --goal-discharge: #e63946;
    --goal-safety: #ff6b6b;
}

/* ========================================
   Teams Dashboard Header
======================================== */
.app-header-teams,
.app-header-rehab {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding-bottom: 30px;
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ========================================
   Layout Polish
======================================== */
.app-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    padding: 18px;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.card-subtitle {
    margin: 4px 0 0;
    color: var(--gray);
}

.card-link {
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.card-link:hover {
    text-decoration: underline;
}

.card-empty {
    margin: 0;
    color: var(--gray);
}

/* ========================================
   Shift Banner
======================================== */
.shift-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px !important;
}

.shift-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.shift-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shift-details {
    display: flex;
    flex-direction: column;
}

.shift-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

.shift-name {
    font-size: 1.2rem;
    font-weight: 700;
}

.shift-time {
    text-align: left;
}

.current-time {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    font-family: 'SF Mono', monospace;
}

.current-date {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ========================================
   Stats Grid Extended
======================================== */
.stats-grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 500px) {
    .stats-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 14px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--dark);
}

.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
}

.stat-item .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.stat-teams .stat-icon { background: rgba(0, 119, 182, 0.15); color: var(--primary); }
.stat-handoffs .stat-icon { background: rgba(230, 57, 70, 0.15); color: #e63946; }
.stat-meetings .stat-icon { background: rgba(42, 157, 143, 0.15); color: #2a9d8f; }
.stat-total .stat-icon { background: rgba(155, 93, 229, 0.15); color: #9b5de5; }

/* ========================================
   Teams Grid
======================================== */
.teams-grid {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.team-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--dark);
    transition: var(--transition);
    border-right: 4px solid transparent;
    border: 1px solid var(--border);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.team-card:hover {
    transform: translateX(-4px);
    box-shadow: var(--shadow);
}

/* Team Colors */
.team-rehabilitation { border-right-color: var(--team-rehabilitation); }
.team-nursing { border-right-color: var(--team-nursing); }
.team-physical_therapy { border-right-color: var(--team-physical-therapy); }
.team-occupational_therapy { border-right-color: var(--team-occupational-therapy); }
.team-speech_therapy { border-right-color: var(--team-speech-therapy); }
.team-nutrition { border-right-color: var(--team-nutrition); }
.team-social_work { border-right-color: var(--team-social-work); }
.team-psychology { border-right-color: var(--team-psychology); }
.team-long_term { border-right-color: var(--team-long-term); }

.team-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.team-rehabilitation .team-icon { background: rgba(0, 119, 182, 0.15); color: var(--team-rehabilitation); }
.team-nursing .team-icon { background: rgba(230, 57, 70, 0.15); color: var(--team-nursing); }
.team-physical_therapy .team-icon { background: rgba(42, 157, 143, 0.15); color: var(--team-physical-therapy); }
.team-occupational_therapy .team-icon { background: rgba(233, 196, 106, 0.15); color: #c9a227; }
.team-speech_therapy .team-icon { background: rgba(244, 162, 97, 0.15); color: var(--team-speech-therapy); }
.team-nutrition .team-icon { background: rgba(138, 201, 38, 0.15); color: var(--team-nutrition); }
.team-social_work .team-icon { background: rgba(155, 93, 229, 0.15); color: var(--team-social-work); }
.team-psychology .team-icon { background: rgba(247, 37, 133, 0.15); color: var(--team-psychology); }
.team-long_term .team-icon { background: rgba(114, 9, 183, 0.15); color: var(--team-long-term); }

.team-info {
    flex: 1;
    min-width: 0;
}

.team-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
}

.team-department {
    font-size: 0.85rem;
    color: var(--gray);
}

.team-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--gray);
}

.team-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========================================
   Handoffs List
======================================== */
.handoffs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.handoff-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--light);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--dark);
    border-right: 3px solid var(--gray-light);
}

.handoff-pending { border-right-color: #ffd166; }
.handoff-in_progress { border-right-color: var(--primary); }
.handoff-completed { border-right-color: var(--secondary); }
.handoff-acknowledged { border-right-color: #2a9d8f; }

.handoff-teams {
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-out, .team-in {
    font-weight: 500;
    font-size: 0.95rem;
}

.handoff-arrow {
    color: var(--gray);
}

.handoff-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.handoff-time {
    font-family: 'SF Mono', monospace;
    font-size: 0.9rem;
    color: var(--gray);
}

.handoff-status {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pending { background: #fff3cd; color: #856404; }
.status-in_progress { background: #cce5ff; color: #004085; }
.status-completed { background: #d4edda; color: #155724; }
.status-acknowledged { background: #d1ecf1; color: #0c5460; }

/* ========================================
   Meetings List
======================================== */
.meetings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.meeting-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--light);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--dark);
}

.meeting-date {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.meeting-day {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
}

.meeting-month {
    font-size: 0.7rem;
    text-transform: uppercase;
}

.meeting-info {
    flex: 1;
    min-width: 0;
}

.meeting-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.meeting-details {
    font-size: 0.85rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 4px;
}

.meeting-arrow {
    color: var(--gray-light);
}

/* ========================================
   Quick Actions
======================================== */
.quick-actions {
    margin-top: 20px;
}

.quick-actions .section-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
    padding: 0 4px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    background: var(--white);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--dark);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.action-handoff .action-icon { background: rgba(230, 57, 70, 0.15); color: #e63946; }
.action-goal .action-icon { background: rgba(0, 119, 182, 0.15); color: var(--primary); }
.action-message .action-icon { background: rgba(42, 157, 143, 0.15); color: #2a9d8f; }
.action-meeting .action-icon { background: rgba(155, 93, 229, 0.15); color: #9b5de5; }

.action-text {
    font-weight: 500;
    font-size: 0.9rem;
}

/* ========================================
   Rehab Progress Page
======================================== */
.rehab-content {
    padding-bottom: 40px;
}

.patient-selector {
    text-align: center;
    padding: 30px 20px !important;
}

.select-wrapper {
    margin-top: 16px;
}

.form-select {
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    border: 2px solid var(--light);
    border-radius: var(--radius);
    font-size: 1rem;
    appearance: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat left 12px center;
    background-color: var(--white);
    background-size: 20px;
    padding-left: 40px;
}

.patient-rehab-header {
    text-align: center;
    padding: 24px !important;
}

/* ========================================
   Metrics Grid
======================================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.metric-item {
    background: var(--light);
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
}

.metric-label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 4px;
}

.metric-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
}

.metric-unit {
    font-size: 0.8rem;
    color: var(--gray);
}

.metric-improvement.positive .metric-value { color: var(--secondary); }
.metric-improvement.negative .metric-value { color: var(--danger); }

/* ========================================
   Score Items
======================================== */
.score-item {
    margin-bottom: 20px;
}

.score-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.score-label {
    font-weight: 500;
}

.score-value {
    font-weight: 700;
    color: var(--primary);
}

.score-bar {
    height: 8px;
    background: var(--light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.score-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 4px;
}

/* Pain Scale */
.pain-scale {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.pain-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--light);
}

.pain-dot.active.low { background: #8ac926; }
.pain-dot.active.medium { background: #ffd166; }
.pain-dot.active.high { background: #e63946; }

.pain-score { color: #e63946; }

/* Mobility Display */
.mobility-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--light);
    border-radius: var(--radius);
    margin-top: 16px;
}

.mobility-label {
    font-weight: 500;
}

.mobility-value {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
}

.mobility-value.level-1, .mobility-value.level-2 { background: #ffeaea; color: #c0392b; }
.mobility-value.level-3, .mobility-value.level-4 { background: #fff8e1; color: #f39c12; }
.mobility-value.level-5, .mobility-value.level-6 { background: #e8f5e9; color: #27ae60; }

/* ========================================
   Goals List
======================================== */
.goals-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
}

.goal-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: var(--light);
    border-radius: var(--radius);
}

.goal-type-badge {
    padding: 6px 10px;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.type-functional { background: rgba(0, 119, 182, 0.15); color: var(--goal-functional); }
.type-mobility { background: rgba(42, 157, 143, 0.15); color: var(--goal-mobility); }
.type-cognitive { background: rgba(155, 93, 229, 0.15); color: var(--goal-cognitive); }
.type-speech { background: rgba(244, 162, 97, 0.15); color: var(--goal-speech); }
.type-nutrition { background: rgba(138, 201, 38, 0.15); color: var(--goal-nutrition); }
.type-discharge { background: rgba(230, 57, 70, 0.15); color: var(--goal-discharge); }
.type-safety { background: rgba(255, 107, 107, 0.15); color: var(--goal-safety); }

.goal-content {
    flex: 1;
    min-width: 0;
}

.goal-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.goal-progress-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 8px;
}

.goal-progress-fill {
    height: 100%;
    background: var(--secondary);
    border-radius: var(--radius-full);
}

.goal-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--gray);
}

.goal-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========================================
   Therapy Teams
======================================== */
.therapy-teams {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.therapy-team-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--light);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
}

.therapy-team-badge svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   Progress Timeline
======================================== */
.progress-timeline {
    margin-top: 12px;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--light);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-date {
    width: 50px;
    text-align: center;
}

.date-day {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.date-month {
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
}

.timeline-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.timeline-scores {
    display: flex;
    gap: 8px;
}

.score-pill {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.score-pill.fim { background: rgba(0, 119, 182, 0.15); color: var(--primary); }
.score-pill.adl { background: rgba(42, 157, 143, 0.15); color: #2a9d8f; }

.timeline-link {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
}

/* ========================================
   Discharge Plan
======================================== */
.discharge-plan {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.discharge-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}

.discharge-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--gray-light);
}

.discharge-list li:last-child {
    border-bottom: none;
}

.discharge-label {
    color: var(--gray);
}

.discharge-value {
    font-weight: 600;
}

/* ========================================
   Back Button
======================================== */
.back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    text-decoration: none;
}

.header-title {
    flex: 1;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.btn-add {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ========================================
   Card Date
======================================== */
.card-date {
    font-size: 0.85rem;
    color: var(--gray);
}

/* ========================================
   Responsive Adjustments
======================================== */
@media (max-width: 400px) {
    .shift-banner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .shift-info {
        flex-direction: column;
    }
    
    .shift-time {
        text-align: center;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .handoff-teams {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .handoff-arrow {
        transform: rotate(90deg);
        margin: 0 auto;
    }
    
    .handoff-meta {
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }
}

/* ========================================
   Archive Pages - Teams
======================================== */
.filters-section {
    padding: 0 20px;
    margin-bottom: 16px;
}

.filters-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    padding: 10px 14px;
    border: 1px solid var(--light);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 0.9rem;
    min-width: 140px;
}

.clear-filters {
    color: var(--danger);
    font-size: 0.85rem;
    text-decoration: none;
}

.results-count {
    padding: 0 20px;
    margin-bottom: 12px;
    color: var(--gray);
    font-size: 0.9rem;
}

.teams-archive-grid {
    display: grid;
    gap: 16px;
    padding: 0 20px;
}

.team-archive-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    border-right: 4px solid var(--primary);
}

.team-card-link {
    display: block;
    text-decoration: none;
    color: var(--dark);
}

.team-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 16px 0;
}

.team-icon-lg {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 119, 182, 0.1);
    color: var(--primary);
}

.team-status-badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active { background: #d4edda; color: #155724; }
.status-on_break { background: #fff3cd; color: #856404; }
.status-emergency { background: #f8d7da; color: #721c24; }
.status-handoff { background: #cce5ff; color: #004085; }

.team-card-body {
    padding: 12px 16px;
}

.team-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.team-card-department {
    color: var(--gray);
    font-size: 0.9rem;
}

.team-card-meta {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.team-card-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--gray);
}

.team-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--light);
    border-top: 1px solid rgba(0,0,0,0.05);
}

.team-leader {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-leader img {
    border-radius: 50%;
}

.team-leader span {
    font-size: 0.85rem;
    font-weight: 500;
}

.team-patients-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--gray);
}

.no-leader {
    color: var(--gray);
    font-style: italic;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results svg {
    color: var(--gray-light);
    margin-bottom: 16px;
}

.no-results h3 {
    margin-bottom: 8px;
}

.no-results p {
    color: var(--gray);
    margin-bottom: 20px;
}

/* ========================================
   Single Team Page
======================================== */
.team-detail-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.team-header-card {
    text-align: center;
    padding: 30px 20px !important;
}

.team-icon-xl {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 119, 182, 0.1);
    color: var(--primary);
    margin: 0 auto 16px;
}

.team-icon-xl svg {
    width: 36px;
    height: 36px;
}

.team-name-xl {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.team-department-label {
    color: var(--gray);
}

.team-meta-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
}

.shift-badge {
    background: var(--light);
}

.status-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.status-change-btn {
    padding: 8px 14px;
    border: 1px solid var(--light);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.status-change-btn:hover {
    background: var(--light);
}

.leader-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--light);
    border-radius: var(--radius);
    margin-top: 12px;
}

.leader-avatar img {
    border-radius: 50%;
}

.leader-info {
    flex: 1;
}

.leader-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.leader-role {
    display: block;
    font-size: 0.85rem;
    color: var(--gray);
}

.leader-email {
    display: block;
    font-size: 0.8rem;
    color: var(--primary);
}

.contact-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-count, .patient-count {
    font-size: 0.85rem;
    color: var(--gray);
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--light);
    border-radius: var(--radius);
}

.member-avatar img {
    border-radius: 50%;
}

.member-name {
    font-weight: 500;
    display: block;
}

.member-role {
    font-size: 0.8rem;
    color: var(--gray);
}

.team-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
}

.team-actions .action-btn {
    flex: 1;
}

/* ========================================
   Handoff Pages
======================================== */
.handoff-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.handoff-status-badge {
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.handoff-summary-card {
    text-align: center;
    padding: 30px 20px !important;
}

.handoff-teams-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.team-block {
    text-align: center;
}

.team-block .team-label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 8px;
}

.team-block .team-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
}

.team-block .team-name {
    font-weight: 600;
}

.flow-arrow {
    color: var(--gray);
}

.handoff-time-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--gray);
}

.handoff-datetime {
    font-weight: 500;
    color: var(--dark);
}

.critical-card {
    border-right: 4px solid var(--danger);
}

.critical-card .card-title {
    color: var(--danger);
}

.critical-card .card-title svg {
    color: var(--danger);
}

.critical-content,
.updates-content,
.medication-content {
    line-height: 1.8;
    color: var(--dark);
}

.pending-tasks-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pending-tasks-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--light);
}

.pending-tasks-list li:last-child {
    border-bottom: none;
}

.pending-tasks-list li::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 6px;
    flex-shrink: 0;
}

.acknowledged-card {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.acknowledged-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.acknowledged-label {
    display: block;
    font-size: 0.85rem;
    color: #155724;
}

.acknowledged-user {
    display: block;
    font-weight: 600;
    color: #155724;
}

.acknowledged-time {
    display: block;
    font-size: 0.85rem;
    color: #155724;
    opacity: 0.8;
}

.acknowledge-action-card {
    text-align: center;
    padding: 30px !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.acknowledge-prompt {
    margin-bottom: 16px;
    color: var(--gray);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.meta-card .meta-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}

.meta-card .meta-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--light);
}

.meta-card .meta-list li:last-child {
    border-bottom: none;
}

.meta-label {
    color: var(--gray);
}

.meta-value {
    font-weight: 500;
}

.print-action {
    text-align: center;
    padding: 20px;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* ========================================
   Messages List
======================================== */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.message-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--light);
    border-radius: var(--radius);
}

.message-avatar img {
    border-radius: 50%;
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.message-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.message-time {
    font-size: 0.8rem;
    color: var(--gray);
}

.message-text {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* ========================================
   Dashboard Metrics & Indicators
======================================== */
.card-subtitle {
    color: var(--gray);
    margin-top: 4px;
    font-size: 0.9rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.metric-card {
    padding: 16px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.metric-card.success { border-color: rgba(42, 157, 143, 0.25); }
.metric-card.warning { border-color: rgba(230, 57, 70, 0.25); }
.metric-card.info { border-color: rgba(102, 126, 234, 0.25); }
.metric-card.neutral { border-color: rgba(155, 93, 229, 0.2); }

.metric-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.metric-label {
    font-weight: 600;
    color: var(--dark);
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.metric-progress {
    position: relative;
    background: var(--border);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.metric-progress span {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 999px;
}

.metric-meta {
    color: var(--gray);
    font-size: 0.9rem;
    margin: 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pill-success { background: rgba(42, 157, 143, 0.15); color: #2a9d8f; }
.pill-warning { background: rgba(230, 57, 70, 0.1); color: #e63946; }
.pill-info { background: rgba(102, 126, 234, 0.12); color: var(--primary); }
.pill-neutral { background: rgba(155, 93, 229, 0.12); color: #6c5ce7; }
.pill-pending { background: rgba(230, 57, 70, 0.1); color: #e63946; }
.pill-in_progress { background: rgba(255, 193, 7, 0.15); color: #c28b00; }
.pill-completed { background: rgba(42, 157, 143, 0.15); color: #2a9d8f; }
.pill-open { background: rgba(0, 0, 0, 0.05); color: var(--dark); }

/* ========================================
   Goals Pipeline
======================================== */
.pipeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.pipeline-item {
    padding: 14px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.pipeline-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pipeline-label {
    font-weight: 600;
}

.pipeline-bar {
    position: relative;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    height: 8px;
    overflow: hidden;
}

.pipeline-bar span {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}

.pipeline-bar.risk span {
    background: linear-gradient(90deg, #f77f00, #e63946);
}

.pipeline-meta {
    color: var(--gray);
    font-size: 0.85rem;
    margin-top: 6px;
    display: block;
}

/* ========================================
   Tasks Oversight
======================================== */
.task-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.task-stat {
    padding: 12px;
    border-radius: var(--radius);
    background: var(--light);
    border: 1px solid var(--border);
}

.task-number {
    display: block;
    font-size: 1.6rem;
    margin: 6px 0 2px;
}

.task-list {
    display: grid;
    gap: 10px;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--dark);
    background: #fff;
    transition: var(--transition);
}

.task-item:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.task-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gray);
    font-size: 0.9rem;
}

.task-meta svg { margin-inline-end: 4px; }

/* ========================================
   Member Performance Cards
======================================== */
.member-performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.member-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.member-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-avatar img {
    border-radius: 12px;
}

.member-name {
    margin: 0 0 2px;
    font-size: 1rem;
}

.member-meta {
    margin: 0;
    color: var(--gray);
    font-size: 0.9rem;
}

.member-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.member-stat {
    background: var(--light);
    border-radius: var(--radius);
    padding: 8px 10px;
}

.member-stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
}

.member-stat-value {
    font-weight: 700;
    font-size: 1rem;
}

.member-overdue {
    color: #e63946;
}

.member-progress {
    height: 6px;
    background: var(--light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.member-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* ========================================
   Print Styles
======================================== */
@media print {
    .quick-actions,
    .back-btn,
    .btn-add,
    .status-actions,
    .team-actions,
    .print-action,
    .acknowledge-action-card {
        display: none !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .app-header {
        background: none !important;
        color: var(--dark) !important;
    }
    
    .handoff-teams-flow {
        border: 1px solid #ddd;
        padding: 20px;
        border-radius: var(--radius);
    }
}
