/* ==========================================================================
   WONDER APP - VENDOR TEAM
   File: vendor_app/assets/css/team.css
   Purpose: Team, Staff, Roles, Permissions, Invitations & Activity
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TEAM PAGE FOUNDATION
   -------------------------------------------------------------------------- */

.team-page {
    width: 100%;
    min-width: 0;
}

.team-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
}

.team-section {
    width: 100%;
    margin-bottom: 24px;
}

.team-section:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   2. PAGE HEADER
   -------------------------------------------------------------------------- */

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

.team-header-content {
    min-width: 0;
    flex: 1 1 auto;
}

.team-title {
    margin: 0;
    color: var(--text-primary, #111827);
    font-size: 28px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.team-subtitle {
    margin: 7px 0 0;
    max-width: 760px;
    color: var(--text-secondary, #6b7280);
    font-size: 14px;
    line-height: 1.6;
}

.team-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   3. TEAM STATS
   -------------------------------------------------------------------------- */

.team-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.team-stat-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    overflow: hidden;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
    transition:
        transform var(--transition-fast, 160ms ease),
        box-shadow var(--transition-fast, 160ms ease),
        border-color var(--transition-fast, 160ms ease);
}

.team-stat-card:hover {
    transform: translateY(-1px);
    border-color: var(--border-hover, #d1d5db);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));
}

.team-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    color: var(--primary-color, #2563eb);
    background: var(--primary-light, #eff6ff);
    border-radius: 12px;
    font-size: 20px;
}

.team-stat-icon.is-success {
    color: var(--success-color, #16a34a);
    background: var(--success-light, #f0fdf4);
}

.team-stat-icon.is-warning {
    color: var(--warning-color, #d97706);
    background: var(--warning-light, #fffbeb);
}

.team-stat-icon.is-danger {
    color: var(--danger-color, #dc2626);
    background: var(--danger-light, #fef2f2);
}

.team-stat-icon.is-info {
    color: var(--info-color, #0891b2);
    background: var(--info-light, #ecfeff);
}

.team-stat-content {
    min-width: 0;
}

.team-stat-label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-secondary, #6b7280);
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
}

.team-stat-value {
    display: block;
    color: var(--text-primary, #111827);
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
}

.team-stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    font-size: 11px;
    font-weight: 600;
}

.team-stat-change.is-positive {
    color: var(--success-color, #16a34a);
}

.team-stat-change.is-negative {
    color: var(--danger-color, #dc2626);
}

.team-stat-change.is-neutral {
    color: var(--text-muted, #9ca3af);
}

/* --------------------------------------------------------------------------
   4. TEAM TOOLBAR
   -------------------------------------------------------------------------- */

.team-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
}

.team-toolbar-left,
.team-toolbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.team-toolbar-left {
    flex: 1 1 auto;
}

.team-toolbar-right {
    flex: 0 0 auto;
    justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   5. SEARCH
   -------------------------------------------------------------------------- */

.team-search {
    position: relative;
    width: min(100%, 340px);
}

.team-search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 2;
    width: 16px;
    height: 16px;
    color: var(--text-muted, #9ca3af);
    transform: translateY(-50%);
    pointer-events: none;
}

.team-search-input {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px 9px 38px;
    color: var(--text-primary, #111827);
    background: var(--input-bg, #ffffff);
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: var(--radius-md, 8px);
    outline: none;
    transition:
        border-color var(--transition-fast, 160ms ease),
        box-shadow var(--transition-fast, 160ms ease);
}

.team-search-input::placeholder {
    color: var(--text-muted, #9ca3af);
}

.team-search-input:focus {
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 0 0 3px var(--primary-ring, rgba(37, 99, 235, 0.12));
}

/* --------------------------------------------------------------------------
   6. FILTERS
   -------------------------------------------------------------------------- */

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

.team-filter {
    min-width: 150px;
}

.team-filter select,
.team-filter .form-control {
    width: 100%;
    min-height: 40px;
}

.team-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 12px;
    color: var(--text-secondary, #4b5563);
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
}

.team-filter-toggle:hover {
    color: var(--text-primary, #111827);
    background: var(--hover-bg, #f9fafb);
}

.team-filter-toggle.is-active {
    color: var(--primary-color, #2563eb);
    background: var(--primary-light, #eff6ff);
    border-color: var(--primary-color, #2563eb);
}

/* --------------------------------------------------------------------------
   7. STATUS TABS
   -------------------------------------------------------------------------- */

.team-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px;
    overflow-x: auto;
    background: var(--surface-muted, #f3f4f6);
    border-radius: var(--radius-md, 8px);
    scrollbar-width: thin;
}

.team-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 7px 14px;
    flex: 0 0 auto;
    color: var(--text-secondary, #6b7280);
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition:
        color var(--transition-fast, 160ms ease),
        background var(--transition-fast, 160ms ease);
}

.team-tab:hover {
    color: var(--text-primary, #111827);
}

.team-tab.is-active {
    color: var(--primary-color, #2563eb);
    background: var(--card-bg, #ffffff);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
}

.team-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    color: var(--text-muted, #6b7280);
    background: var(--surface-muted, #f3f4f6);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.team-tab.is-active .team-tab-count {
    color: var(--primary-color, #2563eb);
    background: var(--primary-light, #eff6ff);
}

/* --------------------------------------------------------------------------
   8. STAFF LIST / TABLE
   -------------------------------------------------------------------------- */

.team-list-card {
    overflow: hidden;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.04));
}

.team-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.team-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.team-table th {
    padding: 13px 16px;
    color: var(--text-secondary, #6b7280);
    background: var(--table-header-bg, #f9fafb);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    font-size: 11px;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.team-table td {
    padding: 15px 16px;
    color: var(--text-primary, #111827);
    border-bottom: 1px solid var(--border-color, #f0f0f0);
    font-size: 13px;
    vertical-align: middle;
}

.team-table tbody tr {
    transition: background var(--transition-fast, 160ms ease);
}

.team-table tbody tr:hover {
    background: var(--hover-bg, #fafafa);
}

.team-table tbody tr:last-child td {
    border-bottom: 0;
}

.team-table th:first-child,
.team-table td:first-child {
    padding-left: 20px;
}

.team-table th:last-child,
.team-table td:last-child {
    padding-right: 20px;
}

/* --------------------------------------------------------------------------
   9. STAFF MEMBER
   -------------------------------------------------------------------------- */

.team-member {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 220px;
}

.team-member-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    overflow: hidden;
    color: var(--primary-color, #2563eb);
    background: var(--primary-light, #eff6ff);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
}

.team-member-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-member-avatar.is-sm {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 11px;
}

.team-member-avatar.is-lg {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
    font-size: 18px;
}

.team-member-avatar.is-xl {
    width: 92px;
    height: 92px;
    flex-basis: 92px;
    font-size: 24px;
}

.team-member-info {
    min-width: 0;
}

.team-member-name {
    display: block;
    max-width: 280px;
    overflow: hidden;
    color: var(--text-primary, #111827);
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-member-email,
.team-member-meta {
    display: block;
    max-width: 280px;
    margin-top: 3px;
    overflow: hidden;
    color: var(--text-secondary, #6b7280);
    font-size: 12px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-member-role {
    margin-top: 4px;
    color: var(--text-muted, #9ca3af);
    font-size: 11px;
}

/* --------------------------------------------------------------------------
   10. ONLINE INDICATOR
   -------------------------------------------------------------------------- */

.team-member-status {
    position: absolute;
    right: 0;
    bottom: 1px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--card-bg, #ffffff);
    border-radius: 50%;
}

.team-member-status.is-online {
    background: var(--success-color, #16a34a);
}

.team-member-status.is-away {
    background: var(--warning-color, #d97706);
}

.team-member-status.is-offline {
    background: var(--text-muted, #9ca3af);
}

.team-member-status.is-busy {
    background: var(--danger-color, #dc2626);
}

/* --------------------------------------------------------------------------
   11. ROLE BADGES
   -------------------------------------------------------------------------- */

.team-role {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 25px;
    padding: 4px 8px;
    color: var(--text-secondary, #4b5563);
    background: var(--surface-muted, #f3f4f6);
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
}

.team-role.is-owner {
    color: #7c3aed;
    background: #f5f3ff;
}

.team-role.is-admin {
    color: var(--primary-color, #2563eb);
    background: var(--primary-light, #eff6ff);
}

.team-role.is-manager {
    color: #0369a1;
    background: #f0f9ff;
}

.team-role.is-staff {
    color: #047857;
    background: #ecfdf5;
}

.team-role.is-custom {
    color: #92400e;
    background: #fffbeb;
}

/* --------------------------------------------------------------------------
   12. STATUS BADGES
   -------------------------------------------------------------------------- */

.team-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
}

.team-status::before {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    content: "";
    background: currentColor;
    border-radius: 50%;
}

.team-status.is-active {
    color: var(--success-color, #16a34a);
    background: var(--success-light, #f0fdf4);
}

.team-status.is-pending {
    color: var(--warning-color, #d97706);
    background: var(--warning-light, #fffbeb);
}

.team-status.is-inactive {
    color: var(--text-muted, #6b7280);
    background: var(--surface-muted, #f3f4f6);
}

.team-status.is-suspended {
    color: var(--danger-color, #dc2626);
    background: var(--danger-light, #fef2f2);
}

.team-status.is-expired {
    color: #b45309;
    background: #fff7ed;
}

/* --------------------------------------------------------------------------
   13. TEAM ACTIONS
   -------------------------------------------------------------------------- */

.team-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.team-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--text-secondary, #6b7280);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    transition:
        color var(--transition-fast, 160ms ease),
        background var(--transition-fast, 160ms ease),
        border-color var(--transition-fast, 160ms ease);
}

.team-action-btn:hover {
    color: var(--text-primary, #111827);
    background: var(--hover-bg, #f3f4f6);
    border-color: var(--border-color, #e5e7eb);
}

.team-action-btn.is-primary:hover {
    color: var(--primary-color, #2563eb);
    background: var(--primary-light, #eff6ff);
    border-color: transparent;
}

.team-action-btn.is-danger:hover {
    color: var(--danger-color, #dc2626);
    background: var(--danger-light, #fef2f2);
    border-color: transparent;
}

.team-action-menu {
    position: relative;
}

.team-action-dropdown {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 30;
    min-width: 180px;
    padding: 6px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 9px;
    box-shadow: var(--shadow-lg, 0 10px 30px rgba(0, 0, 0, 0.12));
}

.team-action-dropdown.is-left {
    right: auto;
    left: 0;
}

.team-action-dropdown[hidden] {
    display: none;
}

.team-action-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    color: var(--text-secondary, #4b5563);
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

.team-action-item:hover {
    color: var(--text-primary, #111827);
    background: var(--hover-bg, #f3f4f6);
}

.team-action-item.is-danger {
    color: var(--danger-color, #dc2626);
}

/* --------------------------------------------------------------------------
   14. STAFF DETAIL
   -------------------------------------------------------------------------- */

.team-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

.team-detail-main {
    min-width: 0;
}

.team-detail-sidebar {
    min-width: 0;
}

.team-detail-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
    margin-bottom: 20px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
}

.team-detail-avatar {
    flex: 0 0 auto;
}

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

.team-detail-name {
    margin: 0;
    color: var(--text-primary, #111827);
    font-size: 22px;
    line-height: 1.3;
    font-weight: 700;
}

.team-detail-email {
    margin-top: 5px;
    color: var(--text-secondary, #6b7280);
    font-size: 13px;
}

.team-detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 14px;
    margin-top: 9px;
    color: var(--text-muted, #9ca3af);
    font-size: 12px;
}

.team-detail-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

/* --------------------------------------------------------------------------
   15. DETAIL SECTIONS
   -------------------------------------------------------------------------- */

.team-detail-section {
    padding: 20px;
    margin-bottom: 18px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
}

.team-detail-section:last-child {
    margin-bottom: 0;
}

.team-detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.team-detail-section-title {
    margin: 0;
    color: var(--text-primary, #111827);
    font-size: 16px;
    line-height: 1.4;
    font-weight: 700;
}

.team-detail-section-subtitle {
    margin: 4px 0 0;
    color: var(--text-secondary, #6b7280);
    font-size: 12px;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   16. INFORMATION GRID
   -------------------------------------------------------------------------- */

.team-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
}

.team-info-item {
    min-width: 0;
}

.team-info-label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted, #9ca3af);
    font-size: 11px;
    line-height: 1.4;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.team-info-value {
    color: var(--text-primary, #111827);
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
    word-break: break-word;
}

/* --------------------------------------------------------------------------
   17. FORM
   -------------------------------------------------------------------------- */

.team-form {
    width: 100%;
}

.team-form-section {
    padding: 22px;
    margin-bottom: 18px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
}

.team-form-section:last-child {
    margin-bottom: 0;
}

.team-form-section-header {
    margin-bottom: 20px;
}

.team-form-section-title {
    margin: 0;
    color: var(--text-primary, #111827);
    font-size: 16px;
    line-height: 1.4;
    font-weight: 700;
}

.team-form-section-description {
    margin: 5px 0 0;
    color: var(--text-secondary, #6b7280);
    font-size: 12px;
    line-height: 1.55;
}

.team-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.team-form-grid.is-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-form-group {
    min-width: 0;
}

.team-form-group.is-full {
    grid-column: 1 / -1;
}

.team-form-label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 7px;
    color: var(--text-primary, #374151);
    font-size: 12px;
    line-height: 1.4;
    font-weight: 600;
}

.team-form-required {
    color: var(--danger-color, #dc2626);
}

.team-form-help {
    margin-top: 6px;
    color: var(--text-muted, #9ca3af);
    font-size: 11px;
    line-height: 1.5;
}

.team-form-error {
    margin-top: 6px;
    color: var(--danger-color, #dc2626);
    font-size: 11px;
    line-height: 1.4;
}

.team-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 6px;
}

/* --------------------------------------------------------------------------
   18. AVATAR UPLOAD
   -------------------------------------------------------------------------- */

.team-avatar-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}

.team-avatar-upload-preview {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 82px;
    height: 82px;
    overflow: hidden;
    color: var(--primary-color, #2563eb);
    background: var(--primary-light, #eff6ff);
    border: 1px solid var(--border-color, #dbeafe);
    border-radius: 50%;
}

.team-avatar-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-avatar-upload-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

/* --------------------------------------------------------------------------
   19. INVITATIONS
   -------------------------------------------------------------------------- */

.team-invitation-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
}

.team-invitation-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.team-invitation-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    color: var(--primary-color, #2563eb);
    background: var(--primary-light, #eff6ff);
    border-radius: 9px;
}

.team-invitation-info {
    min-width: 0;
}

.team-invitation-email {
    color: var(--text-primary, #111827);
    font-size: 13px;
    font-weight: 700;
    word-break: break-word;
}

.team-invitation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 4px;
    color: var(--text-muted, #9ca3af);
    font-size: 11px;
}

.team-invitation-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 7px;
}

/* --------------------------------------------------------------------------
   20. ROLES
   -------------------------------------------------------------------------- */

.team-roles-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.team-role-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 18px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    transition:
        transform var(--transition-fast, 160ms ease),
        box-shadow var(--transition-fast, 160ms ease),
        border-color var(--transition-fast, 160ms ease);
}

.team-role-card:hover {
    transform: translateY(-1px);
    border-color: var(--border-hover, #d1d5db);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));
}

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

.team-role-card-title {
    margin: 0;
    color: var(--text-primary, #111827);
    font-size: 15px;
    font-weight: 700;
}

.team-role-card-description {
    margin: 6px 0 0;
    color: var(--text-secondary, #6b7280);
    font-size: 12px;
    line-height: 1.55;
}

.team-role-card-body {
    flex: 1 1 auto;
    margin-top: 16px;
}

.team-role-card-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted, #9ca3af);
    font-size: 11px;
}

.team-role-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color, #f0f0f0);
}

/* --------------------------------------------------------------------------
   21. PERMISSIONS
   -------------------------------------------------------------------------- */

.team-permissions {
    width: 100%;
}

.team-permission-group {
    margin-bottom: 18px;
    overflow: hidden;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
}

.team-permission-group:last-child {
    margin-bottom: 0;
}

.team-permission-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    background: var(--surface-muted, #f9fafb);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.team-permission-group-title {
    margin: 0;
    color: var(--text-primary, #111827);
    font-size: 13px;
    font-weight: 700;
}

.team-permission-list {
    display: flex;
    flex-direction: column;
}

.team-permission-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) repeat(4, 90px);
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
}

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

.team-permission-name {
    min-width: 0;
}

.team-permission-title {
    display: block;
    color: var(--text-primary, #374151);
    font-size: 12px;
    font-weight: 600;
}

.team-permission-description {
    display: block;
    margin-top: 2px;
    color: var(--text-muted, #9ca3af);
    font-size: 10px;
    line-height: 1.4;
}

.team-permission-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-permission-heading {
    color: var(--text-muted, #6b7280);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   22. PERMISSION CHECKBOX
   -------------------------------------------------------------------------- */

.team-permission-check {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.team-permission-check input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.team-permission-check-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: transparent;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 5px;
    cursor: pointer;
    transition:
        color var(--transition-fast, 160ms ease),
        background var(--transition-fast, 160ms ease),
        border-color var(--transition-fast, 160ms ease);
}

.team-permission-check input:checked + .team-permission-check-box {
    color: #ffffff;
    background: var(--primary-color, #2563eb);
    border-color: var(--primary-color, #2563eb);
}

.team-permission-check input:focus-visible + .team-permission-check-box {
    outline: 3px solid var(--primary-ring, rgba(37, 99, 235, 0.15));
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   23. TEAM ACTIVITY
   -------------------------------------------------------------------------- */

.team-activity {
    position: relative;
    display: flex;
    flex-direction: column;
}

.team-activity-item {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 22px;
}

.team-activity-item:last-child {
    padding-bottom: 0;
}

.team-activity-item:not(:last-child)::before {
    position: absolute;
    top: 38px;
    left: 18px;
    bottom: 0;
    width: 1px;
    content: "";
    background: var(--border-color, #e5e7eb);
}

.team-activity-icon {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--primary-color, #2563eb);
    background: var(--primary-light, #eff6ff);
    border: 2px solid var(--card-bg, #ffffff);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--border-color, #e5e7eb);
    font-size: 13px;
}

.team-activity-icon.is-success {
    color: var(--success-color, #16a34a);
    background: var(--success-light, #f0fdf4);
}

.team-activity-icon.is-warning {
    color: var(--warning-color, #d97706);
    background: var(--warning-light, #fffbeb);
}

.team-activity-icon.is-danger {
    color: var(--danger-color, #dc2626);
    background: var(--danger-light, #fef2f2);
}

.team-activity-content {
    min-width: 0;
    padding-top: 1px;
}

.team-activity-title {
    color: var(--text-primary, #374151);
    font-size: 12px;
    line-height: 1.5;
    font-weight: 600;
}

.team-activity-description {
    margin-top: 3px;
    color: var(--text-secondary, #6b7280);
    font-size: 12px;
    line-height: 1.55;
}

.team-activity-time {
    display: block;
    margin-top: 5px;
    color: var(--text-muted, #9ca3af);
    font-size: 10px;
}

/* --------------------------------------------------------------------------
   24. ACCESS SUMMARY
   -------------------------------------------------------------------------- */

.team-access-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.team-access-card {
    padding: 14px;
    background: var(--surface-muted, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 9px;
}

.team-access-card-label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted, #9ca3af);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.team-access-card-value {
    color: var(--text-primary, #111827);
    font-size: 15px;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   25. BULK ACTION BAR
   -------------------------------------------------------------------------- */

.team-bulkbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 14px;
    margin-bottom: 12px;
    color: var(--text-primary, #111827);
    background: var(--primary-light, #eff6ff);
    border: 1px solid var(--primary-border, #bfdbfe);
    border-radius: 9px;
}

.team-bulkbar.is-visible {
    display: flex;
}

.team-bulkbar-left,
.team-bulkbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.team-selected-count {
    color: var(--primary-color, #2563eb);
    font-size: 12px;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   26. CHECKBOXES
   -------------------------------------------------------------------------- */

.team-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.team-checkbox input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary-color, #2563eb);
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   27. SIDEBAR CARDS
   -------------------------------------------------------------------------- */

.team-sidebar-card {
    padding: 18px;
    margin-bottom: 16px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
}

.team-sidebar-card:last-child {
    margin-bottom: 0;
}

.team-sidebar-card-title {
    margin: 0 0 14px;
    color: var(--text-primary, #111827);
    font-size: 14px;
    font-weight: 700;
}

.team-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.team-sidebar-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-secondary, #6b7280);
    font-size: 12px;
}

.team-sidebar-list-item strong {
    color: var(--text-primary, #111827);
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   28. EMPTY STATE
   -------------------------------------------------------------------------- */

.team-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 40px 24px;
    text-align: center;
}

.team-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    color: var(--text-muted, #9ca3af);
    background: var(--surface-muted, #f3f4f6);
    border-radius: 50%;
    font-size: 22px;
}

.team-empty-title {
    margin: 0;
    color: var(--text-primary, #111827);
    font-size: 16px;
    font-weight: 700;
}

.team-empty-text {
    max-width: 460px;
    margin: 7px auto 0;
    color: var(--text-secondary, #6b7280);
    font-size: 12px;
    line-height: 1.6;
}

.team-empty-action {
    margin-top: 17px;
}

/* --------------------------------------------------------------------------
   29. ERROR STATE
   -------------------------------------------------------------------------- */

.team-error {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    color: var(--danger-color, #dc2626);
    background: var(--danger-light, #fef2f2);
    border: 1px solid var(--danger-border, #fecaca);
    border-radius: 10px;
}

.team-error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    background: rgba(220, 38, 38, 0.08);
    border-radius: 50%;
}

.team-error-content {
    min-width: 0;
}

.team-error-title {
    color: var(--danger-color, #dc2626);
    font-size: 13px;
    font-weight: 700;
}

.team-error-message {
    margin-top: 3px;
    color: var(--text-secondary, #6b7280);
    font-size: 11px;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   30. LOADING / SKELETON
   -------------------------------------------------------------------------- */

.team-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 30px;
}

.team-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-color, #e5e7eb);
    border-top-color: var(--primary-color, #2563eb);
    border-radius: 50%;
    animation: team-spin 0.75s linear infinite;
}

@keyframes team-spin {
    to {
        transform: rotate(360deg);
    }
}

.team-skeleton {
    position: relative;
    overflow: hidden;
    background: var(--surface-muted, #f3f4f6);
    border-radius: 6px;
}

.team-skeleton::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.55),
        transparent
    );
    transform: translateX(-100%);
    animation: team-skeleton-loading 1.4s infinite;
}

@keyframes team-skeleton-loading {
    100% {
        transform: translateX(100%);
    }
}

.team-skeleton-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
}

.team-skeleton-line {
    width: 100%;
    height: 10px;
}

.team-skeleton-line.is-short {
    width: 55%;
}

.team-skeleton-line.is-medium {
    width: 72%;
}

.team-skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
}

/* --------------------------------------------------------------------------
   31. PAGINATION
   -------------------------------------------------------------------------- */

.team-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.team-pagination-info {
    color: var(--text-secondary, #6b7280);
    font-size: 11px;
}

.team-pagination-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.team-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    color: var(--text-secondary, #6b7280);
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.team-pagination-btn:hover {
    color: var(--primary-color, #2563eb);
    background: var(--primary-light, #eff6ff);
    border-color: var(--primary-border, #bfdbfe);
}

.team-pagination-btn.is-active {
    color: #ffffff;
    background: var(--primary-color, #2563eb);
    border-color: var(--primary-color, #2563eb);
}

.team-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   32. MODAL HELPERS
   -------------------------------------------------------------------------- */

.team-modal-section {
    margin-bottom: 18px;
}

.team-modal-section:last-child {
    margin-bottom: 0;
}

.team-modal-title {
    margin: 0;
    color: var(--text-primary, #111827);
    font-size: 18px;
    font-weight: 700;
}

.team-modal-description {
    margin-top: 5px;
    color: var(--text-secondary, #6b7280);
    font-size: 12px;
    line-height: 1.55;
}

/* --------------------------------------------------------------------------
   33. DANGER ZONE
   -------------------------------------------------------------------------- */

.team-danger-zone {
    padding: 18px;
    background: var(--danger-light, #fef2f2);
    border: 1px solid var(--danger-border, #fecaca);
    border-radius: 10px;
}

.team-danger-zone-title {
    margin: 0;
    color: var(--danger-color, #dc2626);
    font-size: 14px;
    font-weight: 700;
}

.team-danger-zone-text {
    margin: 5px 0 14px;
    color: var(--text-secondary, #6b7280);
    font-size: 12px;
    line-height: 1.55;
}

/* --------------------------------------------------------------------------
   34. DARK MODE
   -------------------------------------------------------------------------- */

[data-theme="dark"] .team-stat-card,
[data-theme="dark"] .team-toolbar,
[data-theme="dark"] .team-list-card,
[data-theme="dark"] .team-detail-header,
[data-theme="dark"] .team-detail-section,
[data-theme="dark"] .team-form-section,
[data-theme="dark"] .team-sidebar-card,
[data-theme="dark"] .team-role-card,
[data-theme="dark"] .team-permission-group,
[data-theme="dark"] .team-invitation-card {
    background: var(--card-bg, #111827);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .team-table th {
    background: var(--table-header-bg, #1f2937);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .team-table td {
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .team-table tbody tr:hover {
    background: var(--hover-bg, #1f2937);
}

[data-theme="dark"] .team-tab.is-active {
    background: var(--card-bg, #111827);
}

[data-theme="dark"] .team-action-dropdown {
    background: var(--card-bg, #111827);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .team-permission-group-header {
    background: var(--surface-muted, #1f2937);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .team-permission-row {
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .team-pagination-btn {
    background: var(--card-bg, #111827);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .team-search-input {
    color: var(--text-primary, #f9fafb);
    background: var(--input-bg, #111827);
    border-color: var(--border-color, #374151);
}

/* --------------------------------------------------------------------------
   35. ACCESSIBILITY
   -------------------------------------------------------------------------- */

.team-action-btn:focus-visible,
.team-action-item:focus-visible,
.team-tab:focus-visible,
.team-filter-toggle:focus-visible,
.team-pagination-btn:focus-visible,
.team-search-input:focus-visible {
    outline: 3px solid var(--primary-ring, rgba(37, 99, 235, 0.2));
    outline-offset: 2px;
}

.team-action-btn:disabled,
.team-action-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   36. RESPONSIVE - LARGE TABLETS
   -------------------------------------------------------------------------- */

@media (max-width: 1200px) {
    .team-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .team-detail {
        grid-template-columns: minmax(0, 1fr) 280px;
    }

    .team-roles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .team-form-grid.is-three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --------------------------------------------------------------------------
   37. RESPONSIVE - TABLET
   -------------------------------------------------------------------------- */

@media (max-width: 992px) {
    .team-container {
        padding: 20px;
    }

    .team-header {
        align-items: stretch;
        flex-direction: column;
    }

    .team-header-actions {
        justify-content: flex-start;
    }

    .team-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .team-toolbar-left,
    .team-toolbar-right {
        width: 100%;
    }

    .team-toolbar-right {
        justify-content: flex-start;
    }

    .team-search {
        width: 100%;
        max-width: 100%;
    }

    .team-detail {
        grid-template-columns: 1fr;
    }

    .team-detail-sidebar {
        order: 2;
    }

    .team-permission-row {
        grid-template-columns: minmax(160px, 1fr) repeat(4, 70px);
    }

    .team-access-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --------------------------------------------------------------------------
   38. RESPONSIVE - MOBILE
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .team-container {
        padding: 16px;
    }

    .team-title {
        font-size: 23px;
    }

    .team-subtitle {
        font-size: 13px;
    }

    .team-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .team-stat-card {
        padding: 15px;
    }

    .team-stat-value {
        font-size: 21px;
    }

    .team-tabs {
        margin-left: -2px;
        margin-right: -2px;
    }

    .team-header-actions {
        width: 100%;
    }

    .team-header-actions > * {
        flex: 1 1 auto;
    }

    .team-form-grid,
    .team-form-grid.is-three {
        grid-template-columns: 1fr;
    }

    .team-form-group.is-full {
        grid-column: auto;
    }

    .team-detail-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }

    .team-detail-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .team-info-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .team-roles-grid {
        grid-template-columns: 1fr;
    }

    .team-access-summary {
        grid-template-columns: 1fr;
    }

    .team-invitation-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .team-invitation-actions {
        width: 100%;
    }

    .team-invitation-actions > * {
        flex: 1 1 auto;
    }

    .team-pagination {
        align-items: flex-start;
        flex-direction: column;
    }

    .team-pagination-controls {
        width: 100%;
        overflow-x: auto;
    }

    .team-bulkbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .team-bulkbar-left,
    .team-bulkbar-right {
        width: 100%;
    }

    .team-sidebar-card {
        padding: 15px;
    }
}

/* --------------------------------------------------------------------------
   39. RESPONSIVE - SMALL MOBILE
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
    .team-container {
        padding: 12px;
    }

    .team-section,
    .team-form-section,
    .team-detail-section {
        margin-bottom: 14px;
    }

    .team-title {
        font-size: 21px;
    }

    .team-header-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .team-toolbar-left,
    .team-toolbar-right,
    .team-filters {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .team-filter {
        width: 100%;
        min-width: 0;
    }

    .team-detail-header {
        gap: 13px;
    }

    .team-detail-name {
        font-size: 19px;
    }

    .team-detail-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .team-detail-actions > * {
        width: 100%;
    }

    .team-form-section,
    .team-detail-section {
        padding: 15px;
    }

    .team-avatar-upload {
        align-items: flex-start;
        flex-direction: column;
    }

    .team-form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .team-form-actions > * {
        width: 100%;
    }

    .team-action-dropdown {
        position: fixed;
        top: auto;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .team-member {
        min-width: 0;
    }

    .team-member-name,
    .team-member-email,
    .team-member-meta {
        max-width: 190px;
    }

    .team-permission-row {
        grid-template-columns: minmax(140px, 1fr) repeat(4, 54px);
        padding-right: 10px;
        padding-left: 10px;
    }

    .team-permission-group {
        overflow-x: auto;
    }

    .team-permission-list {
        min-width: 430px;
    }
}

/* --------------------------------------------------------------------------
   40. REDUCED MOTION
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .team-stat-card,
    .team-role-card,
    .team-action-btn,
    .team-tab,
    .team-search-input {
        transition: none;
    }

    .team-spinner,
    .team-skeleton::after {
        animation: none;
    }
}

/* --------------------------------------------------------------------------
   41. PRINT
   -------------------------------------------------------------------------- */

@media print {
    .team-header-actions,
    .team-toolbar,
    .team-tabs,
    .team-actions,
    .team-pagination,
    .team-bulkbar {
        display: none !important;
    }

    .team-container {
        max-width: none;
        padding: 0;
    }

    .team-stat-card,
    .team-list-card,
    .team-detail-section,
    .team-detail-header,
    .team-form-section,
    .team-role-card {
        box-shadow: none !important;
        break-inside: avoid;
    }

    .team-table {
        min-width: 0;
    }
}