/* =====================================================
   CLAUX - COMPONENTS
   ===================================================== */

/* ── ATTACHMENTS ──────────────────────────────────── */
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: var(--transition);
}

.attachment-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
}

.attachment-item a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-item a:hover {
    text-decoration: underline;
}

.attachment-item .attachment-name {
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-item .attachment-url {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    flex: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.125rem;
    padding: 4px 8px;
    border-radius: var(--radius);
    flex-shrink: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.attachment-remove:hover {
    background: var(--danger-dim);
}

.attachment-add-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.attachment-add-row .form-control:first-child {
    flex: 1;
}

.attachment-add-row .form-control:nth-child(2) {
    flex: 2;
}

.attachment-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--accent);
    background: var(--accent-dim);
    border-radius: 16px;
    padding: 4px 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* ── COMMENTS ─────────────────────────────────────── */
.comment-item {
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    transition: var(--transition);
}

.comment-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--accent);
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.comment-author {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 0.875rem;
    border-radius: var(--radius);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.comment-action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.comment-action-btn.text-danger:hover {
    color: var(--danger) !important;
    background: var(--danger-dim);
}

.comment-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Inline comment editing */
.comment-edit-area {
    margin-top: 8px;
}

.comment-inline-edit {
    font-size: 0.875rem;
    min-height: 60px;
    max-height: 200px;
    resize: none;
    overflow-y: auto;
    line-height: 1.6;
    transition: border-color 0.15s;
}

.comment-inline-edit:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.comment-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* ── ACTIVITY FEED ────────────────────────────────── */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
    background: var(--border);
}

.activity-dot.green {
    background: var(--success);
}

.activity-dot.orange {
    background: var(--warning);
}

.activity-dot.red {
    background: var(--danger);
}

.activity-dot.blue {
    background: var(--accent);
}

/* ── WORKFLOW STATUS ──────────────────────────────── */
.workflow-status-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-top: 12px;
}

.workflow-status-wrap label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
}

.workflow-status-wrap select {
    flex: 1;
    border: 1px solid var(--border-light) !important;
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary) !important;
    background: var(--bg-secondary) !important;
    cursor: pointer;
    transition: var(--transition);
}

.workflow-status-wrap select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px var(--accent-dim);
    outline: none;
}

.workflow-status-wrap button {
    padding: 8px 16px;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* ── CSV DROP ZONE ────────────────────────────────── */
.csv-drop-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: var(--transition);
}

.csv-drop-zone:hover,
.csv-drop-active {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.csv-drop-zone i {
    font-size: 2.5rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: block;
}

.csv-drop-zone p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ── ALERTS ───────────────────────────────────────── */
.alert-danger,
.alert-warning,
.alert-info,
.alert-success {
    font-size: 0.875rem;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-weight: 400;
    border-left: 4px solid;
}


.alert-danger {
    background: var(--danger-dim);
    color: var(--danger);
    border-color: var(--danger);
}

.alert-warning {
    background: var(--warning-dim);
    color: var(--warning);
    border-color: var(--warning);
}

.alert-info {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: var(--accent);
}

.alert-success {
    background: var(--success-dim);
    color: var(--success);
    border-color: var(--success);
}


/* ── DROPDOWN ─────────────────────────────────────── */
.dropdown-menu {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
}

.dropdown-item {
    color: var(--text-secondary) !important;
    background: transparent !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--accent) !important;
}

/* ── TOAST ────────────────────────────────────────── */
#toastContainer {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    pointer-events: none;
}

#toastContainer .toast {
    pointer-events: auto;
    background: var(--card-bg) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary);
}

#toastContainer .toast button {
    color: var(--text-muted);
}

#toastContainer .toast button:hover {
    color: var(--text-primary);
}

.toast {
    min-width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideIn 0.2s ease;
}

.toast-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-header strong {
    font-size: 0.875rem;
    font-weight: 600;
    flex: 1;
}

.toast-header small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.toast-body {
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── CHARTS ───────────────────────────────────────── */
.chart-container {
    position: relative;
    height: 300px;
    padding: 16px;
}

/* ── SETTINGS ─────────────────────────────────────── */
.settings-group-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span {
    font-size: 1rem;
    color: var(--text-primary);
    font-family: 'Roboto Mono', monospace;
}

.info-item .badge {
    align-self: flex-start;
    font-family: 'Roboto', sans-serif;
}


/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */

.app-footer {
    background: var(--color-background);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem 0;
    margin-top: auto;
}

.app-footer .footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.app-footer .footer-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-footer .footer-copyright,
.app-footer .footer-product {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
    line-height: 1;
}

.app-footer .footer-separator {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.875rem;
}

.app-footer .footer-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.app-footer .footer-link {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.app-footer .footer-link:hover {
    color: var(--color-text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .app-footer .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .app-footer .footer-left {
        flex-direction: column;
        gap: 0.5rem;
    }

    .app-footer .footer-separator {
        display: none;
    }
}



/* ── User Picker ─────────────────────────────────────────── */
.user-picker-wrap {
    position: relative;
}

.user-picker-input-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 6px 10px;
    cursor: text;
    transition: var(--transition);
    min-height: 40px;
    font-size: 0.875rem;
}

.user-picker-input-row:hover {
    border-color: var(--accent-light);
}

.user-picker-input-row:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim);
    background: var(--bg-tertiary);
}

/* Chips */
.user-picker-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent);
    color: #ffffff;
    border-radius: 14px;
    padding: 2px 8px 2px 3px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    max-width: 100%;
}

.user-picker-chip:hover {
    background: var(--accent-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* Name in chip - truncate if too long */
.user-picker-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

.user-picker-chip img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.user-picker-chip-remove {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    font-size: 0.6rem;
    margin-left: 2px;
    transition: var(--transition);
    flex-shrink: 0;
}

.user-picker-chip-remove:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Search input */
.user-picker-search {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.875rem;
    color: var(--text-primary);
    flex: 1 1 auto;
    min-width: 80px;
    font-family: inherit;
    padding: 0;
    margin: 0;
    line-height: 1.5;
}

.user-picker-search::placeholder {
    color: var(--text-muted);
}

/* Dropdown */
.user-picker-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    max-height: 240px;
    overflow-y: auto;
    display: none;
    padding: 4px;
}

.user-picker-dropdown.open {
    display: block;
    animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom scrollbar */
.user-picker-dropdown::-webkit-scrollbar {
    width: 6px;
}

.user-picker-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.user-picker-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

.user-picker-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Option items */
.user-picker-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1px;
}

.user-picker-option:hover,
.user-picker-option.focused {
    background: var(--bg-tertiary);
}

.user-picker-option.selected {
    background: var(--accent-dim);
    border-left: 2px solid var(--accent);
    padding-left: 8px;
}

.user-picker-option img,
.user-picker-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    border: 2px solid var(--border);
}

.user-picker-option-info {
    flex: 1;
    min-width: 0;
}

.user-picker-option-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1px;
    line-height: 1.3;
    font-size: 0.875rem;
}

.user-picker-option-email {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Role badge */
.user-picker-role-badge {
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.user-picker-option.selected .user-picker-role-badge {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

/* Empty state */
.user-picker-empty {
    padding: 16px 12px;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

.user-picker-empty i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 6px;
    opacity: 0.4;
}



/* ── AUTHENTICATION METHOD BADGE ────────────────────────────────────────── */
.auth-method-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-method-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid;
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
    max-width: fit-content;
}

.auth-method-badge::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.auth-method-badge.local {
    background: var(--bg-secondary);
    border-color: var(--accent);
    color: var(--accent);
}

.auth-method-badge.local::before {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.auth-method-badge.sso {
    background: var(--bg-secondary);
    border-color: #06b6d4;
    color: #06b6d4;
}

.auth-method-badge.sso::before {
    background: linear-gradient(180deg, #06b6d4 0%, #0284c7 100%);
}

.auth-method-badge i {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.auth-method-help {
    font-size: 0.73rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.auth-method-help i {
    color: var(--accent);
    margin-top: 2px;
    flex-shrink: 0;
}

/* Tags Container */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    min-height: 44px;
    align-items: center;
}

/* Tag Chip */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border-radius: 16px;
    padding: 5px 12px;
    font-size: .78rem;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.25);
    transition: transform 0.15s, box-shadow 0.15s;
}

.tag-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.35);
}

.tag-chip i {
    font-size: .68rem;
    opacity: 0.85;
}

/* Tag chip remove button (for edit modal) */
.tag-chip-remove {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: .75rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
    transition: background 0.15s;
}

.tag-chip-remove:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Alternative tag styles for variety */
.tag-chip--outline {
    background: transparent;
    color: var(--accent, #6366f1);
    border: 1.5px solid var(--accent, #6366f1);
    box-shadow: none;
}

.tag-chip--subtle {
    background: var(--accent-light, #e0e7ff);
    color: var(--accent, #4f46e5);
    box-shadow: none;
}

/* Quick-add tag buttons */
.btn-tag-quick {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 12px;
    padding: 3px 10px;
    font-size: .75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-tag-quick:hover {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}


/* ══════════════════════════════════════════════════════════════════════════
   User Management - Avatar Circles & Role Badges
   ══════════════════════════════════════════════════════════════════════════ */

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

/* Role badges */
.badge-role-admin,
.badge-role-user,
.badge-role-auditor {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-role-admin {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
}

.badge-role-user {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.badge-role-auditor {
    background: rgba(156, 163, 175, 0.12);
    color: #6b7280;
}

/* Auth method badges */
.badge-auth-local,
.badge-auth-saml {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-auth-local {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.badge-auth-saml {
    background: rgba(168, 85, 247, 0.12);
    color: #a855f7;
}

/* ── VIEW MODAL PERSON CHIPS ──────────────────────── */

.view-person-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px 2px 3px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-right: 5px;
    margin-bottom: 4px;
    vertical-align: middle;
}

.view-person-chip--primary {
    border-color: var(--accent);
    background: var(--accent-dim, rgba(37,99,235,.06));
}

.view-person-chip-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    flex-shrink: 0;
}

.view-person-chip-badge {
    font-size: .6rem;
    padding: 0 4px;
    border-radius: 3px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    margin-left: 2px;
}

/* ── CONTRACT ORG CHIPS ───────────────────────────── */

.org-chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
}

.contract-org-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 500;
    color: var(--text-primary);
}

.contract-org-chip button {
    background: none;
    border: none;
    padding: 0 0 0 4px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: .85rem;
    line-height: 1;
}

.contract-org-chip button:hover { color: var(--danger); }

/* ── MULTI-PERSON PICKERS (legacy, kept for compat) ── */

.multi-assignee-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

.multi-assignee-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── ORG TREE ─────────────────────────────────────── */

.org-tab {
    background: none;
    border: none;
    padding: 9px 16px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}

.org-tab:hover { color: var(--accent); }
.org-tab--active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.org-node {
    margin-bottom: 4px;
}

.org-node-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.org-node-main:hover,
.org-node--active .org-node-main {
    border-color: var(--accent);
    background: var(--accent-dim, rgba(37,99,235,.04));
}

.org-node-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.org-node-body { flex: 1; min-width: 0; }

.org-node-name {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.org-node-code {
    font-size: .72rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.org-node-type-badge {
    font-size: .68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}

.org-node-meta {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.org-node-desc {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.org-node-stats {
    font-size: .78rem;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
}

.org-node-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity .15s;
}

.org-node-main:hover .org-node-actions { opacity: 1; }

/* ── PERMISSION MATRIX ────────────────────────────── */

.perm-matrix-row {
    display: grid;
    grid-template-columns: 1fr repeat(3, 72px);
    align-items: center;
    padding: 7px 10px;
    border-radius: 6px;
    gap: 4px;
}

.perm-matrix-row:not(.perm-matrix-header):hover {
    background: var(--bg-tertiary);
}

.perm-matrix-header {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2px;
}

.perm-matrix-action {
    font-size: .84rem;
    color: var(--text-primary);
    font-weight: 500;
}

.perm-matrix-role {
    display: flex;
    justify-content: center;
    align-items: center;
}

.perm-matrix-role .form-check {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.perm-matrix-role .form-check-input {
    margin: 0;
    width: 1.1em;
    height: 1.1em;
    cursor: pointer;
    flex-shrink: 0;
}

.perm-matrix-role .form-check-input:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ── PERMISSION SCHEME OPTIONS ────────────────────── */

.perm-scheme-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.perm-scheme-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-dim, rgba(37,99,235,.06));
}

.perm-scheme-option input[type=radio] {
    margin-top: 3px;
    flex-shrink: 0;
}

.perm-scheme-title {
    font-size: .84rem;
    font-weight: 600;
    color: var(--text-primary);
}

.perm-scheme-desc {
    font-size: .78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.perm-scheme-badge {
    display: inline-block;
    font-size: .65rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--success, #16a34a);
    color: #fff;
    font-weight: 500;
    margin-left: 6px;
    vertical-align: middle;
}
