/* Team page and invite UI (extracted from main.css) */

/* --- Team Page --- */

.team-page {
    padding: 32px;
    max-width: 1280px;
}

.team-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

.team-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.team-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 4px;
}

.team-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.team-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.team-stat strong {
    color: var(--text-primary);
}

.team-stat.online {
    display: flex;
    align-items: center;
    gap: 5px;
}

.team-stat-sep {
    color: var(--text-muted);
    font-size: 14px;
}

/* --- Team Table --- */

.team-table {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.team-table-header {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.team-th {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.team-th.member { width: 260px; flex-shrink: 0; }
.team-th.role   { width: 100px; flex-shrink: 0; }
.team-th.status { width: 110px; flex-shrink: 0; }
.team-th.projects { width: 80px; flex-shrink: 0; }
.team-th.active { flex: 1; }

.team-row {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.team-row:last-child {
    border-bottom: none;
}

.team-row:hover {
    background: var(--bg-hover);
}

.team-td.member { width: 260px; flex-shrink: 0; display: flex; align-items: center; gap: 12px; }
.team-td.role   { width: 100px; flex-shrink: 0; }
.team-td.status { width: 110px; flex-shrink: 0; }
.team-td.projects { width: 80px; flex-shrink: 0; color: var(--text-secondary); font-size: 14px; }
.team-td.active { flex: 1; color: var(--text-muted); font-size: 14px; }

.team-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.team-member-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

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

.team-member-email {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Role Badges --- */

.role-badge-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

.role-badge-tag.owner  { background: rgba(59,130,246,0.15); color: #60a5fa; }
.role-badge-tag.admin  { background: rgba(139,92,246,0.15); color: #a78bfa; }
.role-badge-tag.member { background: rgba(34,197,94,0.12);  color: #4ade80; }
.role-badge-tag.viewer { background: rgba(161,161,170,0.12); color: var(--text-secondary); }

/* --- Team Status --- */

.team-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.team-status.online  { color: var(--success); }
.team-status.away    { color: var(--warning); }
.team-status.pending { color: var(--text-muted); font-style: italic; }


.invite-modal-card {
    width: 560px;
    min-height: 338px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.invite-modal-body {
    flex: 1;
    min-height: 208px;
    padding: 24px 28px 28px;
}

/* --- Invite Tabs --- */
.invite-tabs {
    display: flex;
    padding: 0 24px;
    gap: 0;
    border-bottom: 1px solid var(--border);
}
.invite-tab {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.invite-tab:hover { color: var(--text-primary); }
.invite-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.invite-description {
    max-width: 470px;
    margin: 0 0 24px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.55;
}

.invite-section {
    display: grid;
    gap: 10px;
}

.invite-control-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.invite-input {
    height: 44px;
    min-width: 0;
}

.invite-button {
    height: 44px;
    min-width: 96px;
    justify-content: center;
    padding: 0 18px;
}

.invite-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.invite-empty {
    display: grid;
    justify-items: start;
}

.invite-danger-quiet:hover:not(:disabled) {
    border-color: rgba(220, 38, 38, 0.3);
    background: rgba(220, 38, 38, 0.06);
    color: var(--danger);
}

.invite-loading {
    color: var(--text-secondary);
    font-size: 14px;
}

.invite-message {
    min-height: 20px;
    margin-top: 9px;
    font-size: 14px;
    font-weight: 600;
}

.invite-message.success {
    color: var(--success);
}

.invite-message.error {
    color: var(--danger);
}

@media (max-width: 520px) {
    .invite-modal-card {
        min-height: 378px;
    }

    .invite-control-row {
        grid-template-columns: 1fr;
    }

    .invite-button {
        width: fit-content;
    }
}


/* --- Invite Role Select --- */

.invite-role-select {
    position: relative;
}

.invite-role-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
}

.invite-role-trigger:hover {
    border-color: var(--text-muted);
}

.dropup-arrow {
    color: var(--text-muted);
    font-size: 14px;
}

.invite-role-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* --- Invite Feedback --- */

.invite-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.invite-feedback.success {
    background: rgba(34,197,94,0.1);
    color: #4ade80;
}

.invite-feedback.error {
    background: rgba(239,68,68,0.1);
    color: #f87171;
}

