/* ============================================================================
   Global header company context — platform badge, company badge, "change" link,
   and the header search box's sizing.

   Moved out of dashboard.html's inline <style> when the header context became
   shared: the rail navigates between the dashboard, Payroll, Reports and
   Settings, and the header must not empty out on the way. Linked from base.html
   so every page that renders components/header_context.html has the styles.
   ========================================================================== */

/* Platform badge — sits next to the booxie logo in base.html nav-left. */
.nav-platform-badge {
    display: inline-flex; align-items: center; gap: 6px;
    margin-left: 0.875rem;
    padding: 4px 11px;
    border-radius: 999px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    line-height: 1.2;
    border: 1px solid transparent;
    transition: filter 0.15s ease, transform 0.15s ease;
}
.nav-platform-badge:hover { filter: brightness(0.96); transform: translateY(-1px); }
.nav-platform-badge i { font-size: 0.85rem; }
.nav-platform-badge--qbd { background: #eef4fd; color: #1d4ea8; border-color: #b9d2f5; }
.nav-platform-badge--qbo { background: #ecf7f0; color: #1f8048; border-color: #b8dcc4; }
.nav-platform-badge--qbe { background: #fbf3e8; color: #9a6a23; border-color: #e5cfae; }

/* Company badge — sits just to the right of the platform badge. Since
   2026-08-03 it IS the switch-company control (an <a>, the old 'change' link
   removed); hover affordance mirrors the platform badge. Name is truncated
   server-side at 20 chars — the max-width ellipsis stays as a backstop. */
.nav-company-badge {
    display: inline-flex; align-items: center; gap: 6px;
    margin-left: 0.5rem;
    padding: 4px 11px;
    border-radius: 999px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    background: #f0faf3;
    color: #2e7d4f;
    border: 1px solid #cce8d4;
    max-width: 200px;
    text-decoration: none;
    transition: filter 0.15s ease, transform 0.15s ease;
}
.nav-company-badge:hover { filter: brightness(0.96); transform: translateY(-1px); }
.nav-company-badge > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-company-dot {
    flex: 0 0 auto;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #34c759;
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.18);
}

/* Header search box sizing (the input's own styling is dashboard_search.css).
   Collapsed by default since 2026-08-03: only the magnifier button shows —
   the first click expands (see components/header_search.html). */
.nav-right .dash-header-search { width: 13rem; flex: 0 0 auto; }
.nav-right .dash-header-search .dash-tabbar-search-input { height: 34px; }
.nav-right .dash-header-search.is-collapsed { width: auto; min-width: 0; }
.dash-header-search.is-collapsed .dash-tabbar-search-input { display: none; }
.dash-header-search.is-collapsed { border-color: transparent; background: none; box-shadow: none; }
/* dashboard_search.css keeps the magnifier at width:0/opacity:0 until the box
   is focused — when collapsed the magnifier IS the control, so force it on */
.dash-header-search.is-collapsed .dash-tabbar-search-btn {
    width: 34px; height: 34px; opacity: 1; pointer-events: auto; cursor: pointer;
}
/* resting magnifier reads lighter (like the bell); darkens on hover */
.dash-header-search.is-collapsed .dash-tabbar-search-btn i { color: #9aa8b5; }
.dash-header-search.is-collapsed .dash-tabbar-search-btn:hover i { color: #2563eb; }
.nav-platform-badge--qbwc { background: #f3eefb; color: #6a3fb5; border-color: #d5c4ef; }
