/* Military RBAC Access Control view */

.rbac-view {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.rbac-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: var(--space-lg);
    gap: var(--space-md);
}

.rbac-header h2 {
    margin: 0 0 4px;
    font-size: var(--large-font-size);
    font-weight: 600;
    color: var(--text-primary);
}

.rbac-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--small-font-size);
}

.rbac-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--space-sm);
}

.rbac-tab {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: var(--small-font-size);
    transition: all 0.15s var(--ease);
}

.rbac-tab:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.rbac-tab.active {
    background: var(--grad-pill-active);
    border-color: transparent;
    color: var(--text-primary);
}

.rbac-panel {
    flex: 1;
    overflow: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-elevated);
}

.rbac-panel::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.rbac-panel::-webkit-scrollbar-track {
    background: var(--bg-elevated);
}

.rbac-panel::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: var(--radius-pill);
}

.rbac-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.rbac-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: flex-end;
}

.rbac-toolbar-seg {
    margin-left: auto;
}

/* Inline action row at the foot of a settings/form card. */
.rbac-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* Native file inputs: style the picker button like a secondary button so it
   doesn't render as the browser's default white chip on the dark theme. */
.rbac-card input[type="file"] {
    color: var(--text-secondary);
    font-size: var(--small-font-size);
    max-width: 420px;
}

.rbac-card input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-color);
    font-family: inherit;
    font-size: var(--small-font-size);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s var(--ease);
}

.rbac-card input[type="file"]::file-selector-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.rbac-toolbar .form-group {
    margin: 0;
    min-width: 140px;
}

.rbac-toolbar input,
.rbac-toolbar select {
    min-width: 120px;
}

.rbac-card {
    background: var(--grad-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-panel);
}

.rbac-card h3,
.rbac-card h4 {
    margin: 0 0 var(--space-sm);
    font-size: var(--base-font-size);
    font-weight: 600;
}

.rbac-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
}

.rbac-card--full {
    width: 100%;
}

.rbac-table-wrap {
    overflow-x: auto;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.rbac-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--small-font-size);
}

.rbac-table th,
.rbac-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.rbac-table th {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.rbac-table tr:last-child td {
    border-bottom: none;
}

.rbac-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.rbac-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rbac-table td.rbac-actions {
    white-space: nowrap;
}

.rbac-th-sortable {
    cursor: pointer;
    user-select: none;
}

.rbac-th-sortable:hover {
    color: var(--text-primary);
}

.rbac-sort-arrow {
    display: inline-block;
    width: 10px;
    margin-left: 4px;
    font-size: 9px;
    color: var(--text-muted);
}

.rbac-sort-arrow--active {
    color: var(--primary-light);
}

.rbac-toolbar-search {
    min-width: 200px;
}

.rbac-tree ul {
    list-style: none;
    margin: 0;
    margin-left: 9px;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.rbac-tree ul li {
    position: relative;
}

.rbac-tree ul li::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 0.9em;
    width: 10px;
    height: 1px;
    background: rgba(255, 255, 255, 0.14);
}

.rbac-tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    flex-wrap: nowrap;
    min-width: 0;
}

.rbac-tree-item--selected {
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    border-radius: var(--radius-sm);
    padding-left: 4px;
    padding-right: 4px;
}

.rbac-tree-item--file {
    opacity: 0.94;
}

.rbac-tree-label-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.rbac-folder-chevron {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: transform 0.15s var(--ease);
}

.rbac-folder-chevron svg {
    width: 14px;
    height: 14px;
}

.rbac-folder-chevron:not(.collapsed) {
    transform: rotate(90deg);
}

.rbac-folder-chevron-spacer {
    display: inline-block;
    width: 20px;
    flex-shrink: 0;
}

.rbac-tree-label--selectable {
    cursor: pointer;
}

.rbac-tree-label--selectable:hover {
    color: var(--primary-light);
}

.rbac-tree-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.rbac-tree-label {
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rbac-tree-file-count {
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
    white-space: nowrap;
}

.rbac-tree-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.rbac-tree-file-icon svg {
    width: 14px;
    height: 14px;
}

.rbac-tree-file-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s var(--ease);
    flex-shrink: 0;
}

.rbac-tree-file-menu-btn svg {
    width: 15px;
    height: 15px;
}

.rbac-tree-file-menu-btn:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

@keyframes rbacRowFlash {
    0% { background: color-mix(in srgb, var(--primary) 35%, transparent); }
    100% { background: transparent; }
}

.rbac-row-highlight td {
    animation: rbacRowFlash 2.4s ease-out;
}

.rbac-tree-meta {
    color: var(--text-secondary);
    font-size: var(--small-font-size);
}

.rbac-tier {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rbac-tier-basic { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.rbac-tier-specialist { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.rbac-tier-operator_maintainer { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.rbac-tier-admin_manager { background: rgba(var(--primary-rgb), 0.3); color: var(--primary-light); }

.rbac-access-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.rbac-access-badge.admin { background: rgba(var(--primary-rgb), 0.3); color: var(--primary-light); }
.rbac-access-badge.operator { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }

/* Manage a login's organisation access (Users tab) */
.user-membership-remove {
    margin-left: 6px;
    padding: 0 2px;
    background: none;
    border: none;
    color: inherit;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}
.user-membership-remove:hover { opacity: 1; }

.admin-row.admin-row-stacked {
    flex-wrap: wrap;
    align-items: flex-start;
}

.user-add-access {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.user-add-access select,
.user-add-access .user-add-org-fixed {
    padding: 6px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    font-family: inherit;
    font-size: var(--small-font-size);
}

.user-add-access .user-add-org-fixed {
    color: var(--text-secondary);
}

.user-admin-add-wrap {
    display: flex;
    align-items: flex-end;
}

.user-login-actions {
    margin-left: 8px;
}


.rbac-import-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 20px 0 8px;
    text-align: center;
}

.rbac-cl-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.rbac-cl-none { background: rgba(107, 114, 128, 0.25); color: #d1d5db; }
.rbac-cl-unclassified { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.rbac-cl-restricted { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.rbac-cl-confidential { background: rgba(245, 158, 11, 0.25); color: #fcd34d; }
.rbac-cl-secret { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.rbac-cl-top-secret { background: rgba(127, 29, 29, 0.45); color: #fecaca; }
.rbac-cl-unknown { background: rgba(107, 114, 128, 0.25); color: #e5e7eb; }
.rbac-cl-verified {
    font-size: 9px;
    opacity: 0.85;
    margin-left: 4px;
}
.rbac-cl-unverified {
    color: #f87171;
    margin-left: 2px;
}

.rbac-search-input {
    flex: 1 1 220px;
    min-width: 160px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: var(--base-font-size);
    font-family: inherit;
}

.rbac-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.rbac-checkbox-inline label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--small-font-size);
}

.rbac-checkbox-inline input {
    width: auto;
}

.rf-quick-send {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.rf-quick-send-select {
    min-width: 120px;
    max-width: 160px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: var(--small-font-size);
    font-family: inherit;
}

.rbac-hint {
    color: var(--text-secondary);
    font-size: var(--small-font-size);
    margin: 0;
}

.org-admin-mode-title {
    margin: var(--space-md) 0 var(--space-sm);
    font-size: var(--small-font-size);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.org-admin-mode-title:first-child {
    margin-top: 0;
}

/* Restore list indent — fleet.css * { padding: 0 } zeros ul padding. */
ul.rbac-hint {
    margin: var(--space-sm) 0;
    padding-left: 1.5em;
    list-style: disc;
}

ul.rbac-hint li {
    margin: 0.25em 0;
}

.rbac-pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    overflow: auto;
    max-height: 240px;
    white-space: pre-wrap;
    word-break: break-all;
}

.rbac-login-hints {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.rbac-login-hint {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
    font-size: var(--small-font-size);
}

.rbac-login-hint strong {
    display: block;
    margin-bottom: 4px;
}

.rbac-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.rbac-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--small-font-size);
    cursor: pointer;
}

.rbac-empty {
    color: var(--text-secondary);
    font-style: italic;
    padding: var(--space-md);
    text-align: center;
}

.rbac-actions,
.rbac-row-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.rbac-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: var(--space-sm);
    background: color-mix(in srgb, var(--primary) 12%, var(--bg-surface));
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
    border-radius: var(--radius-md);
    position: sticky;
    top: 0;
    z-index: 5;
}

.rbac-bulk-count {
    font-size: var(--small-font-size);
    color: var(--text-primary);
    margin-right: auto;
}

.rbac-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rbac-bulk-cb-cell {
    width: 36px;
    text-align: center;
}

.rbac-bulk-cb-cell input {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.rbac-row-actions-menu {
    position: relative;
    display: inline-flex;
}

.rbac-row-actions-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 25;
    min-width: 160px;
    padding: 4px;
    background: var(--grad-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-modal);
}

.rbac-row-actions-menu.open .rbac-row-actions-dropdown {
    display: block;
}

.rbac-cell-link {
    cursor: pointer;
    color: var(--text-primary);
}

.rbac-cell-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.rbac-form-section {
    margin: 0 0 var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
    font-size: var(--base-font-size);
    font-weight: 600;
    color: var(--text-primary);
}

.rbac-status-online {
    color: var(--color-success);
}

.rbac-status-offline {
    color: var(--text-secondary);
}

.rbac-section--fill {
    flex: 1;
    height: 100%;
    min-height: 0;
}

.rbac-card--flush {
    padding: 0;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.rbac-card--flush .oc-wrap {
    flex: 1;
    min-height: 0;
}

.modal-wide {
    width: min(520px, 94vw);
}

/* --- Org CSV import (merge / rebuild) --- */
.oc-import-choices {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin: var(--space-md) 0;
}

.oc-import-choice {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.oc-import-choice:hover {
    border-color: var(--primary);
    background: var(--bg-elevated);
}

.oc-import-choice--danger:hover {
    border-color: var(--danger-color);
}

.oc-import-choice-title {
    font-weight: 600;
    font-size: var(--small-font-size);
}

.oc-import-choice-desc {
    font-size: var(--small-font-size);
    color: var(--text-secondary);
}

.rbac-warning {
    padding: 10px 12px;
    border: 1px solid var(--danger-color);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--danger-color) 12%, transparent);
    color: var(--text-primary);
    font-size: var(--small-font-size);
    line-height: 1.5;
    margin: var(--space-md) 0;
}

.token-copy {
    cursor: pointer;
    transition: border-color 0.15s var(--ease);
}

.token-copy:hover {
    border-color: var(--primary-light);
}

/* --- Org chart builder --- */
.oc-wrap {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.oc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-elevated) 60%, transparent);
    flex-shrink: 0;
}

.oc-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.oc-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.oc-header-menu {
    position: relative;
}

.oc-header-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    background: var(--grad-pill-active);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--small-font-size);
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.15s var(--ease), transform 0.12s var(--ease);
}

.oc-header-add svg {
    width: 14px;
    height: 14px;
}

.oc-header-add:hover {
    box-shadow: var(--shadow-btn-hover);
    transform: translateY(-1px);
}

.oc-zoom-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
}

.oc-zoom-btn,
.oc-zoom-fit {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: var(--small-font-size);
    cursor: pointer;
    transition: background 0.12s var(--ease), color 0.12s var(--ease);
}

.oc-zoom-btn:hover,
.oc-zoom-fit:hover {
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--text-primary);
}

.oc-zoom-label {
    min-width: 42px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
}

.oc-zoom-fit {
    font-weight: 600;
    border-left: 1px solid var(--border);
    margin-left: 2px;
    padding-left: 10px;
}

.oc-branch-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s var(--ease), color 0.12s var(--ease), border-color 0.12s var(--ease);
}

.oc-branch-btn:hover {
    border-color: var(--primary-light);
    color: var(--text-primary);
    background: color-mix(in srgb, var(--primary) 10%, var(--bg-surface));
}

.oc-root-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px var(--space-md);
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-elevated) 40%, transparent);
    flex-shrink: 0;
}

.oc-root-tab {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: var(--small-font-size);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.oc-root-tab:hover {
    border-color: var(--primary-light);
    color: var(--text-primary);
}

.oc-root-tab--active {
    border-color: var(--primary);
    background: var(--grad-pill-active);
    color: var(--text-primary);
    box-shadow: var(--shadow-btn-hover);
}

.oc-cog-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.oc-cog-btn svg {
    width: 18px;
    height: 18px;
}

.oc-cog-btn:hover,
.oc-cog-btn:focus-visible {
    color: var(--text-primary);
    border-color: var(--primary-light);
    background: color-mix(in srgb, var(--primary) 10%, var(--bg-surface));
    outline: none;
}

.oc-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    min-width: 168px;
    padding: 4px;
    background: var(--grad-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-modal);
    animation: oc-menu-in 0.15s var(--ease);
}

.oc-tile .oc-dropdown {
    top: 36px;
    right: 0;
    left: auto;
}

@keyframes oc-menu-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.oc-dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--small-font-size);
    text-align: left;
    cursor: pointer;
    transition: background 0.12s var(--ease);
}

.oc-dropdown-item:hover {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
}

.oc-dropdown-item--danger {
    color: #f87171;
}

.oc-dropdown-item--danger:hover {
    background: color-mix(in srgb, #ef4444 18%, transparent);
}

.oc-palette-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: var(--small-font-size);
    cursor: pointer;
    transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.oc-palette-toggle:hover {
    border-color: var(--primary-light);
    color: var(--text-primary);
}

.oc-palette-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--primary) 30%, transparent);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
}

.oc-chevron {
    display: flex;
    transition: transform 0.2s var(--ease);
}

.oc-chevron svg {
    width: 14px;
    height: 14px;
}

.oc-palette-toggle--collapsed .oc-chevron {
    transform: rotate(-90deg);
}

.oc-palette {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    max-height: 200px;
    transition: max-height 0.25s var(--ease), padding 0.25s var(--ease), opacity 0.2s var(--ease);
}

.oc-palette--collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    border-bottom-color: transparent;
}

.oc-palette-group h4 {
    margin: 0 0 var(--space-sm);
    color: var(--text-primary);
    font-size: var(--small-font-size);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rbac-empty-inline {
    color: var(--text-secondary);
    font-size: var(--small-font-size);
    font-style: italic;
    list-style: none;
}

.rbac-dnd-source {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rbac-dnd-chip {
    padding: 6px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    cursor: grab;
    font-size: var(--small-font-size);
    transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), border-color 0.12s var(--ease);
}

.rbac-dnd-chip:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-btn-hover);
}

.rbac-dnd-chip:active {
    cursor: grabbing;
}

.rbac-chip-machine,
.rbac-chip-person {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    font-size: var(--small-font-size);
    border: 1px solid var(--border);
}

.rbac-chip-machine {
    background: color-mix(in srgb, var(--primary) 22%, var(--bg-surface));
}

.rbac-chip-person {
    background: var(--bg-elevated);
}

.oc-dragging {
    opacity: 0.45;
}

.oc-tile--lifted {
    opacity: 0.35;
    transform: scale(1.04) translateY(-4px);
    box-shadow: var(--shadow-modal), 0 12px 28px color-mix(in srgb, var(--primary) 22%, transparent);
    border-color: var(--primary-light);
    z-index: 8;
    cursor: grabbing;
}

.oc-branch--lifted {
    z-index: 6;
}

.oc-branch--lifted > .oc-tile {
    /* Source tile stays as a dim placeholder while the drag image floats. */
    opacity: 0.28;
    transform: scale(0.96);
    filter: saturate(0.7);
}

.oc-branch--displaced {
    transform: translateX(var(--oc-displace-x, 0px));
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.oc-reorder-hint {
    position: absolute;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 2px;
    background: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s var(--ease);
    z-index: 4;
}

.oc-reorder-hint--before {
    left: -6px;
}

.oc-reorder-hint--after {
    right: -6px;
}

.oc-tile--reorder-before .oc-reorder-hint--before,
.oc-tile--reorder-after .oc-reorder-hint--after {
    opacity: 1;
}

.oc-tile--reorder-before .oc-drop-hint,
.oc-tile--reorder-after .oc-drop-hint {
    opacity: 0 !important;
}

.oc-tile--reorder-before,
.oc-tile--reorder-after {
    outline: none;
    box-shadow: var(--shadow-card-hover);
}

.oc-is-dragging .oc-tile:not(.oc-tile--lifted) {
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

.rbac-dnd-over {
    outline: 3px dashed var(--primary);
    outline-offset: 6px;
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 18%, transparent), var(--shadow-card-hover);
    animation: oc-pulse 1.2s var(--ease) infinite;
}

.rbac-dnd-invalid {
    outline: 3px dashed #ef4444;
    outline-offset: 6px;
    opacity: 0.55;
    cursor: not-allowed;
}

.oc-is-dragging .oc-drop-hint {
    opacity: 1;
}

.oc-root-drop {
    flex-shrink: 0;
    margin: 0 var(--space-md);
    padding: 14px var(--space-md);
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-md);
    text-align: center;
    background: color-mix(in srgb, var(--primary) 6%, var(--bg-surface));
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.oc-root-drop--over {
    border-color: var(--primary);
    border-style: solid;
    background: color-mix(in srgb, var(--primary) 16%, var(--bg-surface));
}

.oc-root-drop-label {
    font-size: var(--small-font-size);
    font-weight: 600;
    color: var(--text-secondary);
}

.oc-root-drop--over .oc-root-drop-label {
    color: var(--text-primary);
}

.oc-drag-ghost {
    position: fixed;
    top: -1000px;
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    background: var(--grad-panel);
    border: 1px solid var(--primary-light);
    box-shadow: var(--shadow-modal), 0 10px 24px rgba(0, 0, 0, 0.35);
    font-size: var(--small-font-size);
    font-weight: 600;
    color: var(--text-primary);
    pointer-events: none;
    transform: rotate(-2deg) scale(1.05);
    opacity: 0.95;
}

.oc-drag-ghost-name {
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes oc-pulse {
    0%, 100% { outline-color: var(--primary); }
    50% { outline-color: var(--primary-light); }
}

/* Org chart canvas */
.oc-chart-scroll {
    flex: 1;
    overflow: auto;
    min-height: 0;
    padding: var(--space-md);
    background:
        radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--border) 40%, transparent) 1px, transparent 0);
    background-size: 24px 24px;
    background-color: color-mix(in srgb, var(--bg) 92%, var(--bg-elevated));
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-elevated);
}

.oc-chart-scroll--pannable {
    cursor: grab;
}

.oc-chart-scroll.oc-panning {
    cursor: grabbing;
    user-select: none;
}

.oc-chart-scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.oc-chart-scroll::-webkit-scrollbar-track {
    background: var(--bg-elevated);
    border-radius: var(--radius-pill);
}

.oc-chart-scroll::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: var(--radius-pill);
    border: 2px solid var(--bg-elevated);
}

.oc-chart-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

.oc-chart-spacer {
    margin: 0 auto;
    position: relative;
}

.oc-chart-stage {
    transform-origin: top center;
    transition: transform 0.15s var(--ease);
    display: inline-block;
}

.oc-chart-stage .orgchart {
    display: inline-block;
}

.oc-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    min-height: 320px;
    text-align: center;
}

.oc-add-root {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: var(--small-font-size);
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}

.oc-add-root svg {
    width: 16px;
    height: 16px;
}

.oc-add-root:hover {
    border-color: var(--primary);
    border-style: solid;
    color: var(--text-primary);
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    transform: scale(1.02);
}

.oc-add-root--large {
    padding: 24px 36px;
    font-size: var(--base-font-size);
}

.oc-add-root--large svg {
    width: 22px;
    height: 22px;
}

.orgchart,
.orgchart ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Top-to-bottom tree: root at top, siblings in a horizontal row beneath. */
.orgchart ul {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    padding-top: 32px;
    position: relative;
}

.orgchart li {
    position: relative;
    padding: 32px 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible;
}

/* Horizontal bar spanning siblings; vertical stub from parent down to that bar. */
.orgchart ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 32px;
    border-left: 1.5px solid var(--border-light);
}

.orgchart li::before,
.orgchart li::after {
    content: '';
    position: absolute;
    top: 0;
    height: 32px;
    border-top: 1.5px solid var(--border-light);
}

.orgchart li::before {
    right: 50%;
    width: 50%;
    border-right: 1.5px solid var(--border-light);
}

.orgchart li::after {
    left: 50%;
    width: 50%;
}

.orgchart li:only-child::before {
    right: auto;
    left: 50%;
    width: 0;
    border-right: none;
    border-top: none;
    border-left: 1.5px solid var(--border-light);
}

.orgchart li:only-child::after {
    display: none;
}

.orgchart li:first-child::before {
    border-top: none;
    border-right: none;
}

.orgchart li:last-child::after {
    border-top: none;
}

.orgchart > ul {
    padding-top: 0;
}

.orgchart > ul::before {
    display: none;
}

.orgchart > ul > li::before,
.orgchart > ul > li::after {
    display: none;
}

.orgchart > ul > li {
    padding-top: 0;
}

.oc-tile {
    position: relative;
    min-width: 168px;
    max-width: 220px;
    background: var(--grad-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 10px 12px 8px 16px;
    cursor: default;
    overflow: visible;
    z-index: 1;
    box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease), max-width 0.2s var(--ease);
}

.oc-tile--expanded {
    max-width: 280px;
    z-index: 5;
}

.oc-tile--readonly {
    cursor: default;
    padding: 10px 12px 8px 14px;
}

.oc-tile--readonly:hover {
    transform: translateY(-2px);
}

.oc-tile--readonly .oc-tile-body {
    cursor: default;
}

.oc-tile--readonly .oc-tile-body:hover {
    background: transparent;
}

.oc-tile--readonly .oc-tile-name {
    padding: 0 4px 0 10px;
}

.oc-tile--readonly .oc-tile-type-row,
.oc-tile--readonly .oc-tile-stats {
    padding-left: 10px;
}

.oc-drag-handle {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: grab;
    opacity: 0.45;
    transition: opacity 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}

.oc-drag-handle svg {
    width: 14px;
    height: 14px;
}

.oc-tile:hover .oc-drag-handle,
.oc-drag-handle:focus-visible {
    opacity: 1;
    color: var(--primary-light);
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    outline: none;
}

.oc-drag-handle:active {
    cursor: grabbing;
}

.oc-drop-hint {
    position: absolute;
    inset: -8px;
    border-radius: calc(var(--radius-lg) + 4px);
    border: 2px dashed transparent;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s var(--ease);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-light);
}

.oc-is-dragging .rbac-dnd-target:not(.rbac-dnd-invalid) .oc-drop-hint {
    border-color: color-mix(in srgb, var(--primary) 35%, transparent);
}

.rbac-dnd-over .oc-drop-hint {
    opacity: 1;
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.oc-tile:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-card-hover), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.oc-tile-accent {
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--primary);
}

.oc-tile-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
}

.oc-tile:hover .oc-tile-actions,
.oc-tile:focus-within .oc-tile-actions {
    opacity: 1;
    transform: translateY(0);
}

.oc-tile-add,
.oc-tile-kebab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--grad-pill-active);
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}

.oc-tile-add svg,
.oc-tile-kebab svg {
    width: 14px;
    height: 14px;
}

.oc-tile-add:hover,
.oc-tile-kebab:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-btn-hover);
}

.oc-tile-kebab {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.oc-tile-kebab:hover {
    color: var(--text-primary);
}

.oc-tile-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--base-font-size);
    padding: 0 40px 0 18px;
    line-height: 1.3;
}

.oc-tile-body {
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 2px 0 4px;
    transition: background 0.12s var(--ease);
}

.oc-tile-body:hover {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.oc-tile-type-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding-left: 18px;
}

.oc-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: color-mix(in srgb, var(--primary) 25%, var(--bg-surface));
    color: var(--primary-light);
}

.oc-tile-code {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.oc-tile-stats {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 6px;
    padding-left: 18px;
    line-height: 1.3;
}

.oc-tile-branch {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin: 6px auto 0;
    padding: 0;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.12s var(--ease), color 0.12s var(--ease), border-color 0.12s var(--ease);
}

.oc-tile-branch:hover {
    border-color: var(--primary-light);
    color: var(--text-primary);
    background: color-mix(in srgb, var(--primary) 12%, var(--bg-surface));
}

.oc-tile-branch-chevron {
    display: flex;
    transition: transform 0.18s var(--ease);
}

.oc-tile-branch-chevron svg {
    width: 12px;
    height: 12px;
}

.oc-tile-branch--open {
    border-color: var(--primary);
    color: var(--text-primary);
}

.oc-tile-branch--open .oc-tile-branch-chevron {
    transform: rotate(180deg);
}

.oc-tile-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    margin-top: 6px;
    padding: 4px 8px;
    border: none;
    border-top: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: color 0.12s var(--ease), background 0.12s var(--ease);
}

.oc-tile-expand:hover {
    color: var(--primary-light);
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.oc-tile-expand-chevron {
    display: flex;
    transition: transform 0.2s var(--ease);
}

.oc-tile-expand-chevron svg {
    width: 12px;
    height: 12px;
}

.oc-tile--expanded .oc-tile-expand-chevron {
    transform: rotate(180deg);
}

.oc-tile-more {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s var(--ease), opacity 0.2s var(--ease), margin 0.2s var(--ease);
}

.oc-tile--expanded .oc-tile-more {
    max-height: 320px;
    opacity: 1;
    margin-top: 8px;
    overflow-y: auto;
}

.oc-tile-meta-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 4px 8px;
    border-bottom: 1px solid var(--border);
}

.oc-meta-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 6px;
    font-size: 11px;
    line-height: 1.35;
}

.oc-meta-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.oc-meta-value {
    color: var(--text-primary);
    word-break: break-word;
}

.oc-members-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.oc-tile-edit-link {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 6px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--primary-light);
    font-family: var(--font-sans);
    font-size: var(--small-font-size);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

.oc-tile-edit-link:hover {
    background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.oc-dropdown--tile {
    z-index: 30;
    min-width: 152px;
}

.oc-tile:has(.oc-dropdown:not([hidden])) {
    z-index: 40;
}

.oc-edit-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--space-md);
}

.oc-edit-tag {
    font-size: var(--small-font-size);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.oc-members {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
}

.oc-member {
    cursor: grab;
}

/* Full-screen org editor overlay */
.rbac-fs-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.rbac-fs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    background: var(--panel-translucent);
}

.rbac-fs-header h2 {
    margin: 0;
    font-size: var(--large-font-size);
    color: var(--text-primary);
}

.rbac-fs-body {
    flex: 1;
    overflow: auto;
    padding: 0;
}

.rbac-fs-body .oc-wrap {
    min-height: 100%;
}

@media (prefers-reduced-motion: reduce) {
    .oc-tile,
    .oc-add-root,
    .rbac-dnd-chip,
    .oc-tile-actions,
    .oc-dropdown,
    .oc-branch--displaced,
    .oc-tile-branch-chevron,
    .oc-is-dragging .oc-tile:not(.oc-tile--lifted) {
        transition: none;
        animation: none;
    }

    .rbac-dnd-over {
        animation: none;
    }

    .oc-tile:hover,
    .oc-tile--lifted,
    .oc-branch--lifted > .oc-tile {
        transform: none;
    }

    .oc-drag-ghost {
        transform: none;
    }
}

/* ─── Branding settings ──────────────────────────────────────────────────── */

.rbac-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.rbac-checkbox input {
    width: auto;
    margin: 0;
}

/* Single-Use Deployment (File Center) */
.rf-singleuse-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rf-singleuse-info-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
    cursor: help;
    vertical-align: super;
    flex-shrink: 0;
}

.rf-singleuse-info-badge:focus {
    outline: 2px solid var(--color-primary, #a74e9e);
    outline-offset: 2px;
}

.rf-singleuse-info-box {
    position: fixed;
    z-index: 10000;
    max-width: 320px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
    font-size: var(--small-font-size);
    line-height: 1.45;
    pointer-events: none;
}

.rf-singleuse-info-box[hidden] {
    display: none;
}

.rf-singleuse-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    vertical-align: middle;
}

.rbac-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rbac-color-row label {
    width: 100%;
}

.rbac-color-row input[type="color"] {
    width: 48px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    cursor: pointer;
}

.rbac-color-row input[type="text"] {
    width: 140px;
}

.brand-logo-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
}

.brand-logo-preview img {
    max-height: 40px;
    max-width: 160px;
    object-fit: contain;
}

.brand-logo-preview span {
    color: var(--text-secondary);
    font-size: var(--small-font-size);
}

@media (max-width: 768px) {
    .oc-palette {
        grid-template-columns: 1fr;
    }

    .oc-chart-scroll {
        padding: var(--space-md);
    }

    .oc-tile {
        min-width: 140px;
    }

    .rbac-shell {
        padding: var(--space-sm);
    }

    .rbac-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
}

/* --- Audit log --- */
.audit-outcome {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.audit-outcome-success {
    background: color-mix(in srgb, var(--color-success) 22%, transparent);
    color: var(--color-success);
}

.audit-outcome-failure {
    background: color-mix(in srgb, var(--danger-color) 20%, transparent);
    color: #f87171;
}

.audit-verify {
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--small-font-size);
    margin: var(--space-md) 0;
}

.audit-verify-ok {
    border: 1px solid var(--color-success);
    background: color-mix(in srgb, var(--color-success) 12%, transparent);
    color: var(--text-primary);
}

.audit-verify-broken {
    border: 1px solid var(--danger-color);
    background: color-mix(in srgb, var(--danger-color) 14%, transparent);
    color: var(--text-primary);
    font-weight: 600;
}

/* Structure template editor (Settings) */
.rbac-tmpl-levels {
    list-style: none;
    margin: 0 0 var(--space-sm);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rbac-tmpl-level {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.rbac-tmpl-level-key {
    min-width: 100px;
    font-size: var(--small-font-size);
    color: var(--text-secondary);
    font-family: ui-monospace, monospace;
}

.rbac-tmpl-level-label {
    flex: 1;
    min-width: 140px;
}

.rbac-tmpl-level-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
