/* ==========================================================================
   Wannville · Eproject panel theme
   Loaded only by the Eproject panel (resources/views/eproject/theme-head).
   Every rule is scoped to .fi-panel-eproject so other panels are untouched.
   ========================================================================== */

.fi-panel-eproject {
    --wv-navy: #0a1f3c;
    --wv-navy-2: #1b3358;
    --wv-gold: #b8872f;
    --wv-gold-soft: #f7efdf;
    --wv-bg: #f6f7fb;
    --wv-card: #ffffff;
    --wv-line: #e6e9f0;
    --wv-text: #0f172a;
    --wv-muted: #64748b;
    --wv-blue: #2563eb;
    --wv-blue-soft: #eaf1ff;
    --wv-green: #15803d;
    --wv-green-soft: #e7f6ec;
    --wv-red: #dc2626;
    --wv-red-soft: #fdecec;
    --wv-amber: #b45309;
    --wv-gray-soft: #eef1f5;
    --wv-radius: 16px;
    --wv-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
    --wv-serif: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
    --wv-tabbar-h: 64px;

    background-color: var(--wv-bg);
    color: var(--wv-text);
}

.fi-panel-eproject.dark,
.dark .fi-panel-eproject {
    --wv-bg: #0b1220;
    --wv-card: #111a2b;
    --wv-line: rgba(255, 255, 255, .08);
    --wv-text: #e5e9f0;
    --wv-muted: #94a3b8;
    --wv-blue: #7aa7ff;
    --wv-blue-soft: rgba(96, 140, 255, .14);
    --wv-green: #4ade80;
    --wv-green-soft: rgba(74, 222, 128, .12);
    --wv-red: #f87171;
    --wv-red-soft: rgba(248, 113, 113, .12);
    --wv-amber: #fbbf24;
    --wv-gold: #d9ab52;
    --wv-gold-soft: rgba(217, 171, 82, .14);
    --wv-gray-soft: rgba(255, 255, 255, .06);
    --wv-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

/* ---------- Top bar: ☰ left · logo centred (mobile) · avatar right -------- */

.fi-panel-eproject .fi-topbar {
    min-height: 60px;
    box-shadow: none;
    border-bottom: 1px solid var(--wv-line);
    background-color: color-mix(in oklab, var(--wv-card) 88%, transparent);
    backdrop-filter: saturate(160%) blur(12px);
}

@media (max-width: 1023px) {
    /* Filament hides this below lg — show just the logo, centred, like the mockup. */
    .fi-panel-eproject .fi-topbar-start {
        display: flex;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
    }

    .fi-panel-eproject .fi-topbar-start > .fi-icon-btn {
        display: none;
    }

    .fi-panel-eproject .fi-topbar-start .fi-logo {
        margin-inline-start: 0;
    }
}

.fi-panel-eproject .fi-user-menu .fi-avatar {
    box-shadow: 0 0 0 2px var(--wv-card), 0 0 0 3px var(--wv-blue-soft);
}

/* ---------- Sidebar drawer ---------------------------------------------- */

.fi-panel-eproject .fi-sidebar {
    background-color: var(--wv-card);
    border-inline-end: 1px solid var(--wv-line);
}

.fi-panel-eproject .fi-sidebar-group-label {
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--wv-muted);
}

.fi-panel-eproject .fi-sidebar-item.fi-active .fi-sidebar-item-btn {
    background-color: var(--wv-gold-soft);
}

.fi-panel-eproject .fi-sidebar-item.fi-active .fi-sidebar-item-btn > .fi-icon,
.fi-panel-eproject .fi-sidebar-item.fi-active .fi-sidebar-item-label {
    color: var(--wv-gold);
}

/* ---------- Page header --------------------------------------------------- */

.fi-panel-eproject .fi-header-heading {
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--wv-navy);
}

/* Work Notes uses the serif title from its mockup */
.fi-panel-eproject .fi-resource-work-notes .fi-header-heading {
    font-family: var(--wv-serif);
    font-weight: 700;
    letter-spacing: -.01em;
}

.dark .fi-panel-eproject .fi-header-heading,
.fi-panel-eproject.dark .fi-header-heading {
    color: var(--wv-text);
}

.fi-panel-eproject .fi-header-subheading {
    font-size: .95rem;
    color: var(--wv-muted);
}

@media (max-width: 639px) {
    .fi-panel-eproject .fi-main {
        padding-inline: 16px;
    }

    .fi-panel-eproject .fi-page-header-main-ctn {
        padding-block: 20px 16px;
        row-gap: 16px;
    }

    .fi-panel-eproject .fi-header-heading {
        font-size: 1.7rem;
        line-height: 1.2;
    }
}

/* ---------- Card-mode tables (projects, notes, expenses) ----------------- */

.fi-panel-eproject .fi-ta-ctn:has(.fi-ta-content-grid) {
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.fi-panel-eproject .fi-ta-ctn:has(.fi-ta-content-grid) .fi-ta-header-toolbar {
    border: 0;
    padding-inline: 0;
    padding-block: 0 4px;
}

.fi-panel-eproject .fi-ta-ctn:has(.fi-ta-content-grid) .fi-ta-content.fi-ta-content-grid {
    padding: 8px 0 0;
    gap: 14px;
}

.fi-panel-eproject .fi-ta-ctn:has(.fi-ta-content-grid) .fi-ta-content-header {
    border: 0;
    padding-inline: 2px;
    background: transparent;
    color: var(--wv-muted);
}

.fi-panel-eproject .fi-ta-ctn:has(.fi-ta-content-grid) .fi-pagination {
    border: 0;
    padding-inline: 0;
}

.fi-panel-eproject .fi-ta-search-field .fi-input-wrp,
.fi-panel-eproject .fi-ta-filters-trigger-action-ctn .fi-btn,
.fi-panel-eproject .fi-ta-header-toolbar .fi-icon-btn {
    border-radius: 12px;
}

.fi-panel-eproject .fi-ta-header-toolbar .fi-input-wrp {
    background-color: var(--wv-card);
    box-shadow: var(--wv-shadow);
}

.fi-panel-eproject .fi-ta-content-grid .fi-ta-record.wv-record {
    position: relative;
    border-radius: var(--wv-radius);
    background-color: var(--wv-card);
    box-shadow: var(--wv-shadow);
    --tw-ring-color: var(--wv-line);
    transition: transform .15s ease, box-shadow .15s ease;
}

.fi-panel-eproject .fi-ta-content-grid .fi-ta-record.wv-record.fi-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(15, 23, 42, .05), 0 12px 28px rgba(15, 23, 42, .08);
}

.fi-panel-eproject .wv-record .fi-ta-record-content-ctn {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.fi-panel-eproject .wv-record .fi-ta-record-content-ctn > div:first-child {
    flex: 1;
}

.fi-panel-eproject .wv-record .fi-ta-record-content {
    display: block;
    padding: 16px 18px 12px;
}

/* ⋮ menu pinned to the card's top-right corner */
.fi-panel-eproject .wv-record .fi-ta-actions {
    padding: 0 18px 16px;
    gap: 8px;
}

.fi-panel-eproject .wv-record .fi-ta-actions > .fi-dropdown:has(.wv-card-menu),
.fi-panel-eproject .wv-record .fi-ta-actions > .wv-card-menu {
    position: absolute;
    top: 10px;
    right: 8px;
}

.fi-panel-eproject .wv-record .fi-ta-actions:not(:has(.wv-cta)) {
    padding: 0;
}

/* Full-width soft call-to-action ("Log Activity") */
.fi-panel-eproject .wv-record .fi-ta-actions .wv-cta {
    width: 100%;
    justify-content: center;
    border-radius: 12px;
    background-color: var(--wv-blue-soft);
    color: var(--wv-blue);
    box-shadow: none;
    font-weight: 600;
    padding-block: 10px;
}

.fi-panel-eproject .wv-record .fi-ta-actions .wv-cta:hover {
    background-color: color-mix(in oklab, var(--wv-blue-soft) 70%, var(--wv-blue) 12%);
}

.fi-panel-eproject .wv-record .fi-ta-actions .wv-cta .fi-icon {
    color: currentColor;
}

/* ---------- Card content ------------------------------------------------- */

.wv-card,
.wv-note {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--wv-text);
    text-align: start;
}

.wv-card__head {
    padding-inline-end: 28px; /* room for the ⋮ menu */
}

.wv-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-inline-end: 28px;
}

.wv-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--wv-navy);
    overflow-wrap: anywhere;
}

.dark .wv-card__title {
    color: var(--wv-text);
}

.wv-card__code {
    margin-top: 2px;
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--wv-muted);
}

.wv-card__desc {
    margin-top: 4px;
    font-size: .875rem;
    line-height: 1.45;
    color: var(--wv-muted);
}

.wv-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wv-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    background: var(--wv-gray-soft);
    color: var(--wv-muted);
}

.wv-chip__dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
}

.wv-chip--blue { background: var(--wv-blue-soft); color: var(--wv-blue); }
.wv-chip--green { background: var(--wv-green-soft); color: var(--wv-green); }
.wv-chip--red { background: var(--wv-red-soft); color: var(--wv-red); }
.wv-chip--gold { background: var(--wv-gold-soft); color: var(--wv-amber); }

.wv-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    color: var(--wv-muted);
}

.wv-meta--tight {
    font-size: .8rem;
}

.wv-ico {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.wv-label {
    display: block;
    font-size: .72rem;
    font-weight: 500;
    color: var(--wv-muted);
}

.wv-sub {
    display: block;
    font-size: .78rem;
    color: var(--wv-muted);
}

.wv-budget {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--wv-line);
}

.wv-budget__amount {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--wv-navy);
    font-variant-numeric: tabular-nums;
}

.dark .wv-budget__amount {
    color: var(--wv-text);
}

.wv-strike {
    text-decoration: line-through;
    opacity: .6;
}

.wv-usage {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.wv-usage__text strong {
    font-size: .95rem;
    font-variant-numeric: tabular-nums;
}

.wv-ring {
    width: 38px;
    height: 38px;
}

.wv-ring__track,
.wv-donut__track {
    fill: none;
    stroke: var(--wv-gray-soft);
}

.wv-ring__track,
.wv-ring__value {
    stroke-width: 4;
}

.wv-ring__value,
.wv-donut__value {
    fill: none;
    stroke-linecap: round;
    transition: stroke-dasharray .6s ease;
}

.wv-stroke-success { stroke: var(--wv-green); }
.wv-stroke-warning { stroke: var(--wv-amber); }
.wv-stroke-danger { stroke: var(--wv-red); }

.wv-text-success, .wv-text-green { color: var(--wv-green); }
.wv-text-warning { color: var(--wv-amber); }
.wv-text-danger, .wv-text-red { color: var(--wv-red); }
.wv-text-blue { color: var(--wv-blue); }
.wv-text-gold { color: var(--wv-gold); }

.wv-bg-success { background: var(--wv-green); }
.wv-bg-warning { background: var(--wv-amber); }
.wv-bg-danger { background: var(--wv-red); }
.wv-bg-muted { background: var(--wv-line); }

/* Work note: two-column row like the mockup */
.wv-note {
    flex-direction: row;
    gap: 12px;
}

.wv-note__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wv-note__side {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 96px;
    padding-inline-end: 22px;
}

/* ---------- Dashboard ---------------------------------------------------- */

.wv-dash {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wv-dash__date {
    font-size: .85rem;
    color: var(--wv-muted);
    margin-top: -8px;
}

.wv-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.wv-stat,
.wv-alert,
.wv-panel {
    background: var(--wv-card);
    border: 1px solid var(--wv-line);
    border-radius: var(--wv-radius);
    box-shadow: var(--wv-shadow);
}

.wv-stat,
.wv-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    color: var(--wv-text);
    transition: transform .15s ease;
}

.wv-stat:hover,
.wv-alert:hover {
    transform: translateY(-1px);
}

.wv-stat__icon,
.wv-feed-item__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
}

.wv-stat__icon .wv-ico,
.wv-feed-item__icon .wv-ico {
    width: 20px;
    height: 20px;
}

.wv-tone-blue { background: var(--wv-blue-soft); color: var(--wv-blue); }
.wv-tone-navy { background: var(--wv-gray-soft); color: var(--wv-navy); }
.dark .wv-tone-navy { color: var(--wv-text); }
.wv-tone-gold { background: var(--wv-gold-soft); color: var(--wv-gold); }
.wv-tone-green { background: var(--wv-green-soft); color: var(--wv-green); }
.wv-tone-red { background: var(--wv-red-soft); color: var(--wv-red); }

.wv-stat__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wv-stat__label {
    font-size: .85rem;
    color: var(--wv-muted);
}

.wv-stat__value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--wv-navy);
    font-variant-numeric: tabular-nums;
}

.dark .wv-stat__value {
    color: var(--wv-text);
}

.wv-stat__hint {
    font-size: .8rem;
    color: var(--wv-muted);
}

.wv-stat__chev {
    color: var(--wv-muted);
}

.wv-alert__title {
    font-weight: 600;
}

.wv-panel {
    padding: 16px;
}

.wv-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.wv-panel__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--wv-text);
}

.wv-budget-panel {
    display: grid;
    gap: 16px;
}

@media (min-width: 900px) {
    .wv-budget-panel {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
}

.wv-budget-panel__figures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.wv-figure {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.wv-figure + .wv-figure {
    padding-inline-start: 12px;
    border-inline-start: 1px solid var(--wv-line);
}

.wv-figure__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    color: var(--wv-muted);
}

.wv-figure__value {
    font-size: clamp(1.05rem, 4.2vw, 1.5rem);
    font-weight: 700;
    color: var(--wv-navy);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.dark .wv-figure__value {
    color: var(--wv-text);
}

.wv-figure__hint {
    font-size: .8rem;
    color: var(--wv-muted);
}

.wv-donut-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

.wv-donut {
    width: 112px;
    height: 112px;
    flex-shrink: 0;
}

.wv-donut__track,
.wv-donut__value {
    stroke-width: 10;
}

.wv-donut__label {
    font-size: 17px;
    font-weight: 700;
    fill: var(--wv-text);
    text-anchor: middle;
    dominant-baseline: central;
}

.wv-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: .875rem;
    color: var(--wv-muted);
}

.wv-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wv-legend strong {
    color: var(--wv-text);
    font-variant-numeric: tabular-nums;
}

.wv-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.wv-progress {
    height: 8px;
    margin-top: 14px;
    border-radius: 999px;
    background: var(--wv-gray-soft);
    overflow: hidden;
}

.wv-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.wv-feed-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-top: 1px solid var(--wv-line);
    color: var(--wv-text);
}

.wv-feed-item:first-of-type {
    border-top: 0;
}

.wv-feed-item:hover .wv-feed-item__title {
    color: var(--wv-blue);
}

.wv-feed-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.wv-feed-item__title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wv-feed-item__meta {
    font-size: .8rem;
    color: var(--wv-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wv-feed-item__time {
    font-size: .78rem;
    color: var(--wv-muted);
    white-space: nowrap;
}

.wv-empty {
    padding: 24px 8px;
    text-align: center;
    color: var(--wv-muted);
    font-size: .9rem;
}

/* ---------- Mobile bottom tab bar --------------------------------------- */

.wv-tabbar {
    display: none;
}

@media (max-width: 1023px) {
    .fi-panel-eproject .wv-tabbar {
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 25; /* below Filament's sidebar drawer + modals */
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        height: calc(var(--wv-tabbar-h) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: color-mix(in oklab, var(--wv-card) 94%, transparent);
        backdrop-filter: saturate(160%) blur(14px);
        border-top: 1px solid var(--wv-line);
    }

    .fi-panel-eproject .fi-layout {
        padding-bottom: calc(var(--wv-tabbar-h) + env(safe-area-inset-bottom));
    }
}

.wv-tabbar__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: .68rem;
    font-weight: 500;
    color: var(--wv-muted);
    background: none;
    border: 0;
    -webkit-tap-highlight-color: transparent;
}

.wv-tabbar__icon {
    width: 24px;
    height: 24px;
}

.wv-tabbar__item.is-active {
    color: var(--wv-gold);
    font-weight: 600;
}

.wv-tabbar__item.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--wv-gold);
}

/* ---------- Modals become bottom sheets on phones ------------------------ */

@media (max-width: 639px) {
    .fi-panel-eproject .fi-modal:not(.fi-modal-slide-over):not(.fi-width-screen) .fi-modal-window-ctn {
        padding: 0;
        grid-template-rows: 1fr auto;
    }

    .fi-panel-eproject .fi-modal:not(.fi-modal-slide-over):not(.fi-width-screen) .fi-modal-window {
        width: 100%;
        max-width: 100%;
        max-height: 92dvh;
        margin: 0;
        border-radius: 22px 22px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
        /* Title and buttons stay put; the form between them scrolls. */
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .fi-panel-eproject .fi-modal:not(.fi-modal-slide-over):not(.fi-width-screen) .fi-modal-header,
    .fi-panel-eproject .fi-modal:not(.fi-modal-slide-over):not(.fi-width-screen) .fi-modal-footer {
        flex-shrink: 0;
    }

    .fi-panel-eproject .fi-modal:not(.fi-modal-slide-over):not(.fi-width-screen) .fi-modal-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .fi-panel-eproject .fi-modal:not(.fi-modal-slide-over):not(.fi-width-screen) .fi-modal-footer {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--wv-line);
        background: var(--wv-card);
    }

    .fi-panel-eproject .fi-modal:not(.fi-modal-slide-over):not(.fi-width-screen) .fi-modal-window::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        margin: 8px auto 0;
        border-radius: 999px;
        background: var(--wv-line);
    }
}

/* ---------- Buttons & sections ------------------------------------------- */

.fi-panel-eproject .fi-btn {
    border-radius: 12px;
}

.fi-panel-eproject .fi-section {
    border-radius: var(--wv-radius);
}

.fi-panel-eproject .fi-wi-stats-overview-stat {
    border-radius: var(--wv-radius);
}

/* ==========================================================================
   Mockup alignment pass
   ========================================================================== */

/* ---------- Search row: full-width search + Filter button ---------------- */

.fi-panel-eproject .fi-ta-header-toolbar > .fi-ta-actions:not(:has(*)) {
    display: none;
}

.fi-panel-eproject .fi-ta-header-toolbar > :last-child {
    flex: 1;
    margin-inline-start: 0;
    column-gap: 10px;
}

.fi-panel-eproject .fi-ta-header-toolbar .fi-ta-search-field {
    flex: 1;
    max-width: none;
}

.fi-panel-eproject .fi-ta-header-toolbar .fi-ta-search-field .fi-input-wrp {
    width: 100%;
    min-height: 44px;
}

.fi-panel-eproject .fi-ta-filters-modal .fi-modal-trigger .fi-btn,
.fi-panel-eproject .fi-ta-filters-modal .fi-modal-trigger .fi-icon-btn {
    min-height: 44px;
    min-width: 44px;
    border-radius: 12px;
    background: var(--wv-card);
    box-shadow: var(--wv-shadow);
    border: 1px solid var(--wv-line);
}

/* ---------- "4 Projects · Sort by: Newest" row --------------------------- */

.fi-panel-eproject .fi-ta-header-ctn {
    display: flex;
    flex-direction: column;
}

.fi-panel-eproject .fi-ta-header-ctn > .wv-list-header {
    order: 2;
}

.wv-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 2px 2px;
    font-size: .875rem;
    color: var(--wv-muted);
}

.wv-list-header__sort {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--wv-muted);
    background: none;
    border: 0;
    cursor: pointer;
}

.wv-list-header__sort strong {
    color: var(--wv-text);
    font-weight: 600;
}

/* ---------- Work Notes: one white list with dividers --------------------- */

.fi-panel-eproject .fi-ta-content:not(.fi-ta-content-grid) .fi-ta-record.wv-record--row {
    position: relative;
}

.fi-panel-eproject .fi-ta-content:not(.fi-ta-content-grid) .wv-record--row .fi-ta-record-content {
    padding: 14px 16px;
}

.fi-panel-eproject .fi-ta-content:not(.fi-ta-content-grid) .wv-record--row .fi-ta-actions {
    padding: 0;
}

.fi-panel-eproject .fi-ta-ctn:has(.wv-record--row) {
    border-radius: var(--wv-radius);
    box-shadow: var(--wv-shadow);
}

/* ---------- Filter & Sort sheet ------------------------------------------ */

.fi-panel-eproject .fi-ta-filters-modal .fi-modal-heading {
    font-family: var(--wv-serif);
    font-size: 1.2rem;
}

.fi-panel-eproject .fi-ta-filters-modal .fi-ta-filters {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 16px 10px;
}

.fi-panel-eproject .fi-ta-filters-modal .fi-ta-filters > * {
    grid-column: 1 / -1;
}

.fi-panel-eproject .fi-ta-filters-modal .fi-ta-filters-header {
    display: contents;
}

.fi-panel-eproject .fi-ta-filters-modal .fi-ta-filters-heading {
    display: none;
}

/* "Reset" and "Apply Filters" sit side by side at the bottom */
.fi-panel-eproject .fi-ta-filters-modal .fi-ta-filters-header > div {
    grid-row: 3;
    grid-column: 1;
}

.fi-panel-eproject .fi-ta-filters-modal .fi-ta-filters-apply-action-ctn {
    grid-row: 3;
    grid-column: 2;
    margin: 0;
}

.fi-panel-eproject .fi-ta-filters-modal .fi-ta-filters-header .fi-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    border: 1px solid var(--wv-line);
    border-radius: 12px;
    color: var(--wv-text);
    font-weight: 600;
    text-decoration: none;
}

.fi-panel-eproject .fi-ta-filters-modal .fi-ta-filters-apply-action-ctn .fi-btn {
    width: 100%;
    height: 46px;
    font-weight: 600;
}

/* Chip-style toggle buttons (Status / Sort by) */
.fi-panel-eproject .fi-ta-filters-modal .fi-fo-toggle-buttons .fi-btn {
    border-radius: 999px;
    padding-inline: 16px;
    min-height: 38px;
}

.fi-panel-eproject .fi-ta-filters-modal .fi-fo-field-label-content {
    font-weight: 600;
    color: var(--wv-text);
}

/* ---------- Dashboard header --------------------------------------------- */

.fi-panel-eproject .fi-topbar .fi-global-search-ctn {
    display: none; /* shown in the dashboard header instead */
}

.wv-dash-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 16px;
}

.wv-dash-header__search {
    margin-bottom: 14px;
}

.wv-dash-header__search .fi-global-search-ctn,
.wv-dash-header__search .fi-global-search,
.wv-dash-header__search .fi-global-search-field {
    width: 100%;
    max-width: none;
}

.wv-dash-header__search .fi-input-wrp {
    min-height: 46px;
    border-radius: 12px;
    background: var(--wv-card);
    box-shadow: var(--wv-shadow);
}

.wv-dash-header__title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.wv-dash-header__date {
    font-size: .85rem;
    color: var(--wv-muted);
    white-space: nowrap;
}

.wv-dash-header__greeting {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--wv-navy);
}

.dark .wv-dash-header__greeting {
    color: var(--wv-text);
}

.wv-dash-header__sun {
    color: #f5a524;
}

.wv-dash-header__sun .wv-ico {
    width: 22px;
    height: 22px;
}

.wv-dash-header__sun.is-night {
    color: var(--wv-gold);
}

.wv-dash-header__sub {
    font-size: .9rem;
    color: var(--wv-muted);
}

.wv-util-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--wv-line);
}

.wv-util-bar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wv-util-bar__pct {
    font-size: 1.25rem;
    color: var(--wv-gold);
    font-variant-numeric: tabular-nums;
}

.wv-util-bar .wv-progress {
    margin-top: 0;
}

.wv-panel__more,
.wv-panel__link {
    color: var(--wv-muted);
}

.wv-panel__link {
    font-size: .9rem;
    font-weight: 600;
    color: var(--wv-navy);
}

.dark .wv-panel__link {
    color: var(--wv-text);
}

/* ---------- Floating "New" button on phones ------------------------------ */

@media (max-width: 1023px) {
    .fi-panel-eproject .fi-header .wv-fab {
        position: fixed;
        right: 16px;
        bottom: calc(var(--wv-tabbar-h) + env(safe-area-inset-bottom) + 16px);
        z-index: 24;
        border-radius: 999px;
        padding: 12px 18px;
        box-shadow: 0 8px 24px rgba(10, 31, 60, .28);
    }
}
/* ==========================================================================
   Side menu — Projects / Workspace / System layout from the app mockup
   ========================================================================== */

.fi-panel-eproject .fi-sidebar-header {
    height: auto;
    min-height: 76px;
    padding: 18px 20px 16px;
    gap: 12px;
    box-shadow: none;
    border-bottom: 1px solid var(--wv-line);
    background: var(--wv-card);
}

.fi-panel-eproject .fi-sidebar-header .fi-logo {
    height: 2.4rem !important;
}

.wv-side-brand {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    line-height: 1.2;
}

.wv-side-brand__name {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--wv-navy);
}

.dark .wv-side-brand__name {
    color: var(--wv-text);
}

.wv-side-brand__org {
    font-size: .8rem;
    color: var(--wv-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wv-side-brand__close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--wv-muted);
    background: none;
    border: 0;
}

.wv-side-brand__close .wv-ico {
    width: 24px;
    height: 24px;
}

/* Sections: uppercase label, divider between sections */
.fi-panel-eproject .fi-sidebar-nav-groups {
    row-gap: 0;
}

.fi-panel-eproject .fi-sidebar-group {
    padding-block: 14px;
}

.fi-panel-eproject .fi-sidebar-group + .fi-sidebar-group {
    border-top: 1px solid var(--wv-line);
}

.fi-panel-eproject .fi-sidebar-group-label {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .08em;
}

.fi-panel-eproject .fi-sidebar-item-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--wv-text);
}

.fi-panel-eproject .fi-sidebar-item-btn > .fi-icon {
    color: var(--wv-navy);
}

.dark .fi-panel-eproject .fi-sidebar-item-btn > .fi-icon {
    color: var(--wv-muted);
}

.fi-panel-eproject .fi-sidebar-item-btn {
    padding-block: 9px;
}

/* Dashboard lives in the bottom tab bar on phones, so the drawer starts
   with PROJECTS like the mockup; desktop keeps it at the top. */
@media (max-width: 1023px) {
    .fi-panel-eproject .fi-sidebar-nav-groups > .fi-sidebar-group:not(:has(.fi-sidebar-group-label)):has(a[href$="/eproject"]) {
        display: none;
    }
}

@media (min-width: 1024px) {
    .wv-side-brand__close {
        display: none;
    }
}

/* Footer: Log Out + version / tagline */
.wv-side-footer {
    padding: 8px 20px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--wv-line);
}

.wv-side-footer__logout {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--wv-red);
    background: none;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}

.wv-side-footer__logout .wv-ico {
    width: 22px;
    height: 22px;
}

.wv-side-footer__logout:hover {
    background: var(--wv-red-soft);
}

.wv-side-footer__meta {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    font-size: .75rem;
    color: var(--wv-muted);
}

/* When the desktop sidebar is collapsed to icons, hide the footer text */
.fi-panel-eproject .fi-sidebar:not(.fi-sidebar-open) .wv-side-footer__logout span,
.fi-panel-eproject .fi-sidebar:not(.fi-sidebar-open) .wv-side-footer__meta {
    display: none;
}

/* ==========================================================================
   Reports · Help & Support · Give Feedback
   ========================================================================== */

.wv-bg-gold { background: var(--wv-gold); }
.wv-bg-navy { background: var(--wv-navy); }
.dark .wv-bg-navy { background: var(--wv-blue); }

.wv-report,
.wv-help {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wv-report__filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.wv-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wv-input {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--wv-line);
    border-radius: 12px;
    background: var(--wv-card);
    color: var(--wv-text);
    font-size: .9rem;
}

.wv-report__totals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 900px) {
    .wv-report__totals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.wv-report__totals .wv-figure + .wv-figure {
    padding-inline-start: 16px;
    border-inline-start: 1px solid var(--wv-line);
}

.wv-report__grid {
    display: grid;
    gap: 14px;
}

@media (min-width: 900px) {
    .wv-report__grid { grid-template-columns: 1fr 1fr; }
}

.wv-report-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 0;
    border-top: 1px solid var(--wv-line);
    color: var(--wv-text);
}

.wv-report-row:first-of-type { border-top: 0; }

.wv-report-row__head,
.wv-report-row__meta,
.wv-bar-row__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.wv-report-row__name { font-weight: 600; }
.wv-report-row__name small { color: var(--wv-muted); font-weight: 400; margin-inline-start: 6px; }
.wv-report-row__meta { font-size: .8rem; color: var(--wv-muted); }
.wv-report-row .wv-progress,
.wv-bar-row .wv-progress { margin-top: 0; }

.wv-bar-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
    font-size: .875rem;
}

.wv-legend-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: var(--wv-muted);
}

.wv-months {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 180px;
    overflow-x: auto;
    padding-top: 8px;
}

.wv-month {
    flex: 1 0 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
}

.wv-month__bar {
    flex: 1;
    width: 100%;
    max-width: 36px;
    display: flex;
    flex-direction: column-reverse;
    border-radius: 6px 6px 0 0;
    background: var(--wv-gray-soft);
    overflow: hidden;
}

.wv-month__label {
    font-size: .7rem;
    color: var(--wv-muted);
}

/* Help & Support */
.wv-faq {
    border-top: 1px solid var(--wv-line);
    padding: 12px 0;
}

.wv-faq:first-of-type { border-top: 0; }

.wv-faq summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--wv-text);
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.wv-faq summary::after {
    content: "+";
    color: var(--wv-muted);
    font-weight: 400;
}

.wv-faq[open] summary::after { content: "–"; }

.wv-faq p {
    margin-top: 8px;
    font-size: .9rem;
    line-height: 1.55;
    color: var(--wv-muted);
}

.wv-help__lead {
    margin: 12px 0 8px;
    font-size: .9rem;
    color: var(--wv-muted);
}

.wv-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: var(--wv-gray-soft);
    font-size: .9rem;
}

.wv-contact a { color: var(--wv-blue); }

/* Give Feedback */
.wv-feedback-form__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.wv-feedback-form .fi-fo-toggle-buttons .fi-btn { border-radius: 999px; }

.wv-feedback-item { align-items: flex-start; }

.wv-feedback-item__message {
    margin-top: 4px;
    font-size: .85rem;
    color: var(--wv-muted);
    white-space: pre-line;
}

.wv-feedback-item__reply {
    display: block;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border-inline-start: 3px solid var(--wv-blue);
    background: var(--wv-blue-soft);
    font-size: .85rem;
    color: var(--wv-text);
    white-space: pre-line;
}

.wv-feedback-item__reply strong {
    display: block;
    margin-bottom: 2px;
    color: var(--wv-blue);
}

.wv-feedback-item__side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.wv-feedback-item__side button { border: 0; cursor: pointer; }

/* ==========================================================================
   Accounting — financial statements, cash book, ledger tables
   ========================================================================== */

.wv-fs { display: flex; flex-direction: column; gap: 14px; }

.wv-fs-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.wv-fs-tabs::-webkit-scrollbar { display: none; }
.wv-fs-tab { flex-shrink: 0; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--wv-line); background: var(--wv-card); color: var(--wv-muted); font-size: .85rem; font-weight: 600; cursor: pointer; }
.wv-fs-tab.is-active { background: var(--wv-navy); border-color: var(--wv-navy); color: #fff; }
.dark .wv-fs-tab.is-active { background: var(--wv-gold); border-color: var(--wv-gold); color: #111; }

.wv-fs-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.wv-fs-filters__wide { grid-column: span 2; }
@media (max-width: 640px) { .wv-fs-filters__wide { grid-column: auto; } }

.wv-fs-sheet { padding: 20px; transition: opacity .15s; }
.wv-fs-sheet.is-loading { opacity: .55; }
.wv-fs-sheet__head { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 2px solid var(--wv-navy); }
.dark .wv-fs-sheet__head { border-bottom-color: var(--wv-gold); }
.wv-fs-sheet__head h2 { font-family: var(--wv-serif); font-size: 1.3rem; font-weight: 700; color: var(--wv-navy); }
.dark .wv-fs-sheet__head h2 { color: var(--wv-text); }
.wv-fs-sheet__head p { font-size: .85rem; color: var(--wv-muted); margin-top: 2px; }
.wv-fs-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.wv-fs .fs-table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 520px; }
.wv-fs .fs-table th { text-align: left; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--wv-muted); padding: 8px 10px; border-bottom: 1px solid var(--wv-line); }
.wv-fs .fs-table td { padding: 7px 10px; border-bottom: 1px solid var(--wv-line); vertical-align: top; color: var(--wv-text); }
.wv-fs .fs-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wv-fs .fs-code { width: 72px; color: var(--wv-muted); font-variant-numeric: tabular-nums; }
.wv-fs .fs-nowrap { white-space: nowrap; }
.wv-fs .fs-muted { color: var(--wv-muted); font-size: .78rem; }
.wv-fs .fs-heading td { font-weight: 700; color: var(--wv-navy); background: var(--wv-gray-soft); padding-top: 10px; }
.dark .wv-fs .fs-heading td { color: var(--wv-text); }
.wv-fs .fs-subtotal td { font-weight: 600; border-top: 1px solid var(--wv-muted); }
.wv-fs .fs-total td { font-weight: 700; border-top: 1.5px solid var(--wv-navy); }
.wv-fs .fs-grand td { font-weight: 800; font-size: .95rem; border-top: 1.5px solid var(--wv-navy); border-bottom: 3px double var(--wv-navy); }
.dark .wv-fs .fs-total td, .dark .wv-fs .fs-grand td { border-color: var(--wv-gold); }
.wv-fs .fs-empty { text-align: center; color: var(--wv-muted); padding: 24px; }
.wv-fs .fs-check { margin-top: 10px; font-size: .8rem; }
.wv-fs .fs-check.is-ok { color: var(--wv-green); }
.wv-fs .fs-check.is-bad { color: var(--wv-red); font-weight: 700; }
.wv-fs .fs-h4 { margin: 18px 0 8px; font-weight: 700; color: var(--wv-text); }

.wv-fs .fs-table th.fs-num { text-align: right; }

/* Project card: schedule status (days left / overdue) */
.wv-text-muted { color: var(--wv-muted); }

.wv-timeline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wv-timeline__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.wv-timeline__row .wv-meta { margin: 0; }

.wv-timeline__status {
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}

.wv-progress--thin {
    height: 6px;
    margin-top: 0;
}

/* Dashboard: remaining balance under the utilization bar */
.wv-util-bar__foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.wv-util-bar__foot strong {
    font-size: 1rem;
    font-weight: 700;
    color: var(--wv-navy);
}

.dark .wv-util-bar__foot strong:not(.wv-text-danger) { color: #fff; }
.wv-util-bar__foot strong.wv-text-danger { color: var(--wv-red); }

/* Work note cards: always full card width, long text clamped, so cards line up
   on every screen no matter how long the note is (full text is on the details page). */
.fi-panel-eproject .wv-record .fi-ta-record-content,
.fi-panel-eproject .wv-record .fi-ta-record-content > *,
.fi-panel-eproject .wv-record .fi-ta-record-content-ctn,
.fi-panel-eproject .wv-record .fi-ta-record-content-ctn > div:first-child {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.wv-note {
    width: 100%;
    min-width: 0;
}

.wv-note__title,
.wv-note__preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.wv-note__title { -webkit-line-clamp: 2; line-clamp: 2; }
.wv-note__preview { -webkit-line-clamp: 2; line-clamp: 2; margin: 0; }

.wv-note__project span,
.wv-note__side .wv-meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wv-note__side {
    flex-shrink: 0;
    max-width: 40%;
}

.wv-note__side .wv-meta { max-width: 100%; }

.wv-note__more {
    font-size: .78rem;
    font-weight: 600;
    color: var(--wv-blue);
}

/* Very narrow phones: put status/owner under the note instead of beside it. */
@media (max-width: 360px) {
    .wv-note { flex-direction: column; }
    .wv-note__side { max-width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding-inline-end: 0; }
}

/* Dashboard (mockup fit on phones): one-line stat labels, chevron in the corner,
   budget amounts sized to their column so they never break mid-number. */
.wv-stat {
    position: relative;
    gap: 10px;
    padding: 14px 12px;
}

.wv-stat__icon {
    width: 36px;
    height: 36px;
    border-radius: 999px;
}

.wv-stat__body {
    padding-inline-end: 12px;
}

.wv-stat__chev {
    position: absolute;
    top: 12px;
    right: 8px;
}

.wv-stat__label {
    font-size: .8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wv-stat__hint {
    font-size: .75rem;
    line-height: 1.3;
}

.wv-figure {
    container-type: inline-size;
}

.wv-figure__value {
    font-size: clamp(.85rem, 9.5cqi, 1.5rem);
    white-space: nowrap;
    overflow-wrap: normal;
}

/* Narrow phones: icon above the text so labels stay whole ("Active Projects"). */
@media (max-width: 419px) {
    .wv-stat-grid .wv-stat {
        flex-direction: column;
        gap: 8px;
    }

    .wv-stat-grid .wv-stat__body {
        padding-inline-end: 0;
    }
}

/* Project card: income received and balance (income − actual cost) */
.wv-income-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--wv-line);
    font-size: .85rem;
}

.wv-income-row strong {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---------- AI reports ---------------------------------------------------- */

/* Floating "AI Report" button (Dashboard, Reports, AI Reports list) */
.wv-ai-fab,
.fi-panel-eproject .fi-header .wv-fab--ai {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 24;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 999px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #0F6E56, #0E7490);
    box-shadow: 0 10px 28px rgba(14, 116, 144, .35);
    transition: transform .15s ease, box-shadow .15s ease;
}

.wv-ai-fab:hover,
.fi-panel-eproject .fi-header .wv-fab--ai:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(14, 116, 144, .42);
}

.wv-ai-fab .wv-ico { width: 20px; height: 20px; }

@media (max-width: 1023px) {
    .wv-ai-fab,
    .fi-panel-eproject .fi-header .wv-fab--ai {
        right: 16px;
        bottom: calc(var(--wv-tabbar-h) + env(safe-area-inset-bottom) + 16px);
    }
}

.wv-ai-report {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 860px;
}

.wv-ai-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    color: var(--wv-gold);
    background: var(--wv-gold-soft);
}

.wv-ai-report__head .wv-sub { margin-top: 6px; }

.wv-ai-figures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (min-width: 640px) {
    .wv-ai-figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.wv-ai-figures > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid var(--wv-line);
    border-radius: var(--wv-radius);
    background: var(--wv-card);
}

.wv-ai-figures strong {
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wv-ai-working {
    display: flex;
    align-items: center;
    gap: 14px;
}

.wv-ai-failed p { margin-top: 6px; }

/* The report itself (Markdown from Claude) */
.wv-ai-content {
    padding: 20px 22px;
    line-height: 1.65;
    color: var(--wv-text);
    overflow-wrap: anywhere;
}

.wv-ai-content h2 {
    margin: 22px 0 8px;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--wv-navy);
}

.dark .wv-ai-content h2 { color: #fff; }
.wv-ai-content h2:first-child { margin-top: 0; }
.wv-ai-content h3 { margin: 16px 0 6px; font-weight: 700; }
.wv-ai-content p { margin: 8px 0; }
.wv-ai-content ul, .wv-ai-content ol { margin: 8px 0; padding-inline-start: 22px; }
.wv-ai-content ul { list-style: disc; }
.wv-ai-content ol { list-style: decimal; }
.wv-ai-content li { margin: 4px 0; }
.wv-ai-content strong { font-weight: 700; }

.wv-ai-content table {
    width: 100%;
    margin: 10px 0;
    border-collapse: collapse;
    font-size: .9rem;
    display: block;
    overflow-x: auto;
}

.wv-ai-content th,
.wv-ai-content td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--wv-line);
    text-align: start;
}

.wv-ai-note { font-size: .78rem; }

@media print {
    .fi-sidebar, .fi-topbar, .wv-tabbar, .wv-ai-fab, .fi-header-actions, .wv-ai-note { display: none !important; }
    .wv-ai-content { box-shadow: none; border: 0; padding: 0; }
}

/* Room under the last card so the floating AI button never covers it. */
.fi-panel-eproject .fi-body:has(.wv-ai-fab) .fi-main,
.fi-panel-eproject .fi-body:has(.wv-fab--ai) .fi-main {
    padding-bottom: 88px;
}

/* AI Reports: current plan / usage line */
.wv-ai-plan {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-inline-end: 10px;
    font-size: .88rem;
    color: var(--wv-muted);
}

.wv-ai-plan strong { color: #0F6E56; }

.wv-ai-plan--pending {
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
    color: var(--wv-gold);
    background: var(--wv-gold-soft);
}

.wv-ai-plan--rejected {
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
    color: var(--wv-red);
    background: var(--wv-red-soft);
}
