/* ================================================================
   Follow-ups Calendar & List — Scoped styles (.fu-*)
   ================================================================ */

/* ---- Calendar ---- */
.fu-calendar {
    width: 100%;
    user-select: none;
}

.fu-cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.fu-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.fu-cal-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 56px;
    padding: 6px 2px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    font-size: 14px;
    color: var(--text-primary);
}

.fu-cal-day:hover {
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
}

.fu-cal-day.other-month {
    color: var(--text-muted);
    opacity: 0.45;
}

.fu-cal-day.today .fu-cal-day-num {
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.fu-cal-day.selected {
    background: color-mix(in srgb, var(--primary-color) 18%, transparent);
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

.fu-cal-day-num {
    font-weight: 500;
    line-height: 1;
    margin-bottom: 4px;
}

.fu-cal-dots {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    justify-content: center;
}

.fu-dot-fta {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
}

.fu-dot-followup {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success-color);
}

.fu-dot-callback {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #E8A838;
}

.fu-dot-overdue {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--danger-color);
}

/* ---- Calendar Legend ---- */
.fu-cal-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
}

.fu-cal-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ---- Tabs ---- */
.fu-tabs {
    display: flex;
    gap: 4px;
    background: color-mix(in srgb, var(--border-color) 40%, transparent);
    border-radius: 6px;
    padding: 3px;
}

.fu-tab {
    padding: 6px 16px;
    border: none;
    background: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.fu-tab:hover {
    color: var(--text-primary);
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
}

.fu-tab.active {
    background: var(--primary-color);
    color: #fff;
}

/* ---- List ---- */
.fu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fu-list-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.fu-list-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
    display: block;
}

.fu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card-inner, color-mix(in srgb, var(--border-color) 20%, transparent));
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: border-color 0.15s;
}

.fu-item:hover {
    border-color: var(--primary-color);
}

.fu-item-type {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.fu-item-type.fta {
    background: color-mix(in srgb, var(--primary-color) 15%, transparent);
    color: var(--primary-color);
}

.fu-item-type.followup {
    background: color-mix(in srgb, var(--success-color) 15%, transparent);
    color: var(--success-color);
}

.fu-item-type.callback {
    background: color-mix(in srgb, #E8A838 15%, transparent);
    color: #C48A20;
}

.fu-item-body {
    flex: 1;
    min-width: 0;
}

.fu-item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fu-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.fu-item-meta i {
    margin-right: 3px;
}

.fu-item-notes {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.fu-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.fu-item-actions .btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.fu-item-overdue .fu-item-meta {
    color: var(--danger-color);
}

/* ---- Date group headers ---- */
.fu-date-group {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 8px 0 4px;
    margin-top: 8px;
}

.fu-date-group:first-child {
    margin-top: 0;
}

/* ---- Day detail panel shown when clicking a calendar day ---- */
.fu-day-detail-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fu-day-detail-clear {
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-color);
    cursor: pointer;
    background: none;
    border: none;
    padding: 2px 6px;
}

.fu-day-detail-clear:hover {
    text-decoration: underline;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .fu-cal-day {
        min-height: 44px;
        padding: 4px 1px 3px;
        font-size: 12px;
    }

    .fu-cal-day-num {
        font-size: 12px;
    }

    .fu-cal-day.today .fu-cal-day-num {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .fu-dot-fta,
    .fu-dot-followup,
    .fu-dot-callback,
    .fu-dot-overdue {
        width: 5px;
        height: 5px;
    }

    .fu-tabs {
        gap: 2px;
    }

    .fu-tab {
        padding: 5px 10px;
        font-size: 12px;
    }

    .fu-item {
        flex-wrap: wrap;
        padding: 10px 12px;
    }

    .fu-item-body {
        width: 100%;
        order: 1;
    }

    .fu-item-type {
        order: 0;
    }

    .fu-item-actions {
        order: 2;
        width: 100%;
        justify-content: flex-end;
        margin-top: 6px;
        padding-top: 6px;
        border-top: 1px solid var(--border-color);
    }

    .fu-item-notes {
        max-width: 100%;
    }

    .card-header {
        flex-direction: column;
        gap: 10px;
    }
}
