/* ─── Google Fonts ──────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

/* ─── Brand + Status Tokens ─────────────────────────────────────────────── */
:root {
    /* Vincit brand palette */
    --brand-navy:     #122945;
    --brand-raven:    #133156;
    --brand-vector:   #005D83;
    --brand-teal:     #008F9A;
    --brand-signal:   #0DB386;
    --brand-puremint: #7FCBAE;
    --brand-clarity:  #6ECBD4;
    --brand-gold:     #DBA328;
    --brand-yellow:   #E7D31B;
    --brand-zee:      #007C54;

    /* Status accent colors */
    --status-atrisk:     #BE3333;
    --status-inflight:   #005D83;
    --status-upnext:     #008F9A;
    --status-ongoing:    #0DB386;
    --status-shaping:    #DBA328;
    --status-futureflow: #6ECBD4;
    --status-shipped:    #8EA4BC;

    /* UI tokens */
    --color-bg:          #EEF2F7;
    --color-surface:     #FFFFFF;
    --color-nav:         #122945;
    --color-nav-hover:   #133156;
    --color-border:      rgba(18, 41, 69, 0.09);
    --color-border-strong: rgba(18, 41, 69, 0.18);
    --color-text:        #122945;
    --color-text-sub:    #4A6680;
    --color-text-muted:  #7A96B0;
    --color-link:        #005D83;

    /* Shadows */
    --shadow-card: 0 1px 3px rgba(18, 41, 69, 0.06), 0 4px 14px rgba(18, 41, 69, 0.05);
    --shadow-nav:  0 1px 0 rgba(0, 0, 0, 0.15);

    /* Radii */
    --radius-lg: 1rem;
    --radius-md: 0.625rem;
    --radius-sm: 0.375rem;
    --radius-pill: 999px;

    /* Layout */
    --content-width: 1440px;
    --nav-height: 60px;
    --font-family: "Manrope", system-ui, sans-serif;
}

/* ─── Dark Theme ─────────────────────────────────────────────────────────── */
:root[data-theme="dark"] {
    color-scheme: dark;
    --color-bg:            #0B1929;
    --color-surface:       #112238;
    --color-border:        rgba(255, 255, 255, 0.08);
    --color-border-strong: rgba(255, 255, 255, 0.14);
    --color-text:          #EEF2F7;
    --color-text-sub:      #8BAFC8;
    --color-text-muted:    #4E6E8A;
    --color-link:          var(--brand-clarity);
    --shadow-card:         0 1px 4px rgba(0,0,0,0.35), 0 6px 18px rgba(0,0,0,0.25);
}

:root[data-theme="dark"] .status-group__header {
    background: rgba(255, 255, 255, 0.02);
}

:root[data-theme="dark"] .status-group__count {
    background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .progress-track {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select {
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text);
}

:root[data-theme="dark"] .filter-bar__toggle {
    background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .filter-bar__toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .callout,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .snapshot-card,
:root[data-theme="dark"] .timeline__body,
:root[data-theme="dark"] .status-group,
:root[data-theme="dark"] .empty-state {
    border-color: var(--color-border);
}

/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-family);
    font-size: 15px;
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0; line-height: 1.2; outline: none; }
p { margin: 0; }
:focus:not(:focus-visible) { outline: none; }

.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;
}

/* ─── App Shell ──────────────────────────────────────────────────────────── */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: var(--nav-height);
}

.app-main {
    flex: 1;
    padding: 2rem 1.5rem 3rem;
}

.app-content {
    max-width: var(--content-width);
    margin: 0 auto;
}

/* ─── Navigation ─────────────────────────────────────────────────────────── */
.app-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
    background: var(--color-nav);
    box-shadow: var(--shadow-nav);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 2rem;
}

.app-nav__brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.app-nav__logo {
    height: 32px;
    width: auto;
    display: block;
    mix-blend-mode: lighten;
}

.app-nav__links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.app-nav__link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: background 140ms, color 140ms;
    border: 1px solid transparent;
}

.app-nav__link:hover,
.app-nav__link.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
}

.app-nav__user {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-nav__username {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
}


/* Icon-only circular nav buttons — always white, always circular */
.nav-icon-btn,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.07);
    /* Force white regardless of page theme — nav is always dark navy */
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background 140ms, color 140ms, border-color 140ms;
    text-decoration: none;
}

.nav-icon-btn:hover,
.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.theme-toggle__dot { display: none; }

/* Mobile nav toggle */
.app-nav__toggle {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.4rem;
    margin-left: auto;
    line-height: 1;
}

.app-nav__mobile-menu {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-nav);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.75rem 1.5rem 1rem;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    z-index: 99;
}

.app-nav__mobile-menu.open {
    display: flex;
}

.app-nav__mobile-menu .app-nav__link {
    width: 100%;
    justify-content: flex-start;
}

.app-nav__mobile-user {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* ─── Page Header ────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.page-header__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted);
    margin-bottom: 0.3rem;
}

.page-header h1 {
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    font-weight: 800;
    color: var(--color-text);
}

/* ─── Cycle Strip ────────────────────────────────────────────────────────── */
.cycle-strip {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-raven) 70%, var(--brand-vector) 100%);
    border: none;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.cycle-strip::before {
    content: '';
    position: absolute;
    top: -40%;
    right: 5%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(0, 143, 154, 0.28) 0%, transparent 65%);
    pointer-events: none;
}

.cycle-strip__identity {
    grid-column: 1;
    grid-row: 1;
    padding: 2rem 2rem 1.5rem;
    position: relative;
}

.cycle-strip__name {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--brand-clarity);
    margin-bottom: 0.5rem;
}

.cycle-strip__title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.cycle-strip__dates {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.4rem;
}

.cycle-strip__metrics {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem 2rem;
    position: relative;
    flex-wrap: wrap;
}

.cycle-strip__metric {
    text-align: left;
    padding-right: 2rem;
    margin-right: 2rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.cycle-strip__metric:last-child {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
}

.cycle-strip__metric-val {
    font-size: 1.65rem;
    font-weight: 800;
    color: #fff;
    display: block;
    line-height: 1;
    letter-spacing: -0.03em;
}

.cycle-strip__metric-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    display: block;
    margin-top: 0.3rem;
}

.cycle-strip__action {
    grid-column: 2;
    grid-row: 1;
    padding: 2rem 2rem 1.5rem 0;
    align-self: start;
    justify-self: end;
    text-align: right;
    position: relative;
}

.cycle-strip .button--ghost {
    border-color: rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.cycle-strip .button--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

/* ─── Filters ────────────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.filter-bar__search {
    flex: 1 1 260px;
    position: relative;
}

.filter-bar__search input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 140ms, box-shadow 140ms;
}

.filter-bar__search input:focus {
    border-color: var(--brand-vector);
    box-shadow: 0 0 0 3px rgba(0, 93, 131, 0.12);
}

.filter-bar__search input::placeholder { color: var(--color-text-muted); }

.filter-bar__search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}

.filter-bar select {
    padding: 0.6rem 2.25rem 0.6rem 1rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.9rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A96B0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    outline: none;
    transition: border-color 140ms;
    cursor: pointer;
}

.filter-bar select:focus { border-color: var(--brand-vector); }

.filter-bar__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--color-text-sub);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    padding: 0.6rem 1rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    transition: border-color 140ms, background 140ms;
}

.filter-bar__toggle:hover {
    border-color: var(--color-border-strong);
    background: var(--color-bg);
}

.filter-bar__toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--brand-teal);
    cursor: pointer;
}

/* ─── Status Groups ──────────────────────────────────────────────────────── */
.status-groups {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.status-group {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: visible;
    box-shadow: var(--shadow-card);
}

/* Preserve corner clipping without overflow:hidden */
.status-group__header {
    border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}

.status-group a.project-row:last-child {
    border-radius: 0 0 calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px);
}

.status-group__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    background: rgba(18, 41, 69, 0.02);
}

.status-group__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-group__label {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-sub);
}

.status-group__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.4rem;
    border-radius: var(--radius-pill);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-muted);
}

/* Status group color variants */
.status-group--atrisk     .status-group__dot { background: var(--status-atrisk); }
.status-group--atrisk     .status-group__header { border-left: 3px solid var(--status-atrisk); }

.status-group--inflight   .status-group__dot { background: var(--status-inflight); }
.status-group--inflight   .status-group__header { border-left: 3px solid var(--status-inflight); }

.status-group--upnext     .status-group__dot { background: var(--status-upnext); }
.status-group--upnext     .status-group__header { border-left: 3px solid var(--status-upnext); }

.status-group--ongoing    .status-group__dot { background: var(--status-ongoing); }
.status-group--ongoing    .status-group__header { border-left: 3px solid var(--status-ongoing); }

.status-group--shaping    .status-group__dot { background: var(--status-shaping); }
.status-group--shaping    .status-group__header { border-left: 3px solid var(--status-shaping); }

.status-group--futureflow .status-group__dot { background: var(--status-futureflow); }
.status-group--futureflow .status-group__header { border-left: 3px solid var(--status-futureflow); }

.status-group--shipped    .status-group__dot { background: var(--status-shipped); }
.status-group--shipped    .status-group__header { border-left: 3px solid var(--status-shipped); }

/* Neutral variant: used for groups that aren't status-derived (e.g. Target Window). */
.status-group--neutral    .status-group__dot { background: var(--color-text-muted); }
.status-group--neutral    .status-group__header { border-left: 3px solid var(--color-border-strong); }

/* ─── Project Rows ───────────────────────────────────────────────────────── */
.project-row {
    display: grid;
    grid-template-columns: 1fr 8rem 210px 14rem auto 36px;
    align-items: center;
    gap: 1.25rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    transition: background 120ms;
    text-decoration: none;
    color: inherit;
}

.project-row:last-child { border-bottom: none; }

.project-row:hover { background: rgba(18, 41, 69, 0.025); }

/* Contributor-only drag-to-reorder affordance (project-surface, issue 10). */
.project-row--draggable { cursor: grab; }

/* Live drop-target hint: a 2px insertion bar drawn at the top edge of the row a drop would land
   before. inset box-shadow (not border) so the row's own height/grid never shifts as the hint
   moves between rows during a drag. */
.project-row--drop-before {
    box-shadow: inset 0 2px 0 0 var(--color-link);
}

/* End-of-group drop zone. Normally a thin invisible catch area below the last row so a Feature can
   be dropped to the very bottom; grows into a visible insertion bar while it is the active target. */
.project-row__drop-end {
    height: 0.75rem;
}

.project-row__drop-end--active {
    box-shadow: inset 0 2px 0 0 var(--color-link);
}

.project-row__primary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.project-row__drag-handle {
    flex-shrink: 0;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1;
}

.project-row__name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-row__meta {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-row__provenance {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.project-row__progress {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.progress-track {
    flex: 1;
    height: 5px;
    border-radius: var(--radius-pill);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    min-width: 60px;
}

.progress-track__fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-vector), var(--brand-teal));
    transition: width 400ms ease;
}

.project-row__pts {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-weight: 600;
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}

.project-row__pills {
    display: grid;
    grid-template-columns: 9rem 4.5rem;
    gap: 0.5rem;
    align-items: center;
    justify-items: center;
}

.project-row__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    transition: background 140ms, color 140ms, border-color 140ms;
    flex-shrink: 0;
    font-size: 1rem;
}

.project-row:hover .project-row__arrow {
    background: var(--brand-navy);
    color: #fff;
    border-color: var(--brand-navy);
}

.project-row__assignees {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

/* ─── Assignee avatars ───────────────────────────────────────────────────── */
/* Base circular avatar; --avatar-size is set inline by the AssigneeAvatars component. */
.avatar {
    width: var(--avatar-size, 40px);
    height: var(--avatar-size, 40px);
    border-radius: 50%;
    object-fit: cover;
    background: var(--color-bg);
    flex-shrink: 0;
}

/* Overlapping stack (compact row). Each avatar gets a ring in the surface colour so the overlap
   reads as separate people; they pull left onto their neighbour. */
.avatar-stack {
    display: inline-flex;
    align-items: center;
}

.avatar-stack__item {
    box-shadow: 0 0 0 2px var(--color-surface);
    margin-left: calc(var(--avatar-size, 28px) * -0.32);
}

.avatar-stack__item:first-child {
    margin-left: 0;
}

/* "+N" overflow chip, sized to match the avatars it follows. */
.avatar-stack__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
}

/* Named list (detail page). */
.assignee-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.assignee-list__item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.assignee-list__name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
}

.assignee-empty {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.hero__assignees {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.hero__assignees-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

/* ─── Status Pills ───────────────────────────────────────────────────────── */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
    position: relative;
}

.pill--atrisk     { background: rgba(190, 51, 51, 0.1);   color: #9B2222; }
.pill--inflight   { background: rgba(0, 93, 131, 0.1);    color: #005D83; }
.pill--upnext     { background: rgba(0, 143, 154, 0.1);   color: #006E77; }
.pill--ongoing    { background: rgba(13, 179, 134, 0.12); color: #0A8A68; }
.pill--shaping    { background: rgba(219, 163, 40, 0.12); color: #8A620A; }
.pill--futureflow { background: rgba(110, 203, 212, 0.15); color: #2A8A93; }
.pill--shipped    { background: rgba(142, 164, 188, 0.12); color: #5A7A96; }
.pill--ready      { background: rgba(13, 179, 134, 0.1);  color: #0A8A68; }
.pill--intake     { background: rgba(122, 150, 176, 0.1); color: #5A7A96; }
.pill--onhold     { background: rgba(190, 51, 51, 0.1);   color: #9B2222; }
.pill--risk-high  { background: rgba(190, 51, 51, 0.1);   color: #9B2222; }
.pill--risk-med   { background: rgba(219, 163, 40, 0.1);  color: #8A620A; }
.pill--risk-low   { background: rgba(13, 179, 134, 0.1);  color: #0A8A68; }
.pill--muted      { background: var(--color-bg);           color: var(--color-text-muted); border: 1px solid var(--color-border); }

/* ─── Pill Tooltips ──────────────────────────────────────────────────────── */
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--brand-navy);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 200;
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 5px solid transparent;
    border-top-color: var(--brand-navy);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 200;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── Cards (detail pages) ───────────────────────────────────────────────── */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}

/* ─── Metric Cards ───────────────────────────────────────────────────────── */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.metric-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-card);
}

.metric-card__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
}

.metric-card__value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.metric-card__detail {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

/* ─── Callout ────────────────────────────────────────────────────────────── */
.callout {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.75rem;
    border-left: 3px solid var(--brand-teal);
}

.callout__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-teal);
    margin-bottom: 0.35rem;
}

.callout p {
    font-size: 0.9rem;
    color: var(--color-text-sub);
    line-height: 1.65;
}

.callout--error {
    border-left-color: var(--status-atrisk);
}

.callout--error .callout__eyebrow {
    color: var(--status-atrisk);
}

.callout--error a {
    color: var(--status-atrisk);
    text-decoration: underline;
}

.callout--warning {
    border-left-color: var(--brand-gold);
}

.callout--warning .callout__eyebrow {
    color: var(--brand-gold);
}

/* ─── Planning Document (rendered Markdown) ──────────────────────────────────
   The MD→HTML viewer emits raw <h1>/<p>/<ul>/<code>/… which the global reset
   strips of all rhythm. This restores a clean prose scale on the site's tokens
   so a rendered doc reads like part of ThroughLine, not a bare HTML dump. */
.planning-document {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2.5rem;
    box-shadow: var(--shadow-card);
    color: var(--color-text-sub);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Collapse the outer margins so padding controls the top/bottom gap. */
.planning-document > :first-child { margin-top: 0; }
.planning-document > :last-child { margin-bottom: 0; }

.planning-document h1,
.planning-document h2,
.planning-document h3,
.planning-document h4 {
    color: var(--color-text);
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.planning-document h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 1.25rem;
}

.planning-document h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 2.25rem 0 0.9rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--color-border);
}

.planning-document h3 {
    font-size: 1.08rem;
    font-weight: 700;
    margin: 1.75rem 0 0.6rem;
}

.planning-document h4 {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-sub);
    margin: 1.5rem 0 0.5rem;
}

.planning-document p { margin: 0 0 1rem; }

.planning-document ul,
.planning-document ol {
    margin: 0 0 1rem;
    padding-left: 1.4rem;
}

.planning-document li { margin-bottom: 0.4rem; }
.planning-document li::marker { color: var(--color-text-muted); }
.planning-document li > ul,
.planning-document li > ol { margin: 0.4rem 0 0; }

.planning-document a {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.planning-document a:hover { text-decoration-thickness: 2px; }

.planning-document strong { color: var(--color-text); font-weight: 700; }

.planning-document code {
    font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
    font-size: 0.85em;
    background: color-mix(in srgb, var(--color-text) 8%, transparent);
    padding: 0.12em 0.4em;
    border-radius: var(--radius-sm);
}

.planning-document pre {
    background: color-mix(in srgb, var(--color-text) 6%, transparent);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.1rem;
    overflow-x: auto;
    margin: 0 0 1rem;
    line-height: 1.55;
}

.planning-document pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: 0.82rem;
}

.planning-document blockquote {
    margin: 0 0 1rem;
    padding: 0.25rem 0 0.25rem 1rem;
    border-left: 3px solid var(--brand-teal);
    color: var(--color-text-muted);
}

.planning-document blockquote > :last-child { margin-bottom: 0; }

.planning-document hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2rem 0;
}

.planning-document img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

.planning-document table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.25rem;
    font-size: 0.88rem;
}

.planning-document th,
.planning-document td {
    text-align: left;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--color-border);
}

.planning-document th {
    background: color-mix(in srgb, var(--color-text) 5%, transparent);
    color: var(--color-text);
    font-weight: 700;
}

.timeless-ticket-list {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
}

.timeless-ticket-list a {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.timeless-ticket-list a:hover {
    color: var(--brand-teal);
}

/* ─── Hero (detail pages) ────────────────────────────────────────────────── */
.hero {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
}

.hero__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
}

.hero h1 {
    font-size: clamp(1.6rem, 2.5vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.hero__summary {
    color: var(--color-text-sub);
    line-height: 1.65;
    font-size: 0.95rem;
}

.hero__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.hero__pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    background: var(--brand-navy);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 140ms, transform 120ms;
    text-decoration: none;
}

.button:hover {
    background: var(--brand-raven);
    transform: translateY(-1px);
}

.button--ghost {
    background: transparent;
    border-color: var(--color-border-strong);
    color: var(--color-text-sub);
}

.button--ghost:hover {
    background: var(--color-bg);
    color: var(--color-text);
    transform: translateY(-1px);
}

.button--icon {
    padding: 0.45rem;
    line-height: 1;
}

/* ─── Timeline ───────────────────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline__item {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 1rem;
    padding-bottom: 1.25rem;
}

.timeline__item:last-child { padding-bottom: 0; }

.timeline__marker { position: relative; }

.timeline__marker::before {
    content: "";
    position: absolute;
    top: 0.4rem;
    left: 50%;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--brand-teal);
    transform: translateX(-50%);
}

.timeline__marker::after {
    content: "";
    position: absolute;
    top: 1.1rem; bottom: -1.25rem;
    left: 50%; width: 1px;
    background: var(--color-border);
    transform: translateX(-50%);
}

.timeline__item:last-child .timeline__marker::after { display: none; }

.timeline__body {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-card);
}

.timeline__header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.timeline__body h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

.timeline__body p {
    font-size: 0.87rem;
    color: var(--color-text-sub);
    line-height: 1.6;
}

/* ─── Section header ─────────────────────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin: 2rem 0 1rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
}

.section-header .card__eyebrow,
.eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

/* ─── Snapshot / card grids (cycle pages) ─────────────────────────────────── */
.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.snapshot-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
}

.snapshot-card__header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.snapshot-card h3 { font-size: 1rem; font-weight: 700; }

.snapshot-card__summary {
    font-size: 0.87rem;
    color: var(--color-text-sub);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.snapshot-card__footer {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.metric-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    background: rgba(0, 143, 154, 0.1);
    color: #006E77;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ─── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-top: 2rem;
}

.empty-state__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.empty-state h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--color-text-sub);
    line-height: 1.6;
    max-width: 420px;
    margin: 0 auto 1.25rem;
}

/* ─── Reconnect modal ────────────────────────────────────────────────────── */
.components-reconnect-container {
    font-family: var(--font-family);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .metrics-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .snapshot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .project-row {
        grid-template-columns: 1fr 8rem 160px 14rem auto 36px;
    }
}

@media (max-width: 860px) {
    .app-nav__links { display: none; }
    .app-nav__user  { display: none; }
    .app-nav__toggle { display: flex; }

    .app-main { padding: 1.25rem 1rem 2.5rem; }

    .cycle-strip__identity {
        padding: 1.5rem 1.25rem 1rem;
    }

    .cycle-strip__action {
        padding: 1.5rem 1.25rem 0 0;
    }

    .cycle-strip__title {
        font-size: 1.4rem;
    }

    .cycle-strip__metrics {
        padding: 1rem 1.25rem;
        gap: 0;
    }

    .cycle-strip__metric {
        padding-right: 1.25rem;
        margin-right: 1.25rem;
    }

    .cycle-strip__metric-val {
        font-size: 1.3rem;
    }

    .project-row {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
    }

    .project-row__provenance { display: none; }
    .project-row__progress   { display: none; }
    .project-row__pills      { display: none; }
    .project-row__assignees  { display: none; }

    .project-row__name { font-size: 0.9rem; }
    .project-row__meta { font-size: 0.75rem; }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar select { width: 100%; }
}

/* ─── Risk Legend ────────────────────────────────────────────────────────── */
.risk-legend {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
}

.risk-legend__summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    user-select: none;
}

.risk-legend__summary::-webkit-details-marker { display: none; }

.risk-legend__summary::before {
    content: '›';
    display: inline-block;
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.15s ease;
}

details.risk-legend[open] .risk-legend__summary::before {
    transform: rotate(90deg);
}

.risk-legend__body {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.risk-legend__item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    flex: 1;
    min-width: 180px;
}

.risk-legend__item .pill {
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.risk-legend__item p {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--color-text-sub);
}

@media (max-width: 600px) {
    .metrics-row   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .snapshot-grid { grid-template-columns: 1fr; }

    .page-header { flex-direction: column; align-items: flex-start; }
}

/* ─── Cloud Spend ────────────────────────────────────────────────────────── */

/* Hero --compact: header + actions side by side */
.hero--compact {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.hero--compact .hero__actions {
    margin-top: 0;
    align-self: center;
    flex-shrink: 0;
}

/* Card grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

/* Card anatomy */
.card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.card__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}
.card__summary {
    font-size: 0.87rem;
    color: var(--color-text-sub);
    line-height: 1.6;
    margin-top: 0.75rem;
}
.card__actions {
    margin-top: 1.25rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Status pill */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
    flex-shrink: 0;
    background: rgba(0, 143, 154, 0.1);
    color: #006E77;
}
.status-pill--secondary {
    background: rgba(122, 150, 176, 0.12);
    color: var(--color-text-sub);
}

/* Primary metric in card */
.card__primary-metric {
    margin-bottom: 0.75rem;
}
.card__primary-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1;
    margin-bottom: 0.2rem;
    font-variant-numeric: tabular-nums;
}
.card__primary-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Mini cost table (card footer rows) */
.cost-row-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}
.cost-row-table td {
    padding: 0.3rem 0;
}
.cost-row-table td:first-child {
    color: var(--color-text-sub);
}
.cost-row-table td:last-child {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}

/* Metric items (compact inline) */
.metric-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.metric-item__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
}
.metric-item__value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

/* Metrics grid (detail page) */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

/* Data tables */
.table-container {
    overflow-x: auto;
    margin-bottom: 1.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    font-size: 0.87rem;
}
.data-table thead th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    background: rgba(18, 41, 69, 0.025);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
.data-table thead th.align-right { text-align: right; }
.data-table tbody td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(18, 41, 69, 0.02); }
.data-table tfoot td {
    padding: 0.65rem 1rem;
    font-weight: 800;
    border-top: 2px solid var(--color-border-strong);
    color: var(--color-text);
}

/* Delta pills (MoM change) */
.delta-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.delta-up   { background: rgba(190, 51, 51, 0.08);  color: #9B2222; }
.delta-down { background: rgba(13, 179, 134, 0.10); color: #0A8A68; }

/* Table toolbar (search above a table) */
.table-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.table-search {
    padding: 0.45rem 0.85rem 0.45rem 2.1rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-pill);
    background: var(--color-surface)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237A96B0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E")
        no-repeat 0.7rem center;
    color: var(--color-text);
    font: inherit;
    font-size: 0.88rem;
    width: 280px;
    outline: none;
    transition: border-color 140ms, box-shadow 140ms;
}
.table-search:focus {
    border-color: var(--brand-vector);
    box-shadow: 0 0 0 3px rgba(0, 93, 131, 0.12);
}
.table-search::placeholder { color: var(--color-text-muted); }

/* Sortable column headers */
.data-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.data-table thead th.sortable:hover {
    color: var(--color-text);
    background: rgba(18, 41, 69, 0.04);
}
.data-table thead th.sortable::after {
    content: " ⇅";
    font-size: 0.65rem;
    opacity: 0.35;
    display: inline-block;
    margin-left: 0.2rem;
}
.data-table thead th.sort-asc::after  { content: " ↑"; opacity: 0.75; }
.data-table thead th.sort-desc::after { content: " ↓"; opacity: 0.75; }

/* Fixed-width cost columns */
.col-cost  { width: 8rem; min-width: 8rem; max-width: 8rem; }
.col-delta { width: 10rem; min-width: 10rem; max-width: 10rem; }

/* AP compact card */
/* card with guaranteed bottom spacing (when not part of a card+card stack) */
.card--spaced { margin-bottom: 1.75rem; }

/* table-container inside a card: no extra shadow/margin */
.table-container--embedded {
    margin-bottom: 0;
    box-shadow: none;
}

.ap-compact-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.ap-compact-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0.15rem;
}
.ap-table tfoot td {
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}
.ap-compact__invoice {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 1.5rem;
    font-size: 0.83rem;
    color: var(--color-text-sub);
}
.ap-compact__invoice-eyebrow {
    width: 100%;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 0.1rem;
}
.ap-compact__invoice strong {
    color: var(--color-text);
    font-weight: 700;
}
.ap-compact__invoice-id {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

/* Utilities */
.align-right { text-align: right; }
.muted { color: var(--color-text-muted); }
.text-negative { color: #9B2222; }

/* Dark mode adjustments */
:root[data-theme="dark"] .data-table thead th {
    background: rgba(255, 255, 255, 0.02);
}
:root[data-theme="dark"] .data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 860px) {
    .hero--compact { flex-direction: column; }
    .hero--compact .hero__actions { align-self: flex-start; }
    .card-grid { grid-template-columns: 1fr; }
    .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .card__primary-value { font-size: 1.6rem; }
    .ap-compact__invoice-id { margin-left: 0; }
}
