body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* AIRI brand (see docs/AIRI-BRANDING.md) */
.sentinel-brand-mark-img {
    object-fit: contain;
    background: rgba(255, 255, 255, 0.04);
}

.sentinel-brand-login-logo {
    max-width: 280px;
    max-height: 140px;
    width: auto;
    height: auto;
    object-fit: contain;
}

pre {
    font-family: 'Cascadia Code', 'Consolas', monospace;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.installer-os-icon {
    width: 1.15rem;
    height: 1.15rem;
    display: block;
}

/* Optional chrome when a platform operator impersonates an MSP (see Platform settings). */
.sentinel-impersonation-border {
    outline: 3px solid rgba(255, 193, 7, 0.85);
    outline-offset: -3px;
}

.sentinel-customer-acting-border {
    outline: 3px solid rgba(13, 202, 240, 0.75);
    outline-offset: -3px;
}

/* ── Global search (GlobalSearch.razor) ─────────────────────────────────── */

.airi-global-search {
    position: relative;
    width: 100%;
    max-width: 920px;
    min-width: min(100%, 360px);
}

.airi-search-scope {
    flex-shrink: 0;
    max-width: 140px;
}

.airi-search-input {
    min-width: 0;
    flex: 1 1 auto;
}

.airi-search-item.airi-search-item-active {
    background: #e8eeff;
    outline: none;
}

.airi-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 1050;
    max-height: 340px;
    overflow-y: auto;
}

.airi-search-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 0.84rem;
    flex-wrap: wrap;
}
.airi-search-item:hover { background: #f0f4ff; }
.airi-search-muted { color: #888; cursor: default; }
.airi-search-muted:hover { background: none; }

.airi-search-label { font-weight: 500; }
.airi-search-sub { color: #555; font-size: 0.78rem; }
.airi-search-detail { color: #888; font-size: 0.76rem; font-family: 'Cascadia Code', monospace; }
.airi-search-kind-badge { font-size: 0.7rem; flex-shrink: 0; }

/* Add device modal — medium OS icons (CustomerAgents) */
.airi-installer-os-icon-lg {
    width: 72px;
    height: 72px;
}
.airi-add-device-os-card {
    background: #fafbfc;
}

/* ── Console modal (ConsoleModal.razor) ─────────────────────────────────── */

.airi-console-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
}

.airi-console-window {
    background: #1a1a2e;
    color: #c8d3e0;
    border-radius: 10px;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    width: min(92vw, 860px);
    height: min(80vh, 580px);
    font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    font-size: 0.82rem;
    overflow: hidden;
}

.airi-console-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #12122a;
    border-bottom: 1px solid #2a2a4a;
    user-select: none;
    flex-shrink: 0;
}

.airi-console-title {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 0.78rem;
    color: #8892a4;
}

.airi-console-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    opacity: 0.75;
}

.airi-console-shell-select {
    background: #22223a;
    color: #c8d3e0;
    border: 1px solid #3a3a5a;
    border-radius: 4px;
    font-size: 0.75rem;
    padding: 2px 6px;
    outline: none;
}

.airi-console-close {
    background: none;
    border: none;
    color: #8892a4;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1;
}
.airi-console-close:hover { background: #3a3a5a; color: #e0e6f0; }

.airi-console-output {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    line-height: 1.55;
    word-break: break-all;
    white-space: pre-wrap;
}

.airi-console-line { margin: 0; padding: 0; }
.airi-console-stdout { color: #c8d3e0; }
.airi-console-stderr { color: #f4856a; }
.airi-console-muted { color: #5a6070; font-style: italic; }
.airi-console-prompt-echo { color: #6bdbcb; }
.airi-console-exit { color: #f4a94a; font-size: 0.78rem; }
.airi-console-cursor { animation: blink 1s step-end infinite; color: #6bdbcb; }
@keyframes blink { 50% { opacity: 0; } }

.airi-console-inputrow {
    display: flex;
    align-items: center;
    border-top: 1px solid #2a2a4a;
    background: #12122a;
    padding: 6px 10px;
    flex-shrink: 0;
    gap: 6px;
}

.airi-console-prompt {
    color: #6bdbcb;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.airi-console-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e8f0fc;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    caret-color: #6bdbcb;
}
.airi-console-input::placeholder { color: #3a4050; }

.airi-console-send-btn {
    background: none;
    border: 1px solid #3a3a5a;
    color: #8892a4;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.4;
}
.airi-console-send-btn:not(:disabled):hover { background: #22223a; color: #c8d3e0; }
.airi-console-send-btn:disabled { opacity: 0.35; cursor: default; }

/* ── AI Chat modal (AiChatModal.razor) ──────────────────────────────────── */

.airi-chat-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
}

.airi-chat-window {
    background: #1a1a2e;
    color: #c8d3e0;
    border-radius: 10px;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    width: min(96vw, 1040px);
    height: min(88vh, 820px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.88rem;
    overflow: hidden;
}

.airi-chat-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #12122a;
    border-bottom: 1px solid #2a2a4a;
    flex-shrink: 0;
}

.airi-chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #8892a4;
}

.airi-chat-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
    opacity: 0.75;
}

.airi-chat-close {
    background: none;
    border: none;
    color: #8892a4;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1;
}
.airi-chat-close:hover { background: #3a3a5a; color: #e0e6f0; }

.airi-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.airi-chat-msg { display: flex; flex-direction: column; max-width: 88%; }
.airi-chat-msg-user { align-self: flex-end; align-items: flex-end; }
.airi-chat-msg-ai   { align-self: flex-start; }

.airi-chat-bubble {
    padding: 7px 12px;
    border-radius: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.airi-chat-msg-user .airi-chat-bubble { background: #264579; color: #dceeff; border-bottom-right-radius: 3px; }
.airi-chat-msg-ai   .airi-chat-bubble { background: #22223a; color: #c8d3e0; border-bottom-left-radius: 3px; }

.airi-chat-bubble-streaming { border-bottom-left-radius: 3px; }

.airi-chat-label { font-size: 0.72rem; color: #5a6070; margin-bottom: 2px; }
.airi-chat-msg-user .airi-chat-label { text-align: right; }

.airi-chat-proposal {
    background: #1e3a26;
    border: 1px solid #2e6a36;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 4px;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.78rem;
    color: #a8e6b4;
}

.airi-chat-proposal-actions { display: flex; gap: 8px; margin-top: 6px; }
.airi-chat-approve-btn { background: #1a5c28; color: #a8e6b4; border: 1px solid #2e8a3a; border-radius: 5px; padding: 3px 12px; cursor: pointer; font-size: 0.8rem; }
.airi-chat-approve-btn:hover { background: #2a7a38; }
.airi-chat-reject-btn  { background: #5c1a1a; color: #e6a8a8; border: 1px solid #8a2e2e; border-radius: 5px; padding: 3px 12px; cursor: pointer; font-size: 0.8rem; }
.airi-chat-reject-btn:hover  { background: #7a2a2a; }

.airi-chat-cmd-output {
    background: #111120;
    border-radius: 5px;
    padding: 6px 10px;
    margin-top: 4px;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.76rem;
    color: #9ab0c8;
    max-height: 140px;
    overflow-y: auto;
    white-space: pre;
}

.airi-chat-inputrow {
    display: flex;
    align-items: center;
    border-top: 1px solid #2a2a4a;
    background: #12122a;
    padding: 8px 12px;
    flex-shrink: 0;
    gap: 8px;
}

.airi-chat-input {
    flex: 1;
    background: #22223a;
    border: 1px solid #3a3a5a;
    border-radius: 6px;
    color: #e8f0fc;
    font-size: 0.86rem;
    padding: 6px 10px;
    outline: none;
    resize: none;
    font-family: inherit;
    line-height: 1.4;
    max-height: 80px;
}
.airi-chat-input::placeholder { color: #3a4050; }

.airi-chat-send-btn {
    background: #264579;
    color: #dceeff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.airi-chat-send-btn:not(:disabled):hover { background: #1a5cb8; }
.airi-chat-send-btn:disabled { opacity: 0.4; cursor: default; }
