/* JennSentry Compact Header — Phase D1 (nav v2)
 * Sits above .dashboard-main, to the right of the sidebar.
 * Uses only design tokens from sentry.css :root.
 *
 * Layout: The sidebar is position:fixed left with 100vh height.
 * The compact header uses margin-left to clear the sidebar and
 * position:sticky to stay visible during scroll.  This avoids
 * any changes to the sidebar's own positioning.
 */

:root {
    --compact-header-height: 48px;
}

/* ── Compact header shell ─────────────────────────────────── */

.compact-header {
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--compact-header-height);
    padding: 0 20px;
    margin-left: var(--sidebar-width);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: margin-left var(--transition-normal);
    flex-shrink: 0;
}

/* Track sidebar collapse — shrink offset to match rail width */
body.has-sidebar:has(.sidebar[data-collapsed="true"]) .compact-header {
    margin-left: var(--sidebar-collapsed-width);
}

/* ── Logo ─────────────────────────────────────────────────── */

.compact-header-logo {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

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

.compact-header #breadcrumb {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 auto;
}

/* ── Right-side controls ──────────────────────────────────── */

.compact-header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Auto-refresh select — styled for surface background (not primary) */
.compact-header .compact-header-select {
    padding: 4px 24px 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 12px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2378716C'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

.compact-header .compact-header-select:hover {
    background-color: var(--border);
}

.compact-header .compact-header-select:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Auto-refresh dot */
.compact-header .auto-refresh-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-dot 2s ease-in-out infinite;
}

/* Theme toggle button */
.compact-header .compact-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 0;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.compact-header .compact-theme-toggle:hover {
    background: var(--border);
    color: var(--text);
}

/* Version display */
.compact-header .compact-version {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Responsive: icon-rail breakpoint ─────────────────────── */

@media (max-width: 1199px) {
    .compact-header {
        margin-left: var(--sidebar-collapsed-width);
    }
}

/* ── Responsive: mobile (sidebar off-canvas) ──────────────── */

@media (max-width: 767px) {
    .compact-header {
        margin-left: 0;
    }
}

/* ── Teams embedded: hide compact header too ──────────────── */

body.teams-embedded .compact-header {
    display: none;
}
