/* scope.css — per-tenant scope feedback UI (V1 UI Inventory Tier 1 #2). */

.scope-chip-host {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
}

.scope-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: rgba(0, 200, 255, 0.05);
    border: 1px solid rgba(0, 200, 255, 0.2);
    border-radius: 14px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    line-height: 18px;
    cursor: pointer;
    transition: all 0.15s;
    max-width: 340px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scope-chip:hover {
    background: rgba(0, 200, 255, 0.1);
    border-color: var(--cyan);
}

.scope-chip:focus {
    outline: 2px solid rgba(0, 200, 255, 0.4);
    outline-offset: 1px;
}

.scope-chip.override-active {
    background: rgba(255, 165, 0, 0.08);
    border-color: rgba(255, 165, 0, 0.4);
    color: #ffa500;
}

.scope-chip.override-active:hover {
    background: rgba(255, 165, 0, 0.15);
    border-color: #ffa500;
}

.scope-chip-icon {
    font-size: 11px;
    line-height: 1;
}

.scope-chip-customer {
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Canonical pill segments — match Sentry (IDENTITY-PILL-CANONICAL-SPEC.md):
   name bold/bright, level cyan, tenant muted, "·" separators faded. */
.scope-chip-name {
    color: var(--text);
    font-weight: 600;
}
.scope-chip-role {
    color: var(--cyan);
    font-weight: 500;
}
.scope-chip-tenant {
    color: var(--text-dim);
    font-weight: 400;
}
.scope-chip-sep {
    opacity: 0.4;
}

.scope-chip-source {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', 'Monaco', monospace;
    font-size: 9px;
    margin-left: 4px;
    padding: 0 5px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
}

/* === POPOVER === */
.scope-detail-popover {
    position: fixed;
    top: 56px;
    right: 12px;
    width: 380px;
    max-width: calc(100vw - 24px);
    max-height: 75vh;
    background: var(--surface, rgba(20, 24, 36, 0.97));
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    z-index: 9998;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    animation: scope-popover-in 0.18s ease-out;
}

@keyframes scope-popover-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.scope-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.scope-detail-title {
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
}

.scope-detail-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    border-radius: 3px;
    transition: all 0.15s;
}

.scope-detail-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.scope-detail-body {
    padding: 12px 14px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.scope-kv {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.scope-kv:last-child {
    border-bottom: none;
}

.scope-k {
    color: var(--text-dim);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.scope-v {
    color: var(--text);
    font-size: 12px;
    word-break: break-word;
}

.scope-v .cap-pill {
    margin: 1px 3px 1px 0;
}

.scope-override-row {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 165, 0, 0.04);
    border: 1px solid rgba(255, 165, 0, 0.15);
    border-radius: 6px;
}

.scope-override-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.scope-override-label input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #ffa500;
    cursor: pointer;
}

.scope-override-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.scope-override-text strong {
    color: #ffa500;
    font-size: 12px;
    font-weight: 600;
}

.scope-override-help {
    color: var(--text-dim);
    font-size: 11px;
    line-height: 1.4;
}

/* === FILTER BANNER (above list views) === */
.scope-filter-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: rgba(0, 200, 255, 0.04);
    border-bottom: 1px solid rgba(0, 200, 255, 0.15);
    color: var(--text-dim);
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    margin-bottom: 8px;
}

.scope-filter-icon {
    font-size: 13px;
    flex-shrink: 0;
}

.scope-filter-text {
    flex: 1;
    color: var(--text-muted);
}

.scope-filter-text strong {
    color: var(--cyan);
    font-weight: 600;
    font-family: 'JetBrains Mono', 'Monaco', monospace;
    font-size: 11px;
}

/* === T2 #15: cap-row "what can I do?" description rendering === */
.scope-cap-row {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.scope-cap-row:last-child { border-bottom: none; }

.scope-cap-row-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.scope-cap-surface {
    color: var(--text-dim);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.scope-cap-tier {
    padding: 0 6px;
    border-radius: 8px;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 14px;
}

.scope-cap-tier-read {
    background: rgba(0, 200, 255, 0.08);
    color: var(--cyan);
    border: 1px solid rgba(0, 200, 255, 0.25);
}

.scope-cap-tier-write {
    background: rgba(255, 200, 0, 0.08);
    color: #ffc800;
    border: 1px solid rgba(255, 200, 0, 0.25);
}

.scope-cap-tier-admin {
    background: rgba(255, 80, 100, 0.1);
    color: #ff5064;
    border: 1px solid rgba(255, 80, 100, 0.25);
}

.scope-cap-desc {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.4;
    padding-left: 4px;
}

.scope-cap-unknown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

/* === RESPONSIVE === */
@media (max-width: 700px) {
    .scope-chip {
        max-width: 180px;
    }
    .scope-chip-role,
    .scope-chip-source {
        display: none;
    }
    .scope-detail-popover {
        right: 8px;
        left: 8px;
        width: auto;
    }
}
