/* MyDataTheme - site header. Loaded on every route.

   White bar, one strong bottom rule, and an underline as the active/hover
   marker rather than a tinted pill: the header should read as a product bar,
   not as a marketing nav. */

.md-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--md-surface);
    border-bottom: 2px solid var(--md-primary-dark);
}

.md-header__inner {
    max-width: var(--md-max-width);
    margin: 0 auto;
    padding: 0 20px;
    min-height: var(--md-header-offset);
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Brand: a solid blue mark plus the wordmark. The mark is what makes the
   header identifiable at a glance and on a narrow viewport. */
.md-logo { display: inline-flex; align-items: center; gap: 10px; }
.md-logo:hover { text-decoration: none; }
.md-logo__mark {
    width: 34px; height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    background: var(--md-primary);
    color: #fff;
    border-radius: var(--md-radius-md);
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
}
.md-logo__text { display: inline-flex; flex-direction: column; line-height: 1.2; }
.md-logo__name { font-size: 19px; font-weight: 800; color: var(--md-primary-dark); letter-spacing: -.02em; }
.md-logo__tagline { font-size: 11.5px; color: var(--md-muted); }

.md-header__nav { display: flex; gap: 4px; margin-left: auto; align-self: stretch; align-items: stretch; }
.md-header__nav a {
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--md-ink-soft);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}
.md-header__nav a:hover { color: var(--md-primary); border-bottom-color: var(--md-primary-border); text-decoration: none; }
.md-header__nav a[aria-current="page"] { color: var(--md-primary-dark); border-bottom-color: var(--md-primary); }

.md-header__actions { display: flex; align-items: center; gap: 8px; }
/* Sign-out is a POST form, so it sits in the actions row as a flex item with no form chrome of its own. */
.md-header__signout { display: flex; margin: 0; }

.md-menu-toggle {
    display: none;
    margin-left: auto;
    width: 42px; height: 42px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: 1px solid var(--md-border-strong);
    border-radius: var(--md-radius-md);
    cursor: pointer;
}
.md-menu-toggle span { display: block; width: 18px; height: 2px; background: var(--md-ink); }

@media (max-width: 960px) {
    .md-menu-toggle { display: flex; }
    .md-header__panel {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 16px;
        padding: 12px 0 20px;
        border-top: 1px solid var(--md-border);
    }
    .md-header__panel[data-md-menu-open] { display: flex; }
    .md-header__inner { flex-wrap: wrap; padding-block: 12px; }
    /* Stacked nav: the marker moves to the leading edge, where a vertical list
       can actually show it. */
    .md-header__nav { flex-direction: column; margin-left: 0; gap: 0; }
    .md-header__nav a {
        padding: 10px 12px;
        margin-bottom: 0;
        border-bottom: 0;
        border-left: 3px solid transparent;
    }
    .md-header__nav a:hover { border-left-color: var(--md-primary-border); }
    .md-header__nav a[aria-current="page"] { border-left-color: var(--md-primary); background: var(--md-primary-soft); }
    .md-header__actions { flex-direction: column; align-items: stretch; }
    .md-header__actions .md-btn { width: 100%; }
}

@media (min-width: 961px) {
    .md-header__panel { display: contents; }
}
