/* --- Invite Button & Contact Picker --- */
.invite-btn {
    /* A font-awesome glyph on a themed surface, so it must follow the theme.
       This file loads after style.css, so it also overrides .icon-btn. */
    color: var(--text-primary);
    transition: all 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 50%;
}

.invite-btn:hover {
    color: var(--accent-color);
    background: rgba(59, 130, 246, 0.1);
}

.chat-header .invite-btn {
    margin-left: auto;
}

.picker-contact-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.picker-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.picker-contact-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

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

.picker-contact-avatar {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--accent-color);
}

.picker-contact-info {
    flex: 1;
}

.picker-contact-name {
    font-weight: 500;
    display: block;
    color: var(--text-primary);
}

.picker-contact-phone {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.modal.hidden {
    display: none !important;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* Modals handled by style.css */

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 1rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    border: 1px solid var(--border-color);
    overflow: hidden;
    animation: modalSlideIn 0.2s ease-out;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* The picker/list modals put a full-bleed list in the body, so no padding.
   Scoped deliberately: this file loads after style.css, so an unscoped
   .modal-body here also stripped the padding from the form modals (report,
   task), leaving their fields flush against the dialog edges. */
#contact-picker-modal .modal-body,
#project-members-modal .modal-body,
#sync-results-modal .modal-body {
    padding: 0;
}

.picker-contact-list .loading {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.picker-contact-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.role-select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.role-select:focus {
    border-color: var(--accent-color);
}

.btn-add {
    padding: 4px 12px !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
    min-width: 60px;
}

.msg-sender {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.msg-text {
    word-break: break-word;
}

@media (max-width: 768px) {
    .picker-contact-list {
        max-height: none;
        flex: 1;
    }
}