.page-container {
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    color: #333;

    line-height: 1.6;
}

.role-assignment-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    height: 20px;
}

.roles-list {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}

.role-item {
    align-items: flex-start;
    padding: 0.5rem;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.2s ease;
    gap: 0.75rem;
}

.role-item.sm {
    display: flex;
}
.role-item:last-child {
    border-bottom: none;
}

.role-item:hover:not(.disabled) {
    background: #f8fafc;
}

.role-item.selected {
    background: #eff6ff;
    border-left: 3px solid #6366f1;
}

.role-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.role-checkbox {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.role-checkbox input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    cursor: pointer;
    accent-color: #6366f1;
}

.role-content {
    flex: 1;
    min-width: 0;
}

.role-header-simple {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.role-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    line-height: 1.3;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.role-badge.admin {
    background: #fef2f2;
    color: #dc2626;
}

.role-badge.manager {
    background: #fffbeb;
    color: #d97706;
}

.role-badge.user {
    background: #eff6ff;
    color: #2563eb;
}

.role-description {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
}

.tab-navigation .search-section {
    min-width: 220px;
    margin-left: auto;
    padding-right: 1rem;
}
.workspace-section {
    background: var(--migratrix-bg-card);
    border-radius: var(--migratrix-radius);
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1px solid var(--migratrix-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

/* User Cards Container */
.user-cards-container,
.invitations-container {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.user-card {
    border: 2px solid #e9ecef;
    border-radius: 4px;
    background: white;
    transition: all 0.2s ease;
    overflow: hidden;
}

.user-card.selected {
    border-color: #4A89DC;
    background: #f0f8ff;
}

.user-card.not-in-workspace {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
}

.user-card.changed {
    background: #fff3cd;
    border-color: #f39c12;
}

.user-card-header {
    padding: 1rem 1rem 0.5rem 1rem;
}

.user-card-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.user-card-name {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    color: #333;
    flex: 1;
}

.user-card-badge {
    flex-shrink: 0;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-card-system {
    background-color: rgba(74, 137, 220, 0.1);
    color: #4A89DC;
    border: 1px solid rgba(74, 137, 220, 0.2);
}

.badge-custom {
    background-color: rgba(39, 174, 96, 0.1);
    color: #27AE60;
    border: 1px solid rgba(39, 174, 96, 0.2);
}



.user-card-description {
    padding: 0 1rem 1rem 1rem;
}

.user-card-description p {
    font-size: 13px;
    color: #6c757d;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}
.permission-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.permission-percentage {
    color: #4A89DC;
    font-weight: 600;
}

.permission-categories-mini {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.workspace-role-display {
    margin-bottom: 0.5rem;
}
.category-mini {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #6c757d;
    border: 1px solid #e9ecef;
}

.category-mini.more {
    font-style: italic;
    background: transparent;
    border: none;
    color: #999;
}
.environment-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.env-role {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #6c757d;
}

.no-description {
    font-style: italic;
    opacity: 0.7;
}

.user-card-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.header {
    margin-bottom: 1rem;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.header h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 8px;
}

.header p {
    color: #666;
    font-size: 16px;
}

.stat-card {
    text-align: center;
    justify-content: center;
    flex-direction: row;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #4A89DC;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.workspace-select, .search-section {
    display: flex;
    flex-direction: column;
}

.workspace-select label, .search-section label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.workspace-select select, .search-box {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    background: white;
    transition: border-color 0.2s;
}



.workspace-select select:focus, .search-box:focus {
    outline: none;
    border-color: #4A89DC;
}

/* Tab Styles */
.tab-container {
    margin-top: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tab-navigation {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: #e9ecef;
    color: #333;
}

.tab-button.active {
    background: white;
    color: #4A89DC;
    border-bottom-color: #4A89DC;
    font-weight: 600;
}

.tab-icon {
    font-size: 16px;
}

.tab-content {
    background: white;
}

.tab-panel {
    padding: 0;
}

.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.bulk-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.bulk-select {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.bulk-info {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
}

.user-checkbox {
    margin-right: 12px;
    width: 16px;
    height: 16px;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

.user-details h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.user-details p {
    font-size: 13px;
    color: #666;
}

.changes-indicator-tab {
    background: #f39c12;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 0.5rem;
    animation: pulse 2s infinite;
}

.tab-button .changes-indicator-tab {
    background: #e74c3c;
}

.tab-button.active .changes-indicator-tab {
    background: #c0392b;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-accepted {
    background: #d1ecf1;
    color: #0c5460;
}

.status-not-in-workspace {
    background: #fff3cd;
    color: #856404;
    font-size: 10px;
    margin-left: 8px;
}

.btn-remove-from-workspace {
    background: #dc3545;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-remove-from-workspace:hover:not(:disabled) {
    background: #c82333;
    transform: scale(1.1);
}

.btn-remove-from-workspace:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    transform: none;
}


.btn-add-to-workspace:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 18px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 1rem;
}

.loading-state {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4A89DC;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-state-small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: #6b7280;
}

.spinner-sm {
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.alert-success {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-icon {
    flex-shrink: 0;
}

.alert-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}


.btn-secondary {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-secondary:hover:not(:disabled) {
    background: #545b62;
    border-color: #545b62;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
    border-color: #bd2130;
}

.btn:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

.permission-category-section {
    margin-bottom: 2rem;
}

.category-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 1rem;
}

.category-header-section h3 {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.permission-count {
    font-size: 0.85rem;
    color: #666;
    background: #f8f9fa;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 0 1rem;
}

.permission-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.permission-card:hover {
    border-color: #4A89DC;
    box-shadow: 0 2px 8px rgba(74, 137, 220, 0.1);
}

.permission-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.permission-header h4 {
    color: #333;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.permission-module {
    background: #4A89DC;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.permission-description {
    color: #666;
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0.5rem 0;
}

.permission-usage {
    font-size: 0.75rem;
    color: #999;
    border-top: 1px solid #f1f1f1;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.templates-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.template-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.template-card:hover {
    border-color: #4A89DC;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 137, 220, 0.15);
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.template-header h3 {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.template-type {
    background: #6c757d;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.template-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.template-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    color: #666;
}

.template-actions {
    display: flex;
    gap: 0.5rem;
}
    