/* ── KPI Info Tooltip ────────────────────────────────────── */

.kpi-info-wrap {
    position: relative;
    display: inline-block;
    margin-left: 4px;
    vertical-align: middle;
}

.kpi-info-icon {
    font-size: 0.85rem;
    opacity: 0.7;
    cursor: help;
    transition: opacity 0.2s, color 0.2s;
    color: #6b7b96;
}

.kpi-info-wrap:hover .kpi-info-icon {
    opacity: 1;
    color: #4f8cff;
}

.kpi-info-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #232738;
    color: #f0f0f0;
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: 8px;
    white-space: normal;
    width: 260px;
    text-align: left;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    border: 1px solid rgba(79,140,255,0.2);
    z-index: 1000;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
    letter-spacing: normal;
    text-transform: none;
}

.kpi-info-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #232738;
}

.kpi-info-wrap:hover .kpi-info-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Light mode */
[data-bs-theme="light"] .kpi-info-tooltip {
    background: #fff;
    color: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    border: 1px solid #e0e0e0;
}

[data-bs-theme="light"] .kpi-info-tooltip::after {
    border-top-color: #fff;
}

/* ── Skeleton shimmer ────────────────────────────────────── */

.skeleton {
    background: linear-gradient(90deg, #e8e8e8 25%, #f0f0f0 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton--circle {
    border-radius: 50%;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

[data-bs-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #1a1d27 25%, #252836 50%, #1a1d27 75%);
    background-size: 200% 100%;
}

/* ── Fade-in animation ───────────────────────────────────── */

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

/* ── Top bar action row ──────────────────────────────────── */

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-actions .theme-toggle-btn,
.topbar-actions .changelog-wrapper .btn {
    font-size: 1rem;
}

/* Prevent changelog badge from overlapping adjacent icons */
.topbar-actions .changelog-wrapper {
    margin-right: 4px;
}

@media (max-width: 767.98px) {
    .topbar-actions {
        gap: 0.25rem;
    }

    .topbar-actions .theme-toggle-btn {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .topbar-actions .cmd-k-trigger {
        padding: 2px 6px;
    }
}

/* ── Theme toggle button ─────────────────────────────────── */

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: none;
    color: #555;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s, border-color 0.15s;
}

.theme-toggle-btn:hover {
    background: #f5f7ff;
    border-color: #c0c8e0;
}

[data-bs-theme="dark"] .theme-toggle-btn {
    border-color: #444;
    color: #ffc107;
}

[data-bs-theme="dark"] .theme-toggle-btn:hover {
    background: rgba(255,255,255,0.08);
}

/* ── Thin scrollbars (global) ─────────────────────────────── */

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* Light theme scrollbar */
[data-bs-theme="light"] * {
    scrollbar-color: rgba(0,0,0,0.15) transparent;
}

[data-bs-theme="light"] *::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
}

[data-bs-theme="light"] *::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.3);
}

/* ── Sidebar scrollbar (always dark background) ──────────── */

.sidebar, .sidebar *,
.nav-scrollable, .nav-scrollable * {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.sidebar ::-webkit-scrollbar-thumb,
.nav-scrollable ::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15) !important;
}

.sidebar ::-webkit-scrollbar-thumb:hover,
.nav-scrollable ::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3) !important;
}

/* ── User avatar circle ──────────────────────────────────── */

.user-avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f8cff 0%, #6c5ce7 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ── Org Selector ────────────────────────────────────────── */

.org-selector {
    position: relative;
}

.org-selector-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.03);
    border: 1px solid #e0e3ea;
    border-radius: 10px;
    padding: 5px 12px 5px 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
}

.org-selector-trigger:hover {
    background: rgba(0,0,0,0.06);
    border-color: #c5cad3;
}

.org-selector-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.org-selector-name {
    font-weight: 500;
    color: #1a1a2e;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.org-selector-tier {
    font-size: 0.65rem;
    background: linear-gradient(135deg, #17a2b8, #0d8da0);
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: capitalize;
}

.org-selector-chevron {
    font-size: 0.65rem;
    color: #999;
    margin-left: 2px;
}

.org-selector-dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    min-width: 280px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    z-index: 1060;
    padding: 6px 0;
    animation: fadeIn 0.12s ease-out;
}

.org-selector-dropdown-header {
    padding: 8px 14px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
}

.org-selector-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    cursor: pointer;
    transition: background 0.12s;
    text-align: left;
}

.org-selector-option:hover {
    background: #f5f7ff;
}

.org-selector-option.active {
    background: #f0f4ff;
}

.org-selector-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.org-selector-option-info {
    flex: 1;
    min-width: 0;
}

.org-selector-option-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1a1a2e;
}

.org-selector-option-tier {
    font-size: 0.72rem;
    color: #888;
}

.org-selector-check {
    color: #4f8cff;
    font-size: 1rem;
}

/* Dark mode */
[data-bs-theme="dark"] .org-selector-trigger {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
}

[data-bs-theme="dark"] .org-selector-trigger:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

[data-bs-theme="dark"] .org-selector-name {
    color: #e1e4e8;
}

[data-bs-theme="dark"] .org-selector-chevron {
    color: #6b7080;
}

[data-bs-theme="dark"] .org-selector-dropdown {
    background: #1a1d27;
    border-color: #2d3140;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

[data-bs-theme="dark"] .org-selector-dropdown-header {
    color: #6b7080;
}

[data-bs-theme="dark"] .org-selector-option:hover {
    background: rgba(255,255,255,0.06);
}

[data-bs-theme="dark"] .org-selector-option.active {
    background: rgba(79,140,255,0.1);
}

[data-bs-theme="dark"] .org-selector-option-name {
    color: #e1e4e8;
}

[data-bs-theme="dark"] .org-selector-option-tier {
    color: #6b7080;
}

/* ── Profile trigger + avatar ─────────────────────────────── */

.profile-menu-wrapper {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 10px;
    transition: background 0.15s;
}

.profile-trigger:hover {
    background: rgba(0,0,0,0.05);
}

.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f8cff, #6c5ce7);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.profile-display-name {
    font-size: 0.85rem;
    color: #333;
    font-weight: 500;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-role-badge {
    font-size: 0.65rem;
    background: linear-gradient(135deg, #17a2b8, #0d8da0);
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
}

.profile-chevron {
    font-size: 0.7rem;
    color: #888;
}

/* Dark mode */
[data-bs-theme="dark"] .profile-trigger:hover {
    background: rgba(255,255,255,0.06);
}

[data-bs-theme="dark"] .profile-display-name {
    color: #e1e4e8;
}

[data-bs-theme="dark"] .profile-chevron {
    color: #6b7080;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1060;
    padding: 8px 0;
    animation: fadeIn 0.12s ease-out;
}

.profile-dropdown-header {
    padding: 10px 16px 6px;
}

.profile-dropdown-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a2e;
}

.profile-dropdown-email {
    font-size: 0.78rem;
    color: #888;
}

.profile-dropdown-divider {
    margin: 6px 0;
    border-color: #f0f0f0;
}

.profile-dropdown-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    margin: 1px 6px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #333;
    text-decoration: none;
    background: none;
    border: none;
    box-sizing: border-box;
    cursor: pointer;
    transition: background 0.15s;
}

.profile-dropdown-item i {
    font-size: 1rem;
    color: #6c757d;
}

.profile-dropdown-item:hover {
    background: #f5f7ff;
    color: #333;
}

.profile-dropdown-signout {
    color: #dc3545;
}

.profile-dropdown-signout:hover {
    background: #fff5f5;
    color: #dc3545;
}

/* Dark mode */
[data-bs-theme="dark"] .profile-dropdown {
    background: #1a1d27;
    border-color: #2d3140;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

[data-bs-theme="dark"] .profile-dropdown-name {
    color: #e1e4e8;
}

[data-bs-theme="dark"] .profile-dropdown-email {
    color: #6b7080;
}

[data-bs-theme="dark"] .profile-dropdown-divider {
    border-color: #2d3140;
}

[data-bs-theme="dark"] .profile-dropdown-item {
    color: #c0c4d0;
}

[data-bs-theme="dark"] .profile-dropdown-item i {
    color: #6b7080;
}

[data-bs-theme="dark"] .profile-dropdown-item:hover,
[data-bs-theme="dark"] .profile-dropdown-item:focus {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

[data-bs-theme="dark"] .profile-dropdown-signout {
    color: #ff6b7a;
}

[data-bs-theme="dark"] .profile-dropdown-signout:hover {
    background: rgba(220,53,69,0.15);
    color: #ff6b7a;
}

/* ── Density: data-density attribute on .page ────────────────── */

[data-density="compact"] {
    --density-spacing: 0.5rem;
    --density-font: 0.8rem;
    --density-card-padding: 0.5rem 0.75rem;
    --density-table-padding: 0.25rem 0.5rem;
    --density-row-gap: 0.5rem;
}

[data-density="comfortable"] {
    --density-spacing: 0.75rem;
    --density-font: 0.875rem;
    --density-card-padding: 0.75rem 1rem;
    --density-table-padding: 0.5rem 0.75rem;
    --density-row-gap: 1rem;
}

[data-density="spacious"] {
    --density-spacing: 1.25rem;
    --density-font: 1rem;
    --density-card-padding: 1.25rem 1.5rem;
    --density-table-padding: 0.75rem 1rem;
    --density-row-gap: 1.5rem;
}

[data-density] .card-body {
    padding: var(--density-card-padding, 1rem);
}

[data-density] .table td,
[data-density] .table th {
    padding: var(--density-table-padding, 0.5rem);
    font-size: var(--density-font, 0.875rem);
}

[data-density] .row.g-3 {
    --bs-gutter-y: var(--density-row-gap, 1rem);
    --bs-gutter-x: var(--density-row-gap, 1rem);
}

[data-density] .kpi-card .card-title {
    font-size: calc(var(--density-font, 0.875rem) * 2.2);
}

[data-density] .kpi-card .card-subtitle {
    font-size: calc(var(--density-font, 0.875rem) * 0.85);
}

/* ── Layout: content area bottom spacing ─────────────────────── */

.page > main > article.content {
    padding-bottom: 3rem;
}

/* ── KPI Cards ──────────────────────────────────────────────── */

.kpi-card .card-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-card .card-subtitle {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-card--clickable {
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s;
}

.kpi-card--clickable:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

/* ── Bar Chart ─────────────────────────────────────────────── */

.bar-chart-row .progress {
    border-radius: 2px;
}

.bar-chart-row .progress-bar {
    transition: width 0.3s ease;
}

/* ── Timeline ──────────────────────────────────────────────── */

.timeline-container {
    position: relative;
    padding-left: 0;
}

.timeline-step {
    position: relative;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timeline-line {
    flex-grow: 1;
}

/* ── SLA ───────────────────────────────────────────────────── */

.sla-breached {
    background-color: rgba(220, 53, 69, 0.08) !important;
}

.sla-breached:hover {
    background-color: rgba(220, 53, 69, 0.15) !important;
}

/* ── Sidebar Navigation ───────────────────────────────────── */

.sidebar .nav-scrollable .nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
    padding: 0.85rem 1rem 0.25rem 1.75rem;
    text-transform: uppercase;
}

.sidebar .nav-scrollable .nav-section-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 1.25rem;
    user-select: none;
    transition: color 0.15s;
}

.sidebar .nav-scrollable .nav-section-toggle:hover {
    color: rgba(255, 255, 255, 0.6);
}

.sidebar .nav-scrollable .nav-section-chevron {
    font-size: 0.55rem;
}

.sidebar .nav-scrollable .nav-item {
    font-size: 0.875rem;
    padding-bottom: 2px;
}

.sidebar .nav-scrollable .nav-item .nav-link {
    color: rgba(255, 255, 255, 0.7);
    background: none;
    border: none;
    border-radius: 6px;
    height: 2.5rem;
    padding: 0 0.75rem;
    line-height: normal;
    display: flex;
    align-items: center;
    width: 100%;
    transition: all 0.15s ease;
    font-weight: 400;
    gap: 0.6rem;
}

.sidebar .nav-scrollable .nav-item .nav-link > i {
    font-size: 1.05rem;
    width: 1.25rem;
    flex-shrink: 0;
    text-align: center;
    opacity: 0.65;
    transition: opacity 0.15s ease;
}

.sidebar .nav-scrollable .nav-item .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-weight: 500;
}

.sidebar .nav-scrollable .nav-item .nav-link.active > i {
    opacity: 1;
}

.sidebar .nav-scrollable .nav-item .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}

.sidebar .nav-scrollable .nav-item .nav-link:hover > i {
    opacity: 1;
}

/* ── Ops Scoreboard ───────────────────────────────────────── */

.ops-scoreboard {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
}

.ops-row {
    display: grid;
    grid-template-columns: 200px 70px 1fr 90px 90px 80px 70px 80px;
    align-items: center;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--bs-border-color-translucent);
    gap: 0.5rem;
    transition: background-color 0.1s ease;
}

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

.ops-row:not(.ops-row-header):hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.ops-row-header {
    background-color: var(--bs-light);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary);
    padding: 0.5rem 1rem;
}

.ops-row-error {
    background-color: rgba(255, 193, 7, 0.05);
}

.ops-cell-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ops-cell-metric {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.3;
}

.ops-cell-health {
    text-align: center;
}

.ops-cell-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ops-metric-sub {
    font-size: 0.65rem;
    color: var(--bs-secondary);
}

/* Health dots */
.ops-health-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ops-dot-green {
    background-color: #198754;
    box-shadow: 0 0 4px rgba(25, 135, 84, 0.4);
}

.ops-dot-yellow {
    background-color: #ffc107;
    box-shadow: 0 0 4px rgba(255, 193, 7, 0.4);
}

.ops-dot-red {
    background-color: #dc3545;
    box-shadow: 0 0 4px rgba(220, 53, 69, 0.4);
}

.ops-dot-gray {
    background-color: #adb5bd;
}

/* Volume share bar */
.ops-volume-bar-track {
    flex-grow: 1;
    height: 8px;
    background-color: var(--bs-light);
    border-radius: 4px;
    overflow: hidden;
}

.ops-volume-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0d6efd, #6ea8fe);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.ops-volume-pct {
    font-size: 0.7rem;
    color: var(--bs-secondary);
    min-width: 28px;
    text-align: right;
}

/* Breach detail panel */
.ops-breach-detail {
    background-color: rgba(220, 53, 69, 0.03);
    border-bottom: 1px solid var(--bs-border-color-translucent);
    padding: 0 1rem 0.5rem 1rem;
}

.ops-breach-detail .table {
    font-size: 0.8rem;
}

/* ── Command Center: Golden Signals ────────────────────────── */

.golden-signals {
    border-bottom: 2px solid var(--bs-border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.golden-signals .kpi-card {
    border: none;
    box-shadow: none;
    background: transparent;
}

/* ── Command Center: Incidents Panel ──────────────────────── */

.incidents-panel {
    border-left: 4px solid;
}

.incidents-panel--active {
    border-left-color: #dc3545;
}

.incidents-panel--clear {
    border-left-color: #198754;
    background-color: rgba(25, 135, 84, 0.04);
}

.incidents-header {
    background-color: rgba(220, 53, 69, 0.06);
    border-bottom: 1px solid rgba(220, 53, 69, 0.15);
}

.incidents-table {
    font-size: 0.82rem;
}

.incidents-table th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary);
}

.incident-severity {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    display: inline-block;
}

.incident-severity--s1 {
    background-color: #dc3545;
    color: #fff;
    animation: pulse-severity 2s infinite;
}

.incident-severity--s2 {
    background-color: #fd7e14;
    color: #fff;
}

.incident-severity--s3 {
    background-color: #ffc107;
    color: #000;
}

@keyframes pulse-severity {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ── Command Center: Service Health Cards ─────────────────── */

.svc-card {
    border-left: 4px solid;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.svc-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.svc-card--clickable { cursor: pointer; }

.svc-card--red { border-left-color: #dc3545; }
.svc-card--yellow { border-left-color: #ffc107; }
.svc-card--green { border-left-color: #198754; }
.svc-card--gray { border-left-color: #adb5bd; }

.svc-card-header {
    padding: 0.6rem 0.8rem;
    background: transparent;
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.svc-card-name {
    font-size: 0.9rem;
    color: var(--bs-body-color);
}

.svc-card-name:hover {
    color: var(--bs-primary);
}

.svc-card-code {
    font-size: 0.65rem;
}

.svc-card-body {
    padding: 0.6rem 0.8rem;
}

.svc-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 0.8rem;
}

.svc-metric-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bs-secondary);
    line-height: 1.2;
}

.svc-metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.svc-urgency-dist {
    display: flex;
    gap: 0.5rem;
    font-size: 0.65rem;
    color: var(--bs-secondary);
}

.svc-urgency-tag {
    font-variant-numeric: tabular-nums;
}

.svc-card-footer {
    padding: 0.4rem 0.8rem;
    background-color: rgba(220, 53, 69, 0.04);
    font-size: 0.75rem;
    border-top: 1px solid rgba(220, 53, 69, 0.1);
}

/* ── Spin animation (refresh button) ─────────────────────── */

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin-animation {
    animation: spin 0.8s linear infinite;
}

/* ── Misc ──────────────────────────────────────────────────── */

.breadcrumb {
    font-size: 0.875rem;
}

code {
    font-size: 0.85em;
}

/* ── Skip to content link ─────────────────────────────── */

.skip-to-content {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: #0d6efd;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 0.25rem 0;
}

.skip-to-content:focus {
    left: 0;
}

/* ── Colorblind-safe status indicators ────────────────── */

.cb-safe-green::before {
    content: "\2713 ";  /* checkmark */
    font-weight: 700;
}

.cb-safe-yellow::before {
    content: "\26A0 ";  /* warning triangle */
    font-weight: 700;
}

.cb-safe-red::before {
    content: "\2716 ";  /* X mark */
    font-weight: 700;
}

/* ── Responsive breakpoints ──────────────────────────── */

/* Tablet: stack ops-row into 2-column layout */
@media (max-width: 992px) {
    .ops-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem;
    }
    .ops-row-header {
        grid-template-columns: 1fr 1fr !important;
    }
    /* Hide less important columns on tablet */
    .ops-row > :nth-child(n+6),
    .ops-row-header > :nth-child(n+6) {
        display: none;
    }

    /* KPI cards: 2 per row on tablet */
    .golden-signals .row > [class*="col-md"] {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Service health cards: full width on tablet */
    .svc-card {
        margin-bottom: 0.5rem;
    }

    /* Date range toolbar: wrap on tablet */
    .d-flex.align-items-center.gap-2 input[type="date"] {
        width: 120px !important;
    }

    /* Timeline: prevent overflow */
    .timeline-step {
        overflow-x: hidden;
    }
    .timeline-content {
        min-width: 0;
    }
}

/* Mobile: single column */
@media (max-width: 576px) {
    .ops-row {
        grid-template-columns: 1fr !important;
    }
    .ops-row-header {
        display: none;
    }
    /* Make ops-row items into card-like blocks */
    .ops-row:not(.ops-row-header) {
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    /* KPI cards: single column on mobile */
    .golden-signals .row > [class*="col-md"],
    .row > .col {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Service health grid: full width */
    .row > [class*="col-lg-4"],
    .row > [class*="col-md-6"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* svc-metrics: stack vertically on small screens */
    .svc-metrics {
        grid-template-columns: 1fr 1fr;
    }

    /* Date range toolbar: stack vertically */
    .page > main > .top-row ~ article .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }

    /* Timeline: compact layout */
    .timeline-step {
        overflow-x: hidden;
    }
    .timeline-content {
        min-width: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    .timeline-marker {
        flex-shrink: 0;
    }

    /* Ops scoreboard: remove outer border for card-style rows */
    .ops-scoreboard {
        border: none;
        background: transparent;
    }

    /* Breach detail: full width table scroll */
    .ops-breach-detail {
        overflow-x: auto;
    }
}

/* ── Dark Mode Overrides ─────────────────────────────────────── */

[data-bs-theme="dark"] .ops-scoreboard {
    background: var(--bs-dark);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .ops-row-header {
    background-color: var(--bs-gray-800);
}

[data-bs-theme="dark"] .ops-row:not(.ops-row-header):hover {
    background-color: rgba(255, 255, 255, 0.03);
}

[data-bs-theme="dark"] .ops-volume-bar-track {
    background-color: var(--bs-gray-700);
}

[data-bs-theme="dark"] .golden-signals .kpi-card {
    background: transparent;
}

[data-bs-theme="dark"] .incidents-panel--clear {
    background-color: rgba(25, 135, 84, 0.08);
}

[data-bs-theme="dark"] .incidents-header {
    background-color: rgba(220, 53, 69, 0.12);
}

[data-bs-theme="dark"] .sla-breached {
    background-color: rgba(220, 53, 69, 0.15) !important;
}

[data-bs-theme="dark"] .sla-breached:hover {
    background-color: rgba(220, 53, 69, 0.25) !important;
}

[data-bs-theme="dark"] pre.bg-dark {
    background-color: #000 !important;
}

/* ── Settings Page: vertical tab layout ──────────────────────── */

.settings-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
    min-height: calc(100vh - 160px);
}

.settings-nav {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1rem 0;
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.settings-nav-heading {
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0 1.25rem 0.75rem;
    margin-bottom: 0;
    color: var(--bs-body-color);
}

.settings-nav-section {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bs-secondary-color);
    padding: 0.75rem 1.25rem 0.35rem;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    color: var(--bs-body-color);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
}

.settings-nav-item:hover {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    text-decoration: none;
}

.settings-nav-item.active {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    border-left-color: var(--bs-primary);
    font-weight: 600;
}

.settings-nav-item .badge-sm {
    font-size: 0.6rem;
    padding: 0.15em 0.45em;
}

.settings-content {
    min-width: 0;
}

.settings-header {
    margin-bottom: 1.5rem;
}

.settings-header h5 {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.settings-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.settings-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--bs-body-color);
    display: flex;
    align-items: center;
}

/* Responsive: stack on small screens */
@media (max-width: 768px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-nav {
        position: static;
        max-height: none;
        display: flex;
        flex-wrap: wrap;
        gap: 0;
        padding: 0.5rem;
    }

    .settings-nav-heading {
        width: 100%;
        padding-bottom: 0.5rem;
    }

    .settings-nav-section {
        width: 100%;
        padding: 0.5rem 0.75rem 0.25rem;
    }

    .settings-nav-item {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .settings-nav-item.active {
        border-bottom-color: var(--bs-primary);
        border-left-color: transparent;
    }
}

/* ── Guided Tour ──────────────────────────────────────────────────── */

.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: auto;
}

.tour-spotlight-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.tour-spotlight-ring {
    position: fixed;
    border: 2px solid rgba(99, 179, 237, 0.8);
    border-radius: 8px;
    box-shadow: 0 0 0 4px rgba(99, 179, 237, 0.2),
                0 0 20px rgba(99, 179, 237, 0.3);
    pointer-events: none;
    transition: all 0.3s ease;
    animation: tour-ring-pulse 2s ease-in-out infinite;
}

@keyframes tour-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(99, 179, 237, 0.2), 0 0 20px rgba(99, 179, 237, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(99, 179, 237, 0.3), 0 0 30px rgba(99, 179, 237, 0.4); }
}

.tour-tooltip {
    position: fixed;
    width: 340px;
    background: #1a1d23;
    border: 1px solid rgba(99, 179, 237, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    color: #e2e8f0;
    z-index: 10000;
    pointer-events: auto;
    animation: tour-tooltip-in 0.25s ease-out;
}

@keyframes tour-tooltip-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.tour-tooltip-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tour-tooltip-icon {
    color: #63b3ed;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.tour-tooltip-title {
    font-weight: 600;
    font-size: 0.95rem;
    flex: 1;
}

.tour-tooltip-close {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
    font-size: 0.8rem;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

.tour-tooltip-close:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.1);
}

.tour-tooltip-body {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #a0aec0;
}

.tour-tooltip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem 0.75rem;
}

.tour-tooltip-left-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tour-skip-btn {
    font-size: 0.75rem;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.tour-skip-btn:hover {
    opacity: 1;
}

.tour-step-counter {
    font-size: 0.75rem;
    color: #718096;
}

.tour-tooltip-actions {
    display: flex;
    gap: 0.5rem;
}

.tour-tooltip-actions .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

.tour-tooltip-actions .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.2);
    color: #a0aec0;
}

.tour-tooltip-actions .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    color: #e2e8f0;
}

.tour-progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.tour-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #63b3ed, #4299e1);
    transition: width 0.3s ease;
    border-radius: 0 0 12px 12px;
}

/* Target element highlight (subtle glow for in-viewport elements) */
.tour-target-highlight {
    position: relative;
    z-index: 9998;
}

/* ══════════════════════════════════════════════════════════════
   DARK MODE — polished overrides for Bootstrap 5.3 dark theme
   ══════════════════════════════════════════════════════════════ */

[data-bs-theme="dark"] {
    --bs-body-bg: #0f1117;
    --bs-body-color: #e1e4e8;
    --bs-tertiary-bg: #1a1d27;
    --bs-border-color: #2d3140;
    color-scheme: dark;
}

/* ── Top bar ─────────────────────────────────────────── */
[data-bs-theme="dark"] .top-row {
    background-color: #13151e !important;
    border-bottom-color: #2d3140 !important;
}

/* ── Main content area ───────────────────────────────── */
[data-bs-theme="dark"] .content {
    background-color: #0f1117;
}

[data-bs-theme="dark"] main {
    background-color: #0f1117;
}

/* ── Cards — the main dashboard surface ──────────────── */
[data-bs-theme="dark"] .card {
    background: #161923;
    border-color: #2a2e3d;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

[data-bs-theme="dark"] .card:hover {
    border-color: #3a3f52;
}

[data-bs-theme="dark"] .card-header {
    background: #1c2030;
    border-bottom-color: #2a2e3d;
}

[data-bs-theme="dark"] .card-footer {
    background: #1c2030;
    border-top-color: #2a2e3d;
}

/* ── Capability health cards (Command Center) ────────── */
[data-bs-theme="dark"] .cap-card {
    background: #161923 !important;
    border-color: #2a2e3d !important;
}

/* ── Tables ──────────────────────────────────────────── */
[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-border-color: #2a2e3d;
    --bs-table-striped-bg: rgba(255,255,255,0.02);
    --bs-table-hover-bg: rgba(255,255,255,0.04);
    color: #e1e4e8;
}

[data-bs-theme="dark"] .table thead th {
    background: #1a1d27;
    border-bottom-color: #2a2e3d;
    color: #8b8fa4;
    font-weight: 600;
}

/* ── Form controls ───────────────────────────────────── */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #1a1d27;
    border-color: #2d3140;
    color: #e1e4e8;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #1e2130;
    border-color: #4f8cff;
    box-shadow: 0 0 0 2px rgba(79,140,255,0.2);
}

/* ── Alerts & banners ────────────────────────────────── */
[data-bs-theme="dark"] .alert-danger {
    background: rgba(220,53,69,0.12);
    border-color: rgba(220,53,69,0.25);
    color: #f8a4ad;
}

[data-bs-theme="dark"] .alert-warning {
    background: rgba(255,193,7,0.1);
    border-color: rgba(255,193,7,0.2);
    color: #ffd970;
}

[data-bs-theme="dark"] .alert-info {
    background: rgba(13,202,240,0.1);
    border-color: rgba(13,202,240,0.2);
    color: #7ee8f8;
}

[data-bs-theme="dark"] .alert-success {
    background: rgba(25,135,84,0.12);
    border-color: rgba(25,135,84,0.25);
    color: #7edcab;
}

/* ── Badges ──────────────────────────────────────────── */
[data-bs-theme="dark"] .badge.bg-light {
    background: #2a2e3d !important;
    color: #c0c4d0 !important;
}

[data-bs-theme="dark"] .badge.bg-warning.text-dark,
[data-bs-theme="dark"] .text-dark {
    color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .badge.bg-dark {
    background: #2a2e3d !important;
    color: #c0c4d0 !important;
}

[data-bs-theme="dark"] .badge.bg-info.text-dark {
    color: #e1e4e8 !important;
}

/* ── Table headers (table-light) ─────────────────────── */
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] thead.table-light th,
[data-bs-theme="dark"] .table-light td,
[data-bs-theme="dark"] .table-light th {
    background-color: #1a1d27 !important;
    color: #8b8fa4 !important;
    border-color: #2a2e3d !important;
}

/* ── bg-white → dark equivalent ──────────────────────── */
[data-bs-theme="dark"] .bg-white {
    background-color: #161923 !important;
}

[data-bs-theme="dark"] .bg-body-tertiary,
[data-bs-theme="dark"] .bg-light {
    background-color: #1a1d27 !important;
}

/* ── Card headers with forced bg ─────────────────────── */
[data-bs-theme="dark"] .card-header.bg-white,
[data-bs-theme="dark"] .card-header.bg-light {
    background-color: #1c2030 !important;
    border-bottom-color: #2a2e3d !important;
}

/* ── Progress bar bg-light (pending/initiated segments) ─ */
[data-bs-theme="dark"] .progress-bar.bg-light {
    background-color: #2a2e3d !important;
    color: #8b8fa4 !important;
}

/* ── Pinned drag items ───────────────────────────────── */
[data-bs-theme="dark"] .pinned-drag-item {
    background-color: #1a1d27 !important;
    border-color: #2d3140 !important;
}

/* ── Section card-headers (Preferences, Billing) ─────── */
[data-bs-theme="dark"] .card-header {
    color: #e1e4e8;
}

/* (inline style overrides removed — now using CSS classes) */

/* ── Nav pills / tabs ────────────────────────────────── */
[data-bs-theme="dark"] .nav-tabs {
    border-bottom-color: #2a2e3d;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    background: #161923;
    border-color: #2a2e3d #2a2e3d #161923;
    color: #e1e4e8;
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
    color: #8b8fa4;
}

[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: #2a2e3d;
    color: #c0c4d0;
}

/* ── Dropdown menus ──────────────────────────────────── */
[data-bs-theme="dark"] .dropdown-menu {
    background: #1a1d27;
    border-color: #2d3140;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

[data-bs-theme="dark"] .dropdown-item {
    color: #c0c4d0;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus,
[data-bs-theme="dark"] .dropdown-item:active,
[data-bs-theme="dark"] .dropdown-item.active {
    background: rgba(79,140,255,0.12) !important;
    color: #e1e4e8 !important;
}

/* (duplicate inline override removed — profile-dropdown styled above) */

/* ── Progress bars ───────────────────────────────────── */
[data-bs-theme="dark"] .progress {
    background-color: #1a1d27;
}

/* ── Section labels ──────────────────────────────────── */
[data-bs-theme="dark"] .text-muted {
    color: #6b7080 !important;
}

/* ── List groups ─────────────────────────────────────── */
[data-bs-theme="dark"] .list-group-item {
    background-color: #161923;
    border-color: #2a2e3d;
    color: #e1e4e8;
}

/* ── Modals ──────────────────────────────────────────── */
[data-bs-theme="dark"] .modal-content {
    background: #161923;
    border-color: #2a2e3d;
}

[data-bs-theme="dark"] .modal-header {
    border-bottom-color: #2a2e3d;
}

[data-bs-theme="dark"] .modal-footer {
    border-top-color: #2a2e3d;
}

/* ── Borders ─────────────────────────────────────────── */
[data-bs-theme="dark"] .border {
    border-color: #2a2e3d !important;
}

[data-bs-theme="dark"] .border-bottom {
    border-bottom-color: #2a2e3d !important;
}

[data-bs-theme="dark"] hr {
    border-color: #2a2e3d;
    opacity: 0.5;
}

/* ── Specific dashboard widget overrides ─────────────── */

/* SLA breach / at-risk banner cards */
[data-bs-theme="dark"] .alert-banner-danger {
    background: linear-gradient(135deg, rgba(220,53,69,0.15), rgba(220,53,69,0.08)) !important;
}

[data-bs-theme="dark"] .alert-banner-warning {
    background: linear-gradient(135deg, rgba(255,193,7,0.12), rgba(255,193,7,0.06)) !important;
}

/* Health status dots — make them pop more in dark mode */
[data-bs-theme="dark"] .badge.bg-success { background: #22c55e !important; }
[data-bs-theme="dark"] .badge.bg-warning { background: #eab308 !important; }
[data-bs-theme="dark"] .badge.bg-danger { background: #ef4444 !important; }

/* Golden signal KPI text */
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3, [data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6 {
    color: #f0f2f5;
}

/* Tooltip / popover */
[data-bs-theme="dark"] .tooltip-inner {
    background: #2a2e3d;
}

/* ── app.css hardcoded overrides ─────────────────────── */
[data-bs-theme="dark"] body {
    background-color: #0f1117 !important;
}

[data-bs-theme="dark"] a, [data-bs-theme="dark"] .btn-link {
    color: #63a4ff;
}

[data-bs-theme="dark"] .btn-primary {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

[data-bs-theme="dark"] .btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

[data-bs-theme="dark"] .btn-outline-primary {
    color: #63a4ff;
    border-color: #3b82f6;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
    background: #3b82f6;
    color: #fff;
}

/* ── Toast Notification System ──────────────────────────────── */

.toast-container { position: fixed; bottom: 1rem; right: 1rem; z-index: 1070; display: flex; flex-direction: column-reverse; gap: 0.5rem; max-width: 380px; }
.toast-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-radius: 8px; background: #fff; border: 1px solid #e5e7eb; box-shadow: 0 4px 12px rgba(0,0,0,0.1); animation: toast-slide-in 0.3s ease-out; font-size: 0.875rem; }
.toast-item.success { border-left: 3px solid #198754; }
.toast-item.error { border-left: 3px solid #dc3545; }
.toast-item.warning { border-left: 3px solid #ffc107; }
.toast-item.info { border-left: 3px solid #0dcaf0; }
@keyframes toast-slide-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

[data-bs-theme="dark"] .toast-item { background: #1a1d27; border-color: #2d3140; color: #e1e4e8; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }

/* ── Top Navigation Progress Bar ────────────────────────────── */

.top-progress-bar { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, #4f8cff, #6c5ce7); z-index: 9999; transition: width 0.4s ease; }
.top-progress-bar.complete { transition: width 0.2s ease, opacity 0.3s ease 0.2s; opacity: 0; }

/* ── Command Palette (Ctrl+K / Cmd+K) ──────────────────────── */

.cmd-palette-backdrop { position:fixed;inset:0;background:rgba(0,0,0,0.4);z-index:1080;display:flex;align-items:flex-start;justify-content:center;padding-top:15vh; }
.cmd-palette { width:100%;max-width:560px;background:#fff;border-radius:12px;box-shadow:0 16px 48px rgba(0,0,0,0.2);overflow:hidden;animation:cmd-palette-in 0.15s ease-out; }
.cmd-palette-input { width:100%;padding:16px 20px;border:none;font-size:1rem;outline:none;background:transparent; }
.cmd-palette-results { max-height:360px;overflow-y:auto;border-top:1px solid #e5e7eb; }
.cmd-palette-item { display:flex;align-items:center;gap:12px;padding:10px 20px;cursor:pointer;font-size:0.9rem; }
.cmd-palette-item:hover,.cmd-palette-item.active { background:#f0f4ff; }
.cmd-palette-category { padding:8px 20px;font-size:0.7rem;font-weight:600;text-transform:uppercase;color:#888; }

@keyframes cmd-palette-in {
    from { opacity:0; transform:translateY(-12px) scale(0.98); }
    to { opacity:1; transform:translateY(0) scale(1); }
}

/* Command palette: dark mode */
[data-bs-theme="dark"] .cmd-palette { background:#1a1d27;box-shadow:0 16px 48px rgba(0,0,0,0.6); }
[data-bs-theme="dark"] .cmd-palette-input { color:#e1e4e8; }
[data-bs-theme="dark"] .cmd-palette-results { border-top-color:#2d3140; }
[data-bs-theme="dark"] .cmd-palette-item:hover,[data-bs-theme="dark"] .cmd-palette-item.active { background:rgba(79,140,255,0.1); }
[data-bs-theme="dark"] .cmd-palette-item { color:#e1e4e8; }
[data-bs-theme="dark"] .cmd-palette-item i { color:#8b8fa4 !important; }
[data-bs-theme="dark"] .cmd-palette-item span[style*="background:#f0f4ff"] { background:rgba(79,140,255,0.15) !important;color:#63a4ff !important; }
[data-bs-theme="dark"] .cmd-palette-category { color:#6b7080; }
[data-bs-theme="dark"] .cmd-palette kbd { background:#2a2e3d !important;border-color:#3a3f52 !important;color:#8b8fa4 !important; }
[data-bs-theme="dark"] .cmd-palette-backdrop { background:rgba(0,0,0,0.6); }

/* ── Cmd+K trigger badge in top bar ────────────────────────── */

.cmd-k-trigger { display:flex;align-items:center;gap:6px;background:none;border:1px solid #e0e0e0;border-radius:8px;padding:4px 10px;cursor:pointer;font-size:0.8rem;color:#888;transition:background 0.15s,border-color 0.15s; }
.cmd-k-trigger:hover { background:#f5f7ff;border-color:#c0c8e0;color:#555; }
.cmd-k-trigger kbd { font-size:0.65rem;background:#f0f0f0;border:1px solid #ddd;border-radius:3px;padding:1px 5px;color:#888;font-family:inherit; }

[data-bs-theme="dark"] .cmd-k-trigger { border-color:#444;color:#8b8fa4; }
[data-bs-theme="dark"] .cmd-k-trigger:hover { background:rgba(255,255,255,0.08);border-color:#555; }
[data-bs-theme="dark"] .cmd-k-trigger kbd { background:#2a2e3d;border-color:#3a3f52;color:#8b8fa4; }

/* ── Insight rows ─────────────────────────────────────────── */
.insight-row { transition: background 0.12s; }
.insight-row:hover { background: rgba(79,140,255,0.04); }
.insight-row:last-child { border-bottom: none !important; }
[data-bs-theme="dark"] .insight-row:hover { background: rgba(79,140,255,0.08); }

/* ── Breadcrumb overrides ──────────────────────────────────── */

.breadcrumb { font-size:0.82rem; }
.breadcrumb a { color:#6c757d;text-decoration:none; }
.breadcrumb a:hover { color:#4f8cff;text-decoration:underline; }
[data-bs-theme="dark"] .breadcrumb a { color:#8b8fa4; }
[data-bs-theme="dark"] .breadcrumb a:hover { color:#63a4ff; }
[data-bs-theme="dark"] .breadcrumb-item.active { color:#e1e4e8; }
[data-bs-theme="dark"] .breadcrumb-item+.breadcrumb-item::before { color:#6b7080; }

/* ── Sortable Table Headers ──────────────────────────────── */

.sortable-th { transition: background 0.12s; white-space: nowrap; }
.sortable-th:hover { background: rgba(79,140,255,0.06); }
.sortable-th.active { color: #4f8cff; }
.sort-icon { font-size: 0.7rem; vertical-align: middle; }
.sort-icon-idle { font-size: 0.6rem; opacity: 0.25; vertical-align: middle; }
[data-bs-theme="dark"] .sortable-th:hover { background: rgba(79,140,255,0.1); }

/* ── SparklineSvg ─────────────────────────────────────────── */

.sparkline-svg { display: inline-block; vertical-align: middle; }

/* ── TrendLineChart ───────────────────────────────────────── */

.trend-line-chart { font-family: 'Inter', system-ui, sans-serif; }
.trend-line-chart text { font-family: 'Inter', system-ui, sans-serif; }
[data-bs-theme="dark"] .trend-line-chart { color: #c9d1d9; }

/* ── FunnelChart ──────────────────────────────────────────── */

.funnel-chart { display: flex; flex-direction: column; gap: 0; }
.funnel-step { display: flex; align-items: center; gap: 12px; }
.funnel-bar-wrapper { flex: 1; }
.funnel-bar {
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
    min-width: 40px;
}
.funnel-bar-count { color: #fff; font-weight: 700; font-size: 0.85rem; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.funnel-label { min-width: 160px; display: flex; flex-direction: column; }
.funnel-label-name { font-size: 0.78rem; font-weight: 500; }
.funnel-label-conv { font-size: 0.7rem; font-weight: 600; }
.funnel-arrow { text-align: center; padding: 1px 0; font-size: 0.65rem; margin-left: 40px; }

/* ── PercentileChart ──────────────────────────────────────── */

.percentile-chart { padding: 8px 0; }
.percentile-track {
    position: relative;
    height: 28px;
    border-radius: 4px;
    overflow: visible;
    background: var(--bs-border-color-translucent);
}
.percentile-zone {
    position: absolute;
    top: 0;
    height: 100%;
    opacity: 0.25;
}
.percentile-zone--satisfied { background: #22c55e; border-radius: 4px 0 0 4px; }
.percentile-zone--tolerating { background: #f59e0b; }
.percentile-zone--frustrated { background: #ef4444; border-radius: 0 4px 4px 0; }
.percentile-marker {
    position: absolute;
    top: -4px;
    transform: translateX(-50%);
    text-align: center;
    z-index: 2;
}
.percentile-marker-line {
    width: 2px;
    height: 36px;
    background: #4f8cff;
    margin: 0 auto;
    border-radius: 1px;
}
.percentile-marker-line--warn { background: #f59e0b; }
.percentile-marker-line--danger { background: #ef4444; }
.percentile-marker-label {
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 2px;
    color: inherit;
}
.percentile-threshold {
    position: absolute;
    top: -4px;
    transform: translateX(-50%);
    text-align: center;
    z-index: 1;
}
.percentile-threshold-line {
    width: 2px;
    height: 36px;
    background: #6b7080;
    margin: 0 auto;
    border-radius: 1px;
    border-left: 1px dashed #6b7080;
    opacity: 0.6;
}
.percentile-threshold-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: #6b7080;
    margin-top: 2px;
}
.percentile-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    margin-top: 4px;
    padding: 0 2px;
}

/* ── HeatmapChart ─────────────────────────────────────────── */

.heatmap-chart { overflow-x: auto; }
.heatmap-header, .heatmap-row { display: flex; align-items: center; gap: 2px; }
.heatmap-header { margin-bottom: 2px; }
.heatmap-label-cell { min-width: 120px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.72rem; padding-right: 6px; }
.heatmap-col-label { flex: 1; min-width: 36px; text-align: center; font-size: 0.65rem; color: var(--bs-secondary-color); }
.heatmap-row-label { font-weight: 500; }
.heatmap-cell {
    flex: 1;
    min-width: 36px;
    height: 28px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
    cursor: default;
}
.heatmap-cell:hover { opacity: 0.8; }
.heatmap-cell-text { font-size: 0.62rem; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.heatmap-cell--great { background: #22c55e; }
.heatmap-cell--good { background: #86efac; }
.heatmap-cell--warn { background: #f59e0b; }
.heatmap-cell--bad { background: #ef4444; }
.heatmap-cell--none { background: var(--bs-border-color-translucent); }
.heatmap-cell--good .heatmap-cell-text { color: #166534; text-shadow: none; }
.heatmap-legend { display: flex; gap: 12px; margin-top: 8px; justify-content: flex-end; }
.heatmap-legend-item { font-size: 0.68rem; display: flex; align-items: center; gap: 4px; color: var(--bs-secondary-color); }
.heatmap-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }

/* ── VerticalBarChart ──────────────────────────────────────── */

.vertical-bar-chart { font-family: 'Inter', system-ui, sans-serif; }
.vertical-bar-chart text { font-family: 'Inter', system-ui, sans-serif; }
[data-bs-theme="dark"] .vertical-bar-chart { color: #c9d1d9; }

/* ── Quick View Panel (Case Tracker) ──────────────────────── */

.quick-view-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 1040;
    animation: fadeIn 0.15s;
}
.quick-view-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 90vw;
    background: var(--bs-body-bg); border-left: 1px solid var(--bs-border-color);
    z-index: 1050; overflow-y: auto; animation: slideInRight 0.2s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
.quick-view-header {
    display: flex; align-items: center; padding: 16px; border-bottom: 1px solid var(--bs-border-color);
    position: sticky; top: 0; background: var(--bs-body-bg); z-index: 1;
}

/* ── Case status badges ──────────────────────────────────── */

.case-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.case-status-dot--completed { background: #22c55e; }
.case-status-dot--in-progress { background: #f59e0b; }
.case-status-dot--breached { background: #ef4444; }
.case-status-dot--pending { background: #6b7080; }

/* ── Pagination ───────────────────────────────────────────── */

.pagination-info { font-size: 0.78rem; color: var(--bs-secondary-color); }
.pagination-compact .page-link { padding: 0.2rem 0.5rem; font-size: 0.78rem; }

/* ── Template preview dark mode readability ──────────────── */

[data-bs-theme="dark"] .dashboard-preview .card,
[data-bs-theme="dark"] .dashboard-preview .preview-cap-card {
    background: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    border-color: var(--bs-border-color) !important;
}
[data-bs-theme="dark"] .dashboard-preview .preview-cap-card .text-dark {
    color: var(--bs-body-color) !important;
}

/* ── Template Gallery nav border spacing ─────────────────── */

.sidebar .nav-scrollable .nav-item:first-child {
    margin-top: 0.25rem;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — hamburger menu, layout, tables, cards
   ══════════════════════════════════════════════════════════════ */

/* ── Hamburger toggle button (visible on mobile only) ─────── */

.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: none;
    color: #555;
    cursor: pointer;
    font-size: 1.15rem;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.sidebar-toggle:hover {
    background: #f5f7ff;
    border-color: #c0c8e0;
}

[data-bs-theme="dark"] .sidebar-toggle {
    border-color: #444;
    color: #c0c4d0;
}

[data-bs-theme="dark"] .sidebar-toggle:hover {
    background: rgba(255,255,255,0.08);
    border-color: #555;
}

/* ── Mobile sidebar overlay backdrop ──────────────────────── */

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1039;
    animation: fadeIn 0.2s ease-out;
}

.sidebar-backdrop.show {
    display: block;
}

/* ── Table responsive wrapper for mobile ──────────────────── */

.table-responsive-mobile {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Tablet breakpoint (max-width: 991.98px) ──────────────── */

@media (max-width: 991.98px) {
    /* KPI cards: 2 per row */
    .row > [class*="col-lg"] {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Date range toolbar: allow wrapping */
    .d-flex.align-items-center.gap-2 {
        flex-wrap: wrap;
    }

    /* Command palette trigger: compact */
    .cmd-k-trigger kbd {
        display: none;
    }

    /* Profile display name: hide on tablet to save space */
    .profile-display-name {
        max-width: 100px;
    }

    /* Org selector name: truncate tighter */
    .org-selector-name {
        max-width: 120px;
    }

    /* Settings layout: already handled at 768px */

    /* Quick view panel: narrower */
    .quick-view-panel {
        width: 340px;
    }

    /* Heatmap: scroll */
    .heatmap-chart {
        overflow-x: auto;
    }

    /* Funnel labels: narrower */
    .funnel-label {
        min-width: 100px;
    }
}

/* ── Mobile breakpoint (max-width: 767.98px) ──────────────── */

@media (max-width: 767.98px) {
    /* Show hamburger toggle */
    .sidebar-toggle {
        display: flex;
    }

    /* KPI cards: single column */
    .row > [class*="col-md"],
    .row > [class*="col-lg"],
    .row > [class*="col-sm-6"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* KPI card title: slightly smaller */
    .kpi-card .card-title {
        font-size: 1.6rem;
    }

    /* Top row: tighter padding */
    .page > main > .top-row {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* Content area: less horizontal padding */
    .page > main > article.content {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* Profile: hide display name, role badge */
    .profile-display-name {
        display: none;
    }

    .profile-role-badge {
        display: none;
    }

    .profile-chevron {
        display: none;
    }

    /* Org selector: compact */
    .org-selector-name {
        max-width: 100px;
        font-size: 0.8rem;
    }

    .org-selector-tier {
        display: none;
    }

    /* Command palette trigger: icon only */
    .cmd-k-trigger kbd {
        display: none;
    }

    .cmd-k-trigger {
        padding: 4px 8px;
    }

    /* Command palette dialog: nearly full width */
    .cmd-palette {
        max-width: calc(100vw - 2rem);
        margin: 0 1rem;
    }

    .cmd-palette-backdrop {
        padding-top: 8vh;
    }

    /* Date range toolbar: stack vertically */
    .d-flex.justify-content-between.align-items-center.mb-3,
    .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    /* Date inputs: full width on mobile */
    input[type="date"] {
        width: 100% !important;
        min-width: 0;
    }

    /* Tables: horizontal scroll */
    .table-responsive-mobile,
    .card-body > .table-responsive,
    .card > .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }

    /* Tables inside cards: allow overflow */
    .card-body {
        overflow-x: auto;
    }

    /* Quick view panel: full width */
    .quick-view-panel {
        width: 100%;
        max-width: 100vw;
    }

    /* Tour tooltip: narrower */
    .tour-tooltip {
        width: 280px;
    }

    /* KPI info tooltip: narrower */
    .kpi-info-tooltip {
        width: 200px;
    }

    /* Heatmap: smaller cells */
    .heatmap-label-cell {
        min-width: 80px;
        max-width: 80px;
        font-size: 0.65rem;
    }

    .heatmap-cell {
        min-width: 28px;
        height: 24px;
    }

    /* Funnel chart: stack labels */
    .funnel-label {
        min-width: 80px;
    }

    .funnel-bar {
        height: 26px;
    }

    /* Percentile chart: smaller markers */
    .percentile-marker-label {
        font-size: 0.58rem;
    }

    /* Profile dropdown: right-aligned stays in viewport */
    .profile-dropdown {
        right: -8px;
        min-width: 200px;
    }

    /* Org selector dropdown: constrain width */
    .org-selector-dropdown {
        min-width: 240px;
        max-width: calc(100vw - 2rem);
    }

    /* Toast container: full width at bottom */
    .toast-container {
        left: 0.5rem;
        right: 0.5rem;
        max-width: none;
    }

    /* Breadcrumb: smaller */
    .breadcrumb {
        font-size: 0.75rem;
    }

    /* Settings layout on mobile: already handled at 768px */

    /* SVG charts: ensure they scale */
    svg[viewBox] {
        max-width: 100%;
        height: auto;
    }

    /* Ops scoreboard: full card layout handled by existing 576px query */

    /* Pagination: compact */
    .pagination-compact .page-link {
        padding: 0.15rem 0.35rem;
        font-size: 0.72rem;
    }

    .pagination-info {
        font-size: 0.7rem;
    }
}

/* ── Extra small screens (max-width: 480px) ───────────────── */

@media (max-width: 480px) {
    /* Org selector: very compact */
    .org-selector-name {
        max-width: 70px;
        font-size: 0.75rem;
    }

    .org-selector-icon {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
    }

    .org-selector-trigger {
        padding: 3px 8px 3px 4px;
    }

    /* Top row: minimal padding */
    .page > main > .top-row {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        gap: 4px;
    }

    /* Content area: minimal padding */
    .page > main > article.content {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* KPI card title: even smaller */
    .kpi-card .card-title {
        font-size: 1.35rem;
    }

    .kpi-card .card-subtitle {
        font-size: 0.7rem;
    }

    /* Tables: allow tighter view */
    .table {
        min-width: 500px;
        font-size: 0.78rem;
    }
}

/* ── Prediction probability bars ─────────────────────────── */
.prediction-prob .progress {
    background: rgba(255,255,255,0.1);
}

[data-bs-theme="dark"] .prediction-prob .progress {
    background: rgba(255,255,255,0.08);
}

/* ── Ask O: Floating Action Button ─────────────────────────── */

.ask-o-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 1050;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #4f8cff 0%, #6c5ce7 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(79, 140, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: ask-o-pulse 2.5s ease-in-out infinite;
}

.ask-o-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(79, 140, 255, 0.55);
}

.ask-o-fab--active {
    animation: none;
    transform: scale(0.95);
    background: linear-gradient(135deg, #6c5ce7 0%, #4f8cff 100%);
}

.ask-o-fab-icon {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    line-height: 1;
}

@keyframes ask-o-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(79, 140, 255, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(79, 140, 255, 0.7), 0 0 0 8px rgba(79, 140, 255, 0.1); }
}

/* ── Ask O: Backdrop ───────────────────────────────────────── */

.ask-o-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1051;
    background: rgba(0, 0, 0, 0.25);
    animation: ask-o-fade-in 0.2s ease;
}

@keyframes ask-o-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Ask O: Panel ──────────────────────────────────────────── */

.ask-o-panel {
    position: fixed;
    bottom: 96px;
    right: 28px;
    z-index: 1052;
    width: 420px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ask-o-slide-up 0.25s ease;
}

@keyframes ask-o-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

[data-bs-theme="dark"] .ask-o-panel {
    background: #1e2130;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ── Ask O: Header ─────────────────────────────────────────── */

.ask-o-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
}

[data-bs-theme="dark"] .ask-o-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.ask-o-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1rem;
    color: #1a1d2e;
}

[data-bs-theme="dark"] .ask-o-title {
    color: #e4e6ef;
}

.ask-o-title-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #4f8cff 0%, #6c5ce7 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ask-o-close {
    background: none;
    border: none;
    color: #6b7b96;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.ask-o-close:hover {
    background: #f1f3f5;
    color: #1a1d2e;
}

[data-bs-theme="dark"] .ask-o-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e4e6ef;
}

/* ── Ask O: Messages ───────────────────────────────────────── */

.ask-o-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 300px;
    max-height: calc(100vh - 320px);
}

.ask-o-message {
    max-width: 100%;
}

.ask-o-message--user .ask-o-message-content {
    background: linear-gradient(135deg, #4f8cff 0%, #6c5ce7 100%);
    color: #fff;
    padding: 10px 14px;
    border-radius: 14px 14px 4px 14px;
    margin-left: auto;
    max-width: 85%;
    width: fit-content;
    font-size: 0.9rem;
    word-break: break-word;
}

.ask-o-message--assistant .ask-o-message-content {
    background: #f4f6f8;
    color: #1a1d2e;
    padding: 12px 16px;
    border-radius: 14px 14px 14px 4px;
    font-size: 0.875rem;
    line-height: 1.55;
    word-break: break-word;
}

[data-bs-theme="dark"] .ask-o-message--assistant .ask-o-message-content {
    background: rgba(255, 255, 255, 0.06);
    color: #e4e6ef;
}

.ask-o-message--assistant .ask-o-message-content strong {
    color: #4f8cff;
}

[data-bs-theme="dark"] .ask-o-message--assistant .ask-o-message-content strong {
    color: #7fadff;
}

.ask-o-message--assistant .ask-o-message-content ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.ask-o-message--assistant .ask-o-message-content li {
    margin-bottom: 3px;
}

/* ── Ask O: Data Table ─────────────────────────────────────── */

.ask-o-table-wrap {
    margin-top: 10px;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

[data-bs-theme="dark"] .ask-o-table-wrap {
    border-color: rgba(255, 255, 255, 0.08);
}

.ask-o-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.ask-o-table th {
    background: #f8f9fa;
    padding: 7px 10px;
    text-align: left;
    font-weight: 600;
    color: #6b7b96;
    white-space: nowrap;
    border-bottom: 1px solid #e9ecef;
}

[data-bs-theme="dark"] .ask-o-table th {
    background: rgba(255, 255, 255, 0.04);
    color: #8a94a6;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.ask-o-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f3f5;
    color: #1a1d2e;
}

[data-bs-theme="dark"] .ask-o-table td {
    border-bottom-color: rgba(255, 255, 255, 0.04);
    color: #e4e6ef;
}

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

/* ── Ask O: Confidence Warning ─────────────────────────────── */

.ask-o-confidence-warn {
    margin-top: 8px;
    padding: 6px 10px;
    background: #fff8e1;
    color: #b17a00;
    border-radius: 8px;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

[data-bs-theme="dark"] .ask-o-confidence-warn {
    background: rgba(255, 193, 7, 0.12);
    color: #ffc107;
}

/* ── Ask O: Suggestions ────────────────────────────────────── */

.ask-o-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.ask-o-suggestion {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid #dde1e6;
    background: #fff;
    color: #4f8cff;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.ask-o-suggestion:hover {
    background: #4f8cff;
    color: #fff;
    border-color: #4f8cff;
}

[data-bs-theme="dark"] .ask-o-suggestion {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #7fadff;
}

[data-bs-theme="dark"] .ask-o-suggestion:hover {
    background: #4f8cff;
    color: #fff;
    border-color: #4f8cff;
}

/* ── Ask O: Welcome Screen ─────────────────────────────────── */

.ask-o-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    flex: 1;
}

.ask-o-welcome-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #4f8cff 0%, #6c5ce7 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.ask-o-welcome-text {
    color: #6b7b96;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.ask-o-welcome-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

/* ── Ask O: Typing Indicator ───────────────────────────────── */

.ask-o-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #f4f6f8;
    border-radius: 14px 14px 14px 4px;
    width: fit-content;
}

[data-bs-theme="dark"] .ask-o-typing {
    background: rgba(255, 255, 255, 0.06);
}

.ask-o-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6b7b96;
    animation: ask-o-typing-bounce 1.2s infinite;
}

.ask-o-typing span:nth-child(2) { animation-delay: 0.15s; }
.ask-o-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ask-o-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* ── Ask O: Input Area ─────────────────────────────────────── */

.ask-o-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e9ecef;
}

[data-bs-theme="dark"] .ask-o-input-area {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.ask-o-input {
    flex: 1;
    border: 1px solid #dde1e6;
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 0.875rem;
    background: #f8f9fa;
    color: #1a1d2e;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ask-o-input:focus {
    border-color: #4f8cff;
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.12);
    background: #fff;
}

[data-bs-theme="dark"] .ask-o-input {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e4e6ef;
}

[data-bs-theme="dark"] .ask-o-input:focus {
    border-color: #4f8cff;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.15);
}

.ask-o-input::placeholder {
    color: #9ca3af;
}

.ask-o-send {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #4f8cff 0%, #6c5ce7 100%);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.ask-o-send:hover:not(:disabled) {
    transform: scale(1.05);
}

.ask-o-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Ask O: Mobile Responsive ──────────────────────────────── */

@media (max-width: 576px) {
    .ask-o-panel {
        bottom: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
    }

    .ask-o-fab {
        bottom: 18px;
        right: 18px;
        width: 50px;
        height: 50px;
    }

    .ask-o-backdrop {
        display: block;
    }
}
