/* PawDNS page chrome shared by all pages, including the Swagger UI page (which must not get the
 * generic element styles of pawdns.css): token aliases, orange top bar, theme switcher, user menu.
 * Colours: only var(--token)s from partials/theme-head (config pawdns.branding.theme).
 */
:root {
    /* Short names used by the views (style="color:var(--crit)" etc.). */
    --fg: var(--text); --bg: var(--background); --muted: var(--text-muted); --link: var(--primary-text);
    --ok: var(--success-text); --warn: var(--warning-text); --crit: var(--error-text); --accent: var(--topbar);
    --input: var(--card);
    --radius: .5rem; --topbar-h: 3.5rem; --sidebar-w: 15.5rem;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* ---- top bar (orange, TenantOS style) ---- */
.topbar { box-sizing: border-box; position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: .75rem;
          padding: 0 1rem; background: var(--topbar); color: var(--on-topbar); }
.topbar a, .topbar button { color: var(--on-topbar); }
.topbar .brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.topbar .brand:hover { text-decoration: none; }
.topbar .brand { min-width: 0; overflow: hidden; white-space: nowrap; } .topbar .brand > span { overflow: hidden; text-overflow: ellipsis; }
.topbar { padding-left: 0; }
/* Logo plate top-left: the PawHost logo is orange + white (TenantOS "darklogo"), so it sits on the
   sidebar colour above the sidebar, as TenantOS does with navbar_logo_always_dark. */
.brand-plate { box-sizing: border-box; align-self: stretch; flex: 0 0 var(--sidebar-w); width: var(--sidebar-w); display: flex; align-items: center;
               padding: 0 1.1rem; background: var(--sidebar); }
.brand-plate:hover { text-decoration: none; }
.brand-logo { display: block; max-height: 32px; max-width: 100%; width: auto; height: auto; }
.brand-logo-text { color: var(--sidebar-header); font-weight: 700; }
.logo-on-dark { display: none; }
:root[data-theme="dark"] .logo-on-light { display: none; } :root[data-theme="dark"] .logo-on-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .logo-on-light { display: none; } :root:not([data-theme]) .logo-on-dark { display: block; } }
.card-logo { display: flex; justify-content: center; margin-bottom: 1rem; } .card-logo:empty { display: none; }
.card-logo .brand-logo { max-height: 64px; }
@media (max-width: 900px) { .brand-plate { flex: 0 0 auto; width: auto; padding: 0 .7rem; } .brand-plate .brand-logo { max-height: 26px; } }
.topbar .brand-sub { font-weight: 400; font-size: .85rem; opacity: .85; }
.topbar .spacer { flex: 1; }
.topbar form { margin: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: .4rem;
            background: transparent; color: inherit; cursor: pointer; }
.icon-btn .icon { width: 22px; height: 22px; flex: none; }
.icon-btn:hover { background: color-mix(in srgb, var(--on-topbar) 12%, transparent); }
.nav-toggle { display: none; }

/* theme switcher: sun / moon / monitor (inline SVG) */
.theme-switch { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: color-mix(in srgb, var(--on-topbar) 12%, transparent); }
.theme-switch button { border: 0; background: transparent; border-radius: 999px; padding: .2rem .45rem; font-size: .95rem; line-height: 1.2;
                       cursor: pointer; color: var(--on-topbar); }
.theme-switch button { display: inline-grid; place-items: center; } .theme-switch .icon { width: 16px; height: 16px; flex: none; display: block; }
.theme-switch button:hover { background: color-mix(in srgb, var(--on-topbar) 14%, transparent); }
.theme-switch button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 25%, transparent); }

/* user menu */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .3rem .5rem; border-radius: .4rem; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: color-mix(in srgb, var(--on-topbar) 12%, transparent); }
.user-menu .avatar { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; font-weight: 700; font-size: .85rem;
                     background: var(--sidebar); color: var(--sidebar-text-active); }
.user-menu .who { font-size: .85rem; line-height: 1.15; text-align: left; }
.user-menu .who small { display: block; opacity: .85; font-size: .75rem; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + .4rem); min-width: 14rem; padding: .4rem; border: 1px solid var(--border);
                   border-radius: var(--radius); background: var(--card); color: var(--text); box-shadow: 0 8px 24px color-mix(in srgb, var(--text) 18%, transparent); }
.user-menu .menu a, .user-menu .menu button { display: block; width: 100%; padding: .45rem .6rem; border: 0; border-radius: .35rem; background: none;
                                              color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--info-box); text-decoration: none; }
.user-menu .menu .menu-head { padding: .35rem .6rem .5rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; font-size: .85rem; }

/* Language switch (DESIGN.md §14): same pill as the theme switch. */
.locale-switch { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: color-mix(in srgb, var(--on-topbar) 12%, transparent); margin-right: .4rem; }
.locale-switch button { border: 0; background: transparent; color: var(--on-topbar); border-radius: 999px; padding: .2rem .5rem; font-size: .75rem; font-weight: 700; line-height: 1.4; cursor: pointer; }
.locale-switch button:hover { background: color-mix(in srgb, var(--on-topbar) 14%, transparent); }
.locale-switch button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 25%, transparent); }
.user-menu .menu .locale-switch { display: flex; margin: .2rem .6rem .3rem; background: var(--info-box); width: max-content; }
.user-menu .menu .locale-switch button { display: inline-block; width: auto; padding: .2rem .6rem; color: var(--text); }
.user-menu .menu .locale-switch button[aria-pressed="true"] { background: var(--card); }

/* phones (390px): the top bar must not overflow (logo plate, menu, name, theme switch, avatar) */
@media (max-width: 480px) {
    .topbar { gap: .4rem; } .brand-plate { padding: 0 .5rem; } .topbar .brand { display: none; } .topbar .spacer { margin-left: auto; }
    .theme-switch button { padding: .15rem .3rem; } .user-menu > summary { padding: .3rem .25rem; }
}
