/* component layer: consumes the design tokens from /tokens.css (the template design system) */

*, *::before, *::after{
    box-sizing: border-box;
}

html{
    height: 100%;
}
body{
    min-height: 100%;
    margin: 0;

    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* page shell: header row, main view (router outlet), footer row */
main{
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ---- header (persistent app-shell chrome) ---- */
header{
    flex: none;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    height: 58px;
    padding: 0 var(--space-lg);
    background-color: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand{
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.mark{
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: var(--r-sm);
    background-color: var(--navy);
}
.mark i{
    width: 9px;
    height: 9px;
    display: block;
    border-radius: 2px;
    background-color: var(--on-navy);
    transform: rotate(45deg);
}
.wordmark{
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
    color: var(--ink);
}

/* global HTTP progress indicator — a fixed indeterminate progress bar pinned to
   the top edge; the host is display:contents so its empty idle state is inert */
b-progress-indicator{
    display: contents;
}
.activity-bar{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 1000;
    overflow: hidden;
    background-color: var(--navy-tint);
}
.activity-bar::before{
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    background-color: var(--navy);
    animation: activity-slide 1.1s ease-in-out infinite;
}
@keyframes activity-slide{
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}
@media (prefers-reduced-motion: reduce){
    .activity-bar::before{
        animation: none;
        width: 100%;
        opacity: 0.6;
    }
}

/* context-chip and jobs-tray placeholders share the pill shape */
.ctx, .jbtn{
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background-color: var(--surface);
    color: var(--ink);
    font-size: 13px;
}
.ctx .car{
    color: var(--ink-3);
    font-size: 11px;
}
.jdot{
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-bg);
}
.avatar{
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background-color: var(--navy-tint);
    color: var(--navy);
    font-weight: 600;
    font-size: 12px;
    font-family: var(--font-mono);
    border: 1px solid transparent;
    padding: 0;
    cursor: pointer;
}
button.avatar:hover,
button.avatar:focus-visible{
    border-color: var(--navy);
}

/* ---- avatar dropdown (native Popover API) ---- */
.menu{
    position: fixed;
    inset: auto;
    top: 52px;
    right: var(--space-lg);
    margin: 0;
    width: 250px;
    padding: 6px;
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: 0 18px 44px rgba(15, 26, 43, 0.18);
}
.menu:popover-open{
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.menu-h{
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 9px 11px;
}
.menu-id{
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.menu-name{
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
}
.menu-email{
    font-size: 12px;
    color: var(--ink-3);
    font-family: var(--font-mono);
}
hr.divide{
    width: 100%;
    border: none;
    border-top: 1px solid var(--line);
    margin: 4px 0;
}
.menu-item{
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 11px;
    border: none;
    background: none;
    border-radius: var(--r-sm);
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}
.menu-item:hover{
    background-color: var(--surface-2);
}
.menu-badge{
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--amber);
    background-color: var(--amber-bg);
    padding: 2px 7px;
    border-radius: 999px;
}

/* spacer pushes the right-hand cluster to the trailing edge */
.hdr-sp{
    flex: 1;
}

/* language switching now lives in the avatar menu (b-user-identity), not the header */

/* ---- main content: the router outlet ---- */
.view{
    flex: 1;
    overflow: auto;
    padding: var(--space-lg);
}

/* ---- footer ---- */
footer{
    flex: none;
    padding: var(--space-md) var(--space-lg);
    font-size: 13px;
    color: var(--ink-3);
    background-color: var(--surface);
    border-top: 1px solid var(--line);
}

/* ---- team: teams landing grid ---- */
.team-title{
    margin: 0 0 var(--space-lg);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.team-grid{
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.team-card{
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-md);
    text-align: left;
    font: inherit;
    color: var(--ink);
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    cursor: pointer;
}
.team-card:hover{
    border-color: var(--navy);
    background-color: var(--navy-tint-2);
}
.team-card-name{
    font-weight: 600;
    font-size: 15px;
}
.team-card-role{
    font-size: 13px;
    color: var(--ink-2);
}
.team-empty{
    padding: var(--space-lg);
    color: var(--ink-2);
    background-color: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--r);
}
.team-error{
    padding: var(--space-md) var(--space-lg);
    color: var(--red);
    background-color: var(--red-bg);
    border: 1px solid var(--red-line);
    border-radius: var(--r);
}

a{
    color: var(--navy);
    text-decoration: none;
}
a:hover{
    color: var(--navy-600);
}

:focus-visible{
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}
