.team-access-workspace {
    padding: clamp(1rem, 2vw, 2rem);
}

.team-access-header {
    align-items: center;
}

.team-kpi-cluster { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; }

.team-member-kpi {
    min-width: 150px;
    padding: .8rem 1rem;
    border: 1px solid rgba(99, 102, 241, .3);
    border-radius: 14px;
    background: rgba(79, 70, 229, .12);
    display: grid;
    gap: .2rem;
}

.team-member-kpi span { color: var(--text-muted); font-size: .78rem; }
.team-member-kpi strong { font-size: 1.65rem; color: #a5b4fc; }
.team-member-kpi.operator { border-color: rgba(45, 212, 191, .26); background: rgba(20, 184, 166, .1); }
.team-member-kpi.operator strong { color: #5eead4; }

.team-access-layout {
    display: grid;
    grid-template-columns: minmax(320px, .8fr) minmax(0, 1.4fr);
    gap: 1rem;
    align-items: start;
}

.team-invite-card,
.team-members-card,
.team-operators-card,
.team-invitations-card {
    padding: 1.15rem;
    min-width: 0;
}

.team-invite-card { grid-row: span 3; }

.team-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.team-card-heading span {
    color: #818cf8;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.team-card-heading h2 { margin: .18rem 0 0; font-size: 1.12rem; }
.team-card-heading p { margin: .3rem 0 0; color: var(--text-muted); font-size: .78rem; font-weight: 500; }
.team-card-heading > i { color: #818cf8; font-size: 1.35rem; }
.team-operators-card .team-card-heading span,
.team-operators-card .team-card-heading > i { color: #5eead4; }

.team-custom-permissions {
    margin: 1rem 0;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 12px;
    overflow: hidden;
}

.team-custom-permissions summary {
    padding: .85rem 1rem;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.team-permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    padding: 1rem;
    max-height: 52vh;
    overflow: auto;
}

.team-permission-group {
    margin: 0;
    padding: .75rem;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 10px;
}

.team-permission-group legend {
    padding: 0 .35rem;
    color: #a5b4fc;
    font-size: .78rem;
    font-weight: 800;
}

.team-permission-option {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin: .45rem 0;
    color: var(--text-color);
    font-size: .82rem;
    line-height: 1.35;
}

.team-permission-option input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
}

.team-permission-option.owner-only { opacity: .55; }

.team-security-note {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin: 1rem 0;
    padding: .8rem;
    color: #a7f3d0;
    background: rgba(16, 185, 129, .09);
    border: 1px solid rgba(16, 185, 129, .2);
    border-radius: 10px;
    font-size: .8rem;
}

.team-table td:first-child { min-width: 190px; }
.team-table td:first-child strong,
.team-table td:first-child small { display: block; }
.team-table td:first-child small { margin-top: .2rem; color: var(--text-muted); }

.team-role-badge,
.team-status {
    display: inline-flex;
    padding: .3rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 800;
    white-space: nowrap;
}

.team-role-badge { color: #c7d2fe; background: rgba(99, 102, 241, .15); }
.team-role-badge.operator { align-items: center; gap: .4rem; color: #99f6e4; background: rgba(20, 184, 166, .12); }
.team-status-active { color: #6ee7b7; background: rgba(16, 185, 129, .13); }
.team-status-disabled { color: #fca5a5; background: rgba(239, 68, 68, .13); }
.team-status-invited { color: #fde68a; background: rgba(245, 158, 11, .13); }
.team-empty { text-align: center; color: var(--text-muted); padding: 1.5rem !important; }

.team-member-modal { z-index: 2400; }
.team-member-modal .modal-content { width: min(94vw, 920px); max-height: 92vh; }
.team-member-modal .modal-body { overflow: auto; }

@media (max-width: 900px) {
    .team-access-layout { grid-template-columns: 1fr; }
    .team-invite-card { grid-row: auto; }
}

@media (max-width: 600px) {
    .team-access-workspace { padding: .75rem; }
    .team-kpi-cluster { width: 100%; justify-content: stretch; }
    .team-member-kpi { flex: 1 1 130px; }
    .team-permission-grid { grid-template-columns: 1fr; padding: .65rem; }
    .team-invite-card,
    .team-members-card,
    .team-operators-card,
    .team-invitations-card { padding: .85rem; }
}
