/* Admin Panel Overrides */
.admin-body {
    background: #111114;
}

.admin-main {
    background: #111114;
    justify-content: flex-start;
    align-items: stretch;
    overflow-y: auto;
}

/* Remove sky shader elements */
#sky-canvas, #sky-blur {
    display: none;
}

/* Admin Nav */
.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin-top: 1.5rem;
}

/* Nav group (collapsible section) */
.nav-group {
    margin-bottom: 0.25rem;
}

.nav-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: color 0.15s;
}

.nav-group-header:hover {
    color: var(--text-secondary);
}

.nav-group-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 0.2s;
    transform: rotate(-90deg);
}

.nav-group--open .nav-group-arrow {
    transform: rotate(0deg);
}

.nav-group-items {
    display: none;
    flex-direction: column;
    gap: 0.125rem;
}

.nav-group--open .nav-group-items {
    display: flex;
}

.admin-nav-link {
    display: block;
    padding: 0.5rem 1rem 0.5rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.admin-nav-link:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.admin-nav-link.active {
    color: var(--text-primary);
    border-left-color: var(--accent);
    background: var(--glass-bg);
}

/* Panel Page Layout */
.panel-page {
    padding: 2rem;
    max-width: 1200px;
}

.panel-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.panel-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.user-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.filter-search {
    flex: 1;
    max-width: 320px;
    padding: 0.625rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

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

.filter-search:focus {
    border-color: var(--accent);
}

.filter-select {
    padding: 0.625rem 2rem 0.625rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 8px;
}

.filter-select:focus {
    border-color: var(--accent);
}

/* User Table */
.user-table-wrap {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow-x: auto;
}

.user-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
}

.user-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
}

.user-table tbody tr {
    border-bottom: 1px solid rgba(100, 100, 100, 0.3);
}

.user-table tbody tr:last-child {
    border-bottom: none;
}

.user-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    vertical-align: middle;
    white-space: nowrap;
}

.table-avatar {
    width: 29px;
    height: 29px;
    border-radius: 50%;
}

.handle-cell {
    font-family: var(--font-handle);
    font-weight: 700;
}

.empty-row {
    text-align: center;
    padding: 2rem 1rem !important;
    color: var(--text-muted);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-registered {
    background: rgba(150, 150, 150, 0.2);
    color: #aaa;
}

.status-onboarded {
    background: rgba(245, 180, 60, 0.15);
    color: #f5b43c;
}

.status-gated {
    background: rgba(240, 130, 50, 0.15);
    color: #f08232;
}

.status-standard {
    background: rgba(129, 255, 45, 0.12);
    color: var(--success);
}

/* Categories */
.categories-cell {
    position: relative;
}

.category-count {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.category-count:hover {
    color: var(--accent-hover);
}

.categories-popover {
    position: absolute;
    z-index: 50;
    top: 100%;
    left: 0;
    min-width: 200px;
}

.popover-content {
    background: rgba(30, 22, 40, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    backdrop-filter: blur(10px);
}

.category-pill {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Actions */
.btn-grant {
    padding: 0.375rem 0.75rem;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-grant:hover {
    background: var(--accent-hover);
}

.approved-label {
    color: var(--success);
    font-size: 0.8rem;
    font-weight: 500;
}

.text-muted {
    color: var(--text-muted);
}

/* Checkbox column */
.check-col {
    width: 40px;
    text-align: center;
}

.row-check,
.contact-row-check {
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* Bulk Action Bar */
.bulk-action-bar {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    margin-bottom: 0.75rem;
    background: rgba(129, 255, 45, 0.06);
    border: 1px solid rgba(129, 255, 45, 0.15);
    border-radius: var(--radius-sm);
}

.bulk-action-bar.is-visible {
    display: flex;
}

.bulk-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-right: auto;
}

.btn-bulk {
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-bulk--grant {
    background: var(--accent);
    color: #000;
}

.btn-bulk--grant:hover {
    background: var(--accent-hover);
}

.btn-bulk--revoke {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

.btn-bulk--revoke:hover {
    background: rgba(248, 113, 113, 0.25);
}

.internal-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
    vertical-align: middle;
    margin-left: 0.25rem;
}

.bulk-actions-menu-wrap {
    position: relative;
}

.btn-bulk--actions {
    background: var(--glass-bg);
    color: var(--text-primary, #fff);
    border: 1px solid var(--glass-border);
}

.btn-bulk--actions:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.bulk-actions-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 0.375rem);
    right: 0;
    min-width: 180px;
    background: var(--card-bg, #1e1e2e);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    z-index: 20;
}

.bulk-actions-menu.is-open {
    display: block;
}

.bulk-action-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    color: var(--text-primary, #fff);
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.bulk-action-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.bulk-action-item + .bulk-action-item {
    border-top: 1px solid var(--glass-border);
}

/* Admin user info */
.admin-user-info {
    padding: 0.5rem 1rem;
    margin-bottom: 0.25rem;
}

.admin-user-info .handle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.admin-logout {
    color: var(--text-muted) !important;
    font-size: 0.85rem;
}

/* Pagination */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin-top: 1rem;
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-page {
    padding: 0.375rem 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-page:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-page--active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    cursor: default;
}

.pagination-ellipsis {
    color: var(--text-muted);
    padding: 0 0.25rem;
}

/* Column Style Selector */
.column-style-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.column-style-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.btn-col-style {
    padding: 0.375rem 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-col-style:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.btn-col-style.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Add Admin Button */
.btn-add-admin {
    padding: 0.5rem 1rem;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-admin:hover {
    background: var(--accent-hover);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
}

.modal-overlay.is-open {
    display: flex;
}

.modal-card {
    background: #1a1a1f;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    margin: 1rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.25rem;
}

/* Search Row */
.search-row {
    margin-bottom: 1rem;
}

.search-row .filter-search {
    width: 100%;
    max-width: none;
}

/* Search Results */
.search-result {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.search-result--found {
    background: rgba(129, 255, 45, 0.06);
    border: 1px solid rgba(129, 255, 45, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-result--error {
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.15);
    color: #f87171;
}

.search-result--info {
    background: rgba(150, 150, 150, 0.1);
    border: 1px solid rgba(150, 150, 150, 0.2);
    color: var(--text-secondary);
}

/* Capabilities Editor */
.caps-panel-cell {
    padding: 0 !important;
}

.caps-panel-cell:empty {
    display: none;
}

.caps-editor {
    padding: 1rem 1.25rem;
    background: rgba(20, 20, 25, 0.5);
}

.caps-group {
    margin-bottom: 1rem;
}

.caps-group:last-of-type {
    margin-bottom: 0.75rem;
}

.caps-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.caps-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    cursor: pointer;
}

.caps-checkbox-row input[type="checkbox"] {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
}

.caps-label {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.caps-key {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
    margin-left: auto;
}

.caps-save-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.caps-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.caps-save-feedback {
    font-size: 0.8rem;
    font-weight: 500;
    transition: opacity 0.3s;
}

.caps-save-feedback--success {
    color: var(--success);
}

.caps-save-feedback--error {
    color: #f87171;
}

.superadmin-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
}

.btn-caps-toggle.active {
    background: var(--accent-hover);
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.caps-row {
    border-bottom: none !important;
}

/* Column visibility by style */
.user-table-wrap.style-user-info [data-col="onboarding"],
.user-table-wrap.style-user-info [data-col="gate"] {
    display: none;
}

.user-table-wrap.style-gate [data-col="email"],
.user-table-wrap.style-gate [data-col="categories"],
.user-table-wrap.style-gate [data-col="age"] {
    display: none;
}

/* Moderation columns hidden by default */
[data-col="moderation"] {
    display: none;
}

.user-table-wrap.style-moderation [data-col="moderation"] {
    display: table-cell;
}

.user-table-wrap.style-moderation [data-col="categories"],
.user-table-wrap.style-moderation [data-col="age"],
.user-table-wrap.style-moderation [data-col="onboarding"],
.user-table-wrap.style-moderation [data-col="gate"] {
    display: none;
}

/* Also hide moderation columns in other explicit styles */
.user-table-wrap.style-user-info [data-col="moderation"],
.user-table-wrap.style-gate [data-col="moderation"] {
    display: none;
}

/* ================================
   Chat Moderation
   ================================ */

/* Match/Connection Status Badges */
.status-searching {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.status-matched {
    background: rgba(245, 180, 60, 0.15);
    color: #f5b43c;
}

.status-connected {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
}

.status-active {
    background: rgba(129, 255, 45, 0.12);
    color: var(--success);
}

.status-kept {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.status-accepted {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

/* QA Badge */
.qa-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(167, 139, 250, 0.2);
    color: #a78bfa;
    vertical-align: middle;
    margin-left: 0.25rem;
}

.qa-badge--sm {
    font-size: 0.55rem;
    padding: 0.1rem 0.35rem;
}

.temp-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(251, 146, 60, 0.2);
    color: #fb923c;
}

/* Chat Moderation Header */
.chat-mod-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.chat-mod-prompts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.875rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

.chat-mod-prompt-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.chat-mod-prompt-text {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.chat-mod-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-mod-vs {
    color: var(--text-muted);
    font-size: 1.25rem;
}

/* Chat History Area */
.chat-history-area {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem;
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Chat Message Bubbles */
.chat-msg {
    display: flex;
    gap: 0.5rem;
    max-width: 80%;
}

.chat-msg--left {
    align-self: flex-start;
}

.chat-msg--right {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.chat-msg-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.chat-msg-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.7rem;
}

.chat-msg--right .chat-msg-meta {
    flex-direction: row-reverse;
}

.chat-msg-handle {
    font-weight: 600;
    color: var(--text-secondary);
}

.chat-msg-time {
    color: var(--text-muted);
}

.chat-msg-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    padding: 0 0.2rem;
    line-height: 1;
}

.chat-msg:hover .chat-msg-delete {
    opacity: 1;
}

.chat-msg-delete:hover {
    color: #f87171;
}

.chat-msg-bubble {
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.4;
    word-break: break-word;
}

.chat-msg--left .chat-msg-bubble {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-top-left-radius: 4px;
}

.chat-msg--right .chat-msg-bubble {
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.25);
    color: var(--text-primary);
    border-top-right-radius: 4px;
}

/* QA Chat Input Area */
.qa-chat-input-area {
    margin-top: 1rem;
}

.qa-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.qa-textarea {
    flex: 1;
    padding: 0.625rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

.qa-textarea:focus {
    border-color: var(--accent);
}

.qa-send-btn {
    padding: 0.625rem 1.25rem;
    height: fit-content;
}

.qa-actions-row {
    display: flex;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.qa-gen-btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.625rem;
}

.qa-gen-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* QA Suggestions */
.qa-suggestions-panel {
    margin-bottom: 0.75rem;
}

.qa-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.qa-suggestion-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    background: rgba(167, 139, 250, 0.06);
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.qa-suggestion-card:hover {
    background: rgba(167, 139, 250, 0.12);
    border-color: rgba(167, 139, 250, 0.3);
}

.qa-suggestion-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

.qa-suggestion-use {
    font-size: 0.75rem;
    font-weight: 600;
    color: #a78bfa;
    white-space: nowrap;
}

/* Assign QA Modal extras */
.assign-qa-info {
    margin-bottom: 1rem;
}

.assign-qa-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    line-height: 1.4;
}

.assign-qa-detail strong {
    color: var(--text-primary);
}

.assign-qa-field {
    margin-bottom: 0.5rem;
}

.assign-qa-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.qa-persona-dropdown {
    position: relative;
    width: 100%;
}

.qa-persona-selected {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 2rem 0.625rem 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    min-height: 42px;
}

.qa-persona-selected:hover {
    border-color: var(--accent);
}

.qa-persona-placeholder {
    color: var(--text-secondary);
}

.qa-persona-options {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1e1e2e;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.qa-persona-dropdown.is-open .qa-persona-options {
    display: block;
}

.qa-persona-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.qa-persona-option:hover {
    background: var(--glass-bg);
}

.qa-persona-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.assign-qa-error {
    font-size: 0.8rem;
    color: #f87171;
    margin-top: 0.5rem;
}

/* AI Suggestions Loading */
.qa-suggestions-loading {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.qa-loading-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: qa-dot-pulse 1.2s ease-in-out infinite;
}

.qa-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.qa-loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes qa-dot-pulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* Commandeer QA */
.claimed-admin-email {
    font-size: 0.8rem;
    color: var(--text-secondary, #a1a1aa);
}

.btn-commandeer {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.25rem 0.6rem;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: var(--radius-sm, 4px);
    color: #fbbf24;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-commandeer:hover {
    background: rgba(251, 191, 36, 0.25);
    border-color: rgba(251, 191, 36, 0.6);
}

/* User cell (avatar + handle) */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-cell-info {
    display: flex;
    flex-direction: column;
}

.user-cell-strikes {
    font-size: 0.7rem;
    color: #fbbf24;
    margin-top: 1px;
}

/* ── Report Detail ────────────────────────────────────────────── */

.report-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.report-detail-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.report-detail-card h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.detail-row {
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.5;
}

.detail-label {
    color: rgba(255, 255, 255, 0.4);
    margin-right: 0.5rem;
}

.flagged-message-highlight {
    background: rgba(231, 76, 60, 0.1);
    border-left: 3px solid rgba(231, 76, 60, 0.5);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    color: var(--text-primary);
}

.report-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 8px;
    color: #fbbf24;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-warning:hover {
    background: rgba(251, 191, 36, 0.25);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.4);
    border-radius: 8px;
    color: #e74c3c;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: rgba(231, 76, 60, 0.25);
}

.text-danger { color: #e74c3c; }
.text-muted { color: rgba(255, 255, 255, 0.4); }
.message-snippet { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap !important; }

/* Report chat history */
.report-chat-history {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.report-chat-history h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.report-chat-messages {
    max-height: 500px;
    overflow-y: auto;
}

.report-chat-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
}

.report-chat-row.reported-message {
    background: rgba(231, 76, 60, 0.08);
    border-left: 3px solid rgba(231, 76, 60, 0.4);
}

.report-chat-bubble {
    flex: 1;
}

.report-chat-handle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-right: 0.5rem;
}

.report-chat-content {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.report-chat-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    margin-left: 0.5rem;
}

.report-flag-icon {
    color: rgba(231, 76, 60, 0.7);
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Status badge variants */
.status-pending { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.status-reviewed { background: rgba(108, 159, 255, 0.15); color: #6c9fff; }
.status-actioned { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.status-dismissed { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.5); }
.status-approved { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.status-denied { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.status-banned { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }

/* Strikes popover */
.strikes-popover-content h4 {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.strike-entry {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.strike-entry.strike-voided { opacity: 0.5; }

.strike-category {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fbbf24;
    margin-right: 0.5rem;
}

.strike-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.strike-voided-badge {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 1px 4px;
    margin-left: 0.5rem;
}

.strike-reason {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0.25rem 0 0;
}

.strike-count-badge {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.strike-count-badge:hover {
    background: rgba(251, 191, 36, 0.25);
}

/* Action log */
.action-log {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1rem;
}

.action-log h4 {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.action-log-entry {
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.action-log-entry:last-child {
    border-bottom: none;
}

.action-log-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-log-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.action-log-strike {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.action-log-ban {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.action-log-ended {
    background: rgba(108, 159, 255, 0.15);
    color: #6c9fff;
}

.action-log-voided {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 1px 5px;
}

.action-log-date {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    margin-left: auto;
}

.action-log-reason {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0.25rem 0 0;
}

.action-log-by {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Appeal action bar */
.appeal-action-bar {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.appeal-actions-wrap {
    position: relative;
}

.appeal-actions-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 4px;
    min-width: 220px;
    z-index: 10;
}

.appeal-actions-menu.is-open {
    display: block;
}

/* Moderation Timeline */
.mod-timeline {
    position: relative;
    padding-left: 24px;
}

.mod-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.08);
}

.mod-timeline-item {
    position: relative;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.mod-timeline-dot {
    position: absolute;
    left: -20px;
    top: 1rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid;
}

.mod-timeline-dot--report {
    border-color: #6c9fff;
    background: rgba(108, 159, 255, 0.3);
}

.mod-timeline-dot--strike {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.3);
}

.mod-timeline-dot--ban {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.3);
}

.mod-timeline-dot--appeal {
    border-color: #a78bfa;
    background: rgba(167, 139, 250, 0.3);
}

.mod-timeline-content {
    padding-left: 0.5rem;
}

.mod-timeline-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mod-timeline-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mod-timeline-date {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    margin-left: auto;
}

.mod-timeline-detail {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0.25rem 0 0;
}

.mod-timeline-by {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Status badge variants for timeline */
/* Reason pills */
.reason-pill {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

.reason-general { background: rgba(108, 159, 255, 0.15); color: #6c9fff; }
.reason-bug { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.reason-feature { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.reason-other { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.6); }

.status-open { background: rgba(108, 159, 255, 0.15); color: #6c9fff; }
.status-claimed { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.status-resolved { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.status-active { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.status-expired { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.5); }
.status-voided { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.5); }

@media (max-width: 900px) {
    .report-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================
   Feature Config
   ================================ */

/* Accordion toggle button */
.btn-accordion {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    padding: 0.25rem;
    line-height: 1;
}

.btn-accordion:hover {
    color: var(--text-primary);
}

.btn-accordion.expanded {
    transform: rotate(90deg);
}

/* Config key/value monospace */
.config-key {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--accent);
    background: rgba(129, 255, 45, 0.06);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.config-value {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.config-value--json {
    display: block;
    margin: 0.375rem 0 0;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    white-space: pre;
    overflow-x: auto;
    line-height: 1.5;
}

.config-value--json-inline {
    margin: 0;
    padding: 0.375rem 0.625rem;
    font-size: 0.8rem;
    max-width: 320px;
}

/* Small action buttons */
.btn-sm {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-sm--edit {
    background: rgba(108, 159, 255, 0.15);
    color: #6c9fff;
}

.btn-sm--edit:hover {
    background: rgba(108, 159, 255, 0.25);
}

.btn-sm--delete {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
}

.btn-sm--delete:hover {
    background: rgba(248, 113, 113, 0.22);
}

.btn-sm--accent {
    background: var(--accent);
    color: #000;
}

.btn-sm--accent:hover {
    background: var(--accent-hover);
}

/* Group row hover */
.group-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Keys panel (expanded area) */
.keys-panel-cell {
    padding: 0 !important;
    border-bottom: none !important;
}

.keys-panel-cell:empty {
    display: none;
}

.keys-panel {
    padding: 0.75rem 1.25rem 1rem 2.5rem;
    background: rgba(20, 20, 25, 0.5);
}

.keys-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.keys-panel-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.keys-table {
    width: 100%;
    border-collapse: collapse;
}

.keys-table thead th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(100, 100, 100, 0.2);
}

.keys-table td {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(100, 100, 100, 0.15);
}

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

.desc-cell {
    color: var(--text-secondary);
    max-width: 200px;
    position: relative;
    cursor: pointer;
}
.desc-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.desc-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: #1e1e22;
    color: var(--text-primary);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
    min-width: 200px;
    max-width: 360px;
    width: max-content;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.desc-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 20px;
    border: 6px solid transparent;
    border-top-color: #444;
}
.desc-cell--expanded .desc-tooltip {
    display: block;
}

.keys-empty {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
}

/* Type pills (color-coded) */
.type-pill {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.type-pill--string {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.type-pill--bool {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.type-pill--int {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.type-pill--float {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
}

.type-pill--double {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}

.type-pill--dict {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}

/* Dict editor (key-value pair editor) */
.dict-editor {
    width: 100%;
}

.dict-editor-rows {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.dict-editor-row {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

.dict-editor-row .dict-type-input {
    width: auto;
    min-width: 80px;
    flex-shrink: 0;
    padding: 0.5rem 1.75rem 0.5rem 0.5rem;
    font-size: 0.8rem;
}

.dict-editor-row .dict-key-input {
    flex: 1;
    min-width: 0;
    max-width: none;
    padding: 0.5rem 0.75rem;
}

.dict-editor-row .dict-val-input {
    flex: 1.5;
    min-width: 0;
    max-width: none;
    padding: 0.5rem 0.75rem;
}

select.dict-val-input {
    width: auto;
    padding: 0.5rem 1.75rem 0.5rem 0.75rem;
}

.dict-editor-row .dict-key-input[readonly] {
    opacity: 0.6;
    cursor: default;
}

.dict-editor-row .dict-type-input:disabled {
    opacity: 0.6;
    cursor: default;
}

.dict-editor-row .btn-icon {
    flex-shrink: 0;
}

/* Form fields */
.form-field {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

/* ================================
   Experiments
   ================================ */

/* Experiment status badges */
.exp-status--draft {
    background: rgba(150, 150, 150, 0.2);
    color: #aaa;
}

.exp-status--running {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.exp-status--completed {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

/* Winner badge */
.winner-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

/* Clickable table rows */
.clickable-row {
    cursor: pointer;
    transition: background 0.15s;
}

.clickable-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Experiment info card */
.exp-info-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.exp-actions-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
}

/* Experiment sections */
.exp-section {
    margin-bottom: 1.5rem;
}

.exp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.exp-section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Complete experiment card */
.exp-complete-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.exp-complete-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Feature key ref styling */
.fk-ref {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--accent);
}

/* Section header actions */
.exp-section-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Weighted split toggle */
.weight-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.weight-toggle input[type="checkbox"] {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
}

.weight-toggle-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Weight input */
.weight-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.weight-input {
    width: 52px;
    padding: 0.25rem 0.4rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.8rem;
    text-align: right;
    outline: none;
}

.weight-input:focus {
    border-color: var(--accent);
}

.weight-pct {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.weight-remaining {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Bool toggle for feature key modal */
.bool-toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    padding: 0.5rem 0;
}

.bool-toggle input[type="checkbox"] {
    display: none;
}

.bool-toggle-track {
    position: relative;
    width: 40px;
    height: 22px;
    background: rgba(150, 150, 150, 0.3);
    border-radius: 11px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.bool-toggle input:checked + .bool-toggle-track {
    background: var(--accent);
}

.bool-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.bool-toggle input:checked + .bool-toggle-track .bool-toggle-thumb {
    transform: translateX(18px);
}

.bool-toggle-label {
    font-size: 0.875rem;
    font-family: monospace;
    color: var(--text-primary);
}

/* ── Feature Gates ───────────────────────────────────────────────────────── */

.gate-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.gate-badge--enabled {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.gate-badge--disabled {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

/* Condition type badges */
.condition-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.condition-badge--user_in_list {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.condition-badge--percentage {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.condition-badge--is_authenticated {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.condition-badge--is_anonymous {
    background: rgba(250, 204, 21, 0.15);
    color: #fbbf24;
}

.condition-badge--email_pattern {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
}

.condition-badge--environment {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}

/* Rule value display */
.condition-value {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Rule disabled row */
.rule-disabled {
    opacity: 0.5;
}

/* Rule toggle */
.rule-toggle {
    cursor: pointer;
}

.rule-toggle input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Rule action buttons */
.rule-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.btn-icon:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.btn-icon--danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Clickable row */
.clickable-row {
    cursor: pointer;
}

.clickable-row:hover td {
    background: var(--glass-bg);
}

/* Form hint */
.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Gate rule condition UIs ─────────────────────────────────── */

/* Chip list (user_in_list) */
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.chip-list:empty {
    display: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 999px;
    font-size: 0.8rem;
    color: #60a5fa;
}

.chip-text {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chip-remove {
    background: none;
    border: none;
    color: rgba(96, 165, 250, 0.6);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.1rem;
}

.chip-remove:hover {
    color: #f87171;
}

.chip-input-row {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

/* Domain input (email_pattern) */
.domain-input-row {
    display: flex;
    align-items: center;
    gap: 0;
}

.domain-at {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 38px;
    background: rgba(236, 72, 153, 0.15);
    border: 1px solid var(--glass-border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: #f472b6;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.domain-input-row .filter-search {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Environment pills */
.env-pills {
    display: flex;
    gap: 0.5rem;
}

.env-pill {
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.env-pill:hover {
    border-color: rgba(251, 146, 60, 0.4);
    color: var(--text-primary);
}

.env-pill.active {
    background: rgba(251, 146, 60, 0.15);
    border-color: rgba(251, 146, 60, 0.5);
    color: #fb923c;
}

/* Percentage slider */
.pct-slider-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pct-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--glass-border);
    border-radius: 3px;
    outline: none;
}

.pct-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid #111;
}

.pct-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid #111;
}

.pct-label {
    font-family: monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 3.5ch;
    text-align: right;
}

/* ── Feature Sync ────────────────────────────────────────────── */

.sync-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.sync-json {
    margin: 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre;
    overflow: auto;
    max-height: 400px;
}

.sync-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.5;
    resize: vertical;
    outline: none;
}

.sync-textarea:focus {
    border-color: var(--accent);
}

.sync-import-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.sync-upload-label {
    cursor: pointer;
}

.sync-no-changes {
    color: var(--success);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}

.sync-diff-heading {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 1rem 0 0.5rem;
}

.sync-diff-heading:first-child {
    margin-top: 0;
}

.sync-diff-item {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    line-height: 1.5;
}

.sync-diff-item del {
    opacity: 0.6;
}

.sync-diff-item code {
    font-family: monospace;
    color: var(--accent);
}

.sync-diff--add {
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.sync-diff--modify {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.sync-diff-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.25rem;
}

.sync-diff-badge--add {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.sync-diff-badge--modify {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.sync-direction-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0 0 0.75rem;
}

/* ── Landing Analytics ──────────────────────────────────────── */

.la-funnel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.la-funnel-step {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.la-funnel-bar-wrap {
    flex: 1;
    height: 28px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    overflow: hidden;
}

.la-funnel-bar {
    height: 100%;
    background: rgba(140, 120, 200, 0.4);
    border-radius: 6px;
    min-width: 4px;
    transition: width 0.6s ease;
}

.la-funnel-label {
    display: flex;
    gap: 0.75rem;
    min-width: 220px;
    align-items: center;
}

.la-funnel-name { color: var(--text-primary); font-size: 0.85rem; min-width: 120px; }
.la-funnel-count { color: var(--text-primary); font-weight: 600; font-size: 0.9rem; min-width: 40px; text-align: right; }
.la-funnel-pct { color: rgba(255, 255, 255, 0.4); font-size: 0.8rem; min-width: 45px; text-align: right; }

.la-metrics-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.la-metric-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.25rem;
    min-width: 120px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.la-metric-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.la-metric-label { font-size: 0.7rem; color: rgba(255, 255, 255, 0.4); text-transform: uppercase; letter-spacing: 0.03em; }

/* Event type pills */
.reason-page_view { background: rgba(108, 159, 255, 0.15); color: #6c9fff; }
.reason-connect_tapped { background: rgba(140, 120, 200, 0.15); color: #a78bfa; }
.reason-avatar_updated { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.reason-handle_updated { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.reason-email_converted { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.reason-chat_started { background: rgba(108, 159, 255, 0.15); color: #6c9fff; }
.reason-new_connection_created { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }

/* ── Ambassador & Campaign ────────────────────────────────────────── */
.status-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}
.status-pill--registered    { background: rgba(251,191,36,0.15); color: #fbbf24; }
.status-pill--pending_onboarding { background: rgba(251,146,60,0.15); color: #fb923c; }
.status-pill--standard      { background: rgba(52,211,153,0.15); color: #34d399; }
.status-pill--suspended      { background: rgba(239,68,68,0.15); color: #ef4444; }
.status-pill--draft          { background: rgba(148,163,184,0.15); color: #94a3b8; }
.status-pill--active         { background: rgba(52,211,153,0.15); color: #34d399; }
.status-pill--paused         { background: rgba(251,191,36,0.15); color: #fbbf24; }
.status-pill--completed      { background: rgba(108,159,255,0.15); color: #6c9fff; }

.status-select {
    background: #1e1e22;
    color: var(--text-primary);
    border: 1px solid #333;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
}

.type-pill--per_acquisition { background: rgba(96,165,250,0.15); color: #60a5fa; }
.type-pill--milestone       { background: rgba(167,139,250,0.15); color: #a78bfa; }
.type-pill--fixed_rate      { background: rgba(251,146,60,0.15); color: #fb923c; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.detail-card {
    background: #1a1a1f;
    border: 1px solid #2a2a30;
    border-radius: 10px;
    padding: 20px;
}
.detail-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 14px;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.88rem;
}
.detail-label {
    color: var(--text-secondary);
}
.back-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 4px;
    display: inline-block;
}
.back-link:hover { color: var(--text-primary); }

.milestone-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.milestone-row input {
    flex: 1;
    background: #1e1e22;
    color: var(--text-primary);
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.85rem;
    font-family: inherit;
}
.milestone-row input:focus {
    outline: none;
    border-color: var(--accent, #7c5cbf);
}

.email-preview-frame {
    border: 1px solid #2a2a30;
    border-radius: 10px;
    overflow: hidden;
}
.email-lookup-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.email-lookup-row .filter-search {
    flex: 1;
}
