/* VisWoX component styles. Colours come only from var(--vx-*) (see tokens.css). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--vx-bg);
    color: var(--vx-text);
    font-family: var(--vx-font-body);
    font-size: 15px;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
a { color: var(--vx-link); }
:focus-visible { outline: 2px solid var(--vx-focus); outline-offset: 2px; }
.vx-muted { color: var(--vx-text-muted); }
.vx-num { font-family: var(--vx-font-display); font-weight: 600; letter-spacing: 0.02em; font-variant-numeric: tabular-nums lining-nums; }
/* Phone card labels (td::before) stay in the body face, like the labels of non-number cells. */
.vx-num::before { font-family: var(--vx-font-body); font-weight: 400; letter-spacing: normal; }
.vx-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.vx-skip { position: absolute; left: -999px; top: 0; background: var(--vx-primary); color: var(--vx-primary-text); padding: 8px 14px; z-index: 100; }
.vx-skip:focus { left: 8px; top: 8px; }

/* ---- shell ------------------------------------------------------------------------------- */
.vx-shell { display: flex; min-height: 100vh; }
.vx-main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vx-main { padding: 12px 24px 40px; flex: 1; }
.vx-main:focus { outline: none; }

.vx-sidebar {
    width: 200px; flex: none; position: sticky; top: 0; height: 100vh; z-index: 20;
    display: flex; flex-direction: column;
    background: var(--vx-rail-bg); color: var(--vx-rail-text);
    transition: width 0.15s ease;
}
.vx-sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; min-height: 56px; }
.vx-sidebar-home { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.vx-sidebar-logo { display: block; width: 100%; max-width: 168px; height: auto; }
.vx-sidebar-mark { display: none; width: 36px; height: 36px; }
.vx-icon-btn.vx-sidebar-close { display: none; }
.vx-sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.vx-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.vx-nav-item {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding: 9px 12px 9px 18px; color: var(--vx-rail-text); text-decoration: none; font-weight: 500;
}
.vx-nav-item:hover { background: var(--vx-rail-hover); color: var(--vx-rail-text-strong); }
.vx-nav-item.is-active { color: var(--vx-rail-text-strong); font-weight: 700; }
/* The orange tick: 5px wide, skewed, CSS only. Orange is "now". */
.vx-nav-item.is-active::before {
    content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 5px;
    background: var(--vx-orange); transform: skewY(-45deg);
}
/* Sections: a small label heading per group; foldable ones are buttons with a turning chevron. */
.vx-nav-group + .vx-nav-group { margin-top: 10px; }
.vx-nav-heading {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
    height: 26px; padding: 0 12px 0 18px; border: 0; background: transparent; font: inherit;
    font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
    color: var(--vx-rail-text); opacity: 0.7; text-align: left;
}
button.vx-nav-heading { cursor: pointer; }
button.vx-nav-heading:hover, button.vx-nav-heading:focus-visible { opacity: 1; color: var(--vx-rail-text-strong); }
.vx-nav-heading .vx-icon { width: 14px; height: 14px; flex: none; transition: transform 0.15s ease; }
.vx-nav-group.is-folded .vx-nav-heading .vx-icon { transform: rotate(-90deg); }
.vx-nav-group.is-folded .vx-nav-list { display: none; }
/* Edge toggle: a full-height strip on the panel edge that tints on hover, with a tall pill straddling it. */
.vx-sidebar-toggle {
    position: absolute; top: 0; bottom: 0; right: -9px; width: 14px; padding: 0;
    border: 0; background: transparent; cursor: pointer;
}
.vx-sidebar-toggle::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: 5px; width: 3px;
    background: var(--vx-orange); opacity: 0; transition: opacity 0.15s ease;
}
.vx-sidebar-toggle:hover::before, .vx-sidebar-toggle:focus-visible::before { opacity: 0.9; }
.vx-sidebar-toggle:focus-visible { outline: none; }
.vx-sidebar-pill {
    position: absolute; top: 50%; left: -2px; width: 18px; height: 56px; margin-top: -28px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--vx-border); border-radius: 9px;
    background: var(--vx-surface); color: var(--vx-text-muted); box-shadow: 0 1px 4px var(--vx-shadow);
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.vx-sidebar-pill .vx-icon { width: 14px; height: 14px; transition: transform 0.2s ease; }
.vx-sidebar-toggle:hover .vx-sidebar-pill, .vx-sidebar-toggle:focus-visible .vx-sidebar-pill {
    background: var(--vx-primary); border-color: var(--vx-primary); color: var(--vx-primary-text);
}

[data-sidebar="collapsed"] .vx-sidebar { width: 56px; }
[data-sidebar="collapsed"] .vx-nav-label,
[data-sidebar="collapsed"] .vx-sidebar-logo { display: none; }
[data-sidebar="collapsed"] .vx-sidebar-mark { display: block; }
[data-sidebar="collapsed"] .vx-sidebar-brand { justify-content: center; padding-inline: 8px; }
[data-sidebar="collapsed"] .vx-nav-item { justify-content: center; padding-inline: 0; }
[data-sidebar="collapsed"] .vx-sidebar-pill .vx-icon { transform: rotate(180deg); }
/* Icon-only rail: headings become thin dividers and every item shows, folded or not. */
[data-sidebar="collapsed"] .vx-nav-heading { display: none; }
[data-sidebar="collapsed"] .vx-nav-group + .vx-nav-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--vx-rail-hover); margin-inline: 8px; }
[data-sidebar="collapsed"] .vx-nav-group.is-folded .vx-nav-list { display: flex; }

.vx-backdrop { display: none; }

.vx-topbar {
    display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 42px;
    background: var(--vx-bg);
}
.vx-icon-btn.vx-menu-btn { display: none; }
.vx-breadcrumb { flex: 1; min-width: 0; display: flex; gap: 6px; align-items: center; font-weight: 500; color: var(--vx-text-muted); overflow: hidden; white-space: nowrap; }
.vx-breadcrumb b { color: var(--vx-text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.vx-breadcrumb a { color: var(--vx-text-muted); }
.vx-topbar-end { display: flex; align-items: center; gap: 4px; }
.vx-company-chip { display: inline-grid; place-items: center; width: 28px; height: 28px; color: var(--vx-text-muted); }
.vx-company-chip .vx-icon, .vx-ibtn .vx-icon { width: 16px; height: 16px; }
.vx-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
    background: none; border: 0; border-radius: 4px; color: inherit; cursor: pointer;
}
.vx-icon-btn:hover { background: var(--vx-row-hover); }
.vx-theme-btn .vx-icon { display: none; }
.vx-theme-btn[data-state="light"] .vx-icon-sun, .vx-theme-btn[data-state="dark"] .vx-icon-moon,
.vx-theme-btn[data-state="system"] .vx-icon-monitor { display: block; }

.vx-menu { position: relative; }
.vx-usermenu-toggle { display: flex; align-items: center; cursor: pointer; list-style: none; }
.vx-usermenu-toggle::-webkit-details-marker { display: none; }
.vx-avatar {
    display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
    background: var(--vx-navy); color: var(--vx-on-dark); font-weight: 700; font-size: 10px;
}
.vx-usermenu-who { display: flex; flex-direction: column; line-height: 1.2; }
.vx-usermenu-name { font-weight: 700; font-size: 0.9rem; }
.vx-usermenu-role { font-size: 0.75rem; color: var(--vx-text-muted); }
.vx-dropdown {
    position: absolute; top: calc(100% + 8px); min-width: 220px; z-index: 40; padding: 6px;
    background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: 6px;
    box-shadow: 0 8px 24px var(--vx-shadow);
}
.vx-dropdown-end { right: 0; }
.vx-dropdown-header { display: flex; flex-direction: column; padding: 8px 10px; font-size: 0.9rem; }
.vx-dropdown-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 4px;
    background: none; color: var(--vx-text); font: inherit; text-decoration: none; cursor: pointer; text-align: left;
}
.vx-dropdown-item:hover { background: var(--vx-row-hover); }
.vx-dropdown-divider { height: 1px; background: var(--vx-border); margin: 6px 0; }

/* ---- controls ---------------------------------------------------------------------------- */
.vx-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 30px; padding: 4px 12px;
    border: 1px solid var(--vx-border); border-radius: 3px; background: var(--vx-surface); color: var(--vx-text);
    font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.vx-btn:hover { background: var(--vx-row-hover); }
.vx-btn-primary { background: var(--vx-primary); border-color: var(--vx-primary); color: var(--vx-primary-text); }
.vx-btn-primary:hover { background: var(--vx-primary-hover); border-color: var(--vx-primary-hover); }
.vx-btn-block { width: 100%; }
.vx-btn-block { min-height: 36px; }

/* Icon buttons: 28px, label in aria-label and title. */
.vx-ibtn {
    position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; flex: none;
    border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--vx-text-muted);
    cursor: pointer; text-decoration: none; font: inherit;
}
.vx-ibtn:hover { background: var(--vx-surface-muted); color: var(--vx-text); }
.vx-ibtn-bordered { border-color: var(--vx-border); background: var(--vx-surface); }
.vx-ibtn-primary { background: var(--vx-primary); border-color: var(--vx-primary); color: var(--vx-primary-text); }
.vx-ibtn-primary:hover { background: var(--vx-primary-hover); border-color: var(--vx-primary-hover); color: var(--vx-primary-text); }
.vx-seg { display: inline-flex; border: 1px solid var(--vx-border); border-radius: 5px; overflow: hidden; background: var(--vx-surface); }
.vx-seg .vx-ibtn { border-radius: 0; border: 0; width: 28px; height: 26px; }
.vx-seg .vx-ibtn[aria-current] { background: var(--vx-navy); color: var(--vx-on-dark); }

/* Actions row: directly under the top bar. */
.vx-actionbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px;
    background: var(--vx-surface); border-bottom: 1px solid var(--vx-border);
}
.vx-actionbar:empty { display: none; }
.vx-actionbar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.vx-actionbar form { margin: 0; }
@media (max-width: 699.98px) { .vx-actionbar-end { margin-left: 0; } }

/* Subscription banner above the top bar (_sub_banner.html): orange = act now, red = locked. */
.vx-sub-banner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 14px;
    background: var(--vx-orange); color: var(--vx-primary-text);
}
.vx-sub-banner.is-locked { background: var(--vx-danger); color: var(--vx-on-dark); }
.vx-sub-banner-text { margin: 0; flex: 1 1 20rem; font-size: 0.9rem; font-weight: 500; }
.vx-sub-banner-btn {
    flex: none; padding: 5px 12px; border: 1px solid currentColor; border-radius: 3px;
    color: inherit; font-weight: 600; font-size: 0.85rem; text-decoration: none; white-space: nowrap;
}
.vx-sub-banner-btn:hover { background: var(--vx-surface); color: var(--vx-text); }
/* Locked company: write actions are greyed and inert (the server refuses them anyway), except
   inside [data-vx-allow-locked] (the banner, profile, sign-out, deactivate, report downloads).
   Searching and filtering in the action bar stay usable. */
body.vx-locked :is(
    .vx-actionbar .vx-ibtn-primary,
    .vx-actionbar [hx-target="#vx-dialog-slot"],
    .vx-actionbar button[type=submit],
    form[method=post] button[type=submit],
    [hx-post]
):not([data-vx-allow-locked], [data-vx-allow-locked] *) { opacity: 0.45; pointer-events: none; }
.vx-card { background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: 3px; padding: 16px; }
.vx-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.vx-label { font-size: 0.85rem; font-weight: 500; color: var(--vx-text-muted); }
.vx-input {
    width: 100%; padding: 9px 12px; border: 1px solid var(--vx-border); border-radius: 3px;
    background: var(--vx-surface); color: var(--vx-text); font: inherit;
}
.vx-field-error, .vx-alert-error { color: var(--vx-danger); font-size: 0.85rem; }
.vx-alert-error { background: var(--vx-danger-soft); border: 1px solid var(--vx-danger); padding: 8px 12px; border-radius: 3px; margin-bottom: 14px; }
.vx-badge-warning { background: var(--vx-warning-soft); color: var(--vx-text); border-left: 4px solid var(--vx-warning); padding: 2px 8px; }
.vx-badge-success { background: var(--vx-success-soft); color: var(--vx-text); border-left: 4px solid var(--vx-success); padding: 2px 8px; }
.vx-issues { margin: 6px 0 0; padding-left: 1.2rem; }
.vx-issues li { margin: 2px 0; overflow-wrap: anywhere; }
.vx-alias-form { align-items: flex-end; margin-bottom: 10px; }
.vx-alias-form .vx-field { flex: 1 1 14rem; min-width: 0; }
.vx-alias-form .vx-field .vx-input { flex: none; width: 100%; }

/* ---- tables ------------------------------------------------------------------------------ */
.vx-table { width: 100%; border-collapse: collapse; background: var(--vx-surface); border: 1px solid var(--vx-border); }
.vx-table th { text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--vx-text-muted); background: var(--vx-surface-muted); }
.vx-table th, .vx-table td { padding: 10px 14px; border-bottom: 1px solid var(--vx-border); }
.vx-table tbody tr:hover { background: var(--vx-row-hover); }

/* ---- login and error pages ---------------------------------------------------------------- */
.vx-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--vx-bg); }
.vx-login-card {
    width: 100%; max-width: 360px; padding: 18px 28px 22px; background: var(--vx-surface);
    border: 1px solid var(--vx-border); border-top: 5px solid var(--vx-orange); border-radius: 3px;
    box-shadow: 0 12px 32px var(--vx-shadow);
}
.vx-login-card h1 { font-size: 1.4rem; margin: 8px 0 12px; text-align: center; }
.vx-login-card p { color: var(--vx-text-muted); margin: 0 0 20px; }
.vx-login-logo { display: block; width: 100%; max-width: 230px; height: auto; margin: 0 auto; }
.vx-logo-dark { display: none; }
:root[data-theme="dark"] .vx-logo-light { display: none; }
:root[data-theme="dark"] .vx-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .vx-logo-light { display: none; }
    :root:not([data-theme="light"]) .vx-logo-dark { display: block; }
}
.vx-password { position: relative; }
.vx-password .vx-input { padding-right: 44px; }
.vx-password .vx-icon-btn { position: absolute; right: 2px; top: 0; }

/* ---- responsive -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .vx-main { padding: 16px; }
    .vx-topbar { padding-inline: 12px; }
    .vx-icon-btn.vx-menu-btn { display: inline-flex; }
    .vx-sidebar, [data-sidebar="collapsed"] .vx-sidebar {
        position: fixed; left: 0; top: 0; z-index: 60; width: 260px; transform: translateX(-100%);
        transition: transform 0.2s ease;
    }
    .vx-menu-open .vx-sidebar { transform: none; }
    [data-sidebar="collapsed"] .vx-nav-label, [data-sidebar="collapsed"] .vx-sidebar-logo { display: initial; }
    [data-sidebar="collapsed"] .vx-sidebar-mark { display: none; }
    [data-sidebar="collapsed"] .vx-nav-item { justify-content: flex-start; padding-inline: 20px 16px; }
    [data-sidebar="collapsed"] .vx-nav-heading { display: flex; }
    [data-sidebar="collapsed"] .vx-nav-group + .vx-nav-group { margin: 10px 0 0; padding-top: 0; border-top: 0; }
    [data-sidebar="collapsed"] .vx-nav-group.is-folded .vx-nav-list { display: none; }
    .vx-icon-btn.vx-sidebar-close { display: inline-flex; color: var(--vx-rail-text); }
    .vx-sidebar-toggle { display: none; }
    .vx-menu-open .vx-backdrop { display: block; position: fixed; inset: 0; z-index: 50; background: var(--vx-overlay); }
}

/* Super Admin panel */
.vx-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.vx-inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.vx-inline-form .vx-input { width: auto; flex: 1 1 9rem; min-width: 0; }
.vx-inline-form .vx-input-narrow { flex: 0 1 6rem; }
.vx-main > .vx-card { margin-bottom: 16px; }
/* Billing */
.vx-billing > .vx-card { margin-bottom: 16px; }
.vx-billing-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); align-items: start; }
.vx-billing .vx-totals { margin-top: 12px; }
.vx-change-plan { margin: 4px 0 12px; font-weight: 600; }
.vx-btn:disabled, .vx-btn:disabled:hover { background: var(--vx-surface-muted); border-color: var(--vx-border); color: var(--vx-text-muted); cursor: not-allowed; }
.vx-storage { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.vx-table-wrap { overflow-x: auto; }
@media (max-width: 767.98px) {
  .vx-stack thead { display: none; }
  .vx-stack, .vx-stack tbody, .vx-stack tr, .vx-stack td { display: block; width: 100%; }
  .vx-stack tr { border-bottom: 2px solid var(--vx-border); }
  .vx-stack td[data-label]::before { content: attr(data-label); display: block; font-size: 0.75rem; text-transform: uppercase; color: var(--vx-text-muted); }
}

/* Masters forms */
.vx-form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); align-items: start; }
.vx-form-grid > div:last-child { grid-column: 1 / -1; }

/* Projects and BOQ */
.vx-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.vx-narrow { max-width: 560px; }
.vx-head-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.vx-head-row h2 { margin: 0; overflow-wrap: anywhere; }
.vx-facts { display: grid; gap: 8px 16px; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); margin: 12px 0; }
.vx-facts dt { font-size: 0.75rem; text-transform: uppercase; color: var(--vx-text-muted); }
.vx-facts dd { margin: 0; overflow-wrap: anywhere; }
.vx-facts-strip { display: flex; flex-wrap: wrap; gap: 10px 0; margin: 4px 0; padding: 0; }
.vx-facts-strip > div { min-width: 0; padding: 0 22px; border-inline-start: 1px solid var(--vx-border); }
.vx-facts-strip > div:first-child { padding-inline-start: 4px; border-inline-start: 0; }
.vx-facts-strip dt { font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--vx-text-muted); }
.vx-facts-strip dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.vx-state { display: inline-block; padding: 1px 8px; border: 1px solid var(--vx-border); border-radius: 3px; background: var(--vx-surface-muted); }
.vx-summary { cursor: pointer; font-weight: 500; padding: 6px 0; }
.vx-disclosure + .vx-disclosure { border-top: 1px solid var(--vx-border); }
.vx-disclosure[open] > .vx-summary { margin-bottom: 8px; }
.vx-totals { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; margin-bottom: 12px; padding: 10px 14px; border-left: 4px solid var(--vx-link); background: var(--vx-surface-muted); }
.vx-row-actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.vx-row-actions form { margin: 0; }
.vx-row-actions .vx-field-error { flex-basis: 100%; }
.vx-boq .vx-boq-section td { background: var(--vx-surface-muted); }
.vx-ibtn-danger:hover { background: var(--vx-danger-soft); color: var(--vx-danger); }
.vx-drag-cell { width: 28px; padding-inline: 6px; }
.vx-drag-handle { display: inline-grid; place-items: center; color: var(--vx-text-muted); cursor: grab; }
.vx-drag-handle .vx-icon { width: 16px; height: 16px; }
.vx-boq tr.is-dragging { opacity: 0.4; }
.vx-boq tr.is-drop-before td { box-shadow: inset 0 2px 0 var(--vx-orange); }
.vx-boq tr.is-drop-after td { box-shadow: inset 0 -2px 0 var(--vx-orange); }
.vx-depth-1 { display: inline-block; padding-left: 1.25rem; }
.vx-depth-2 { display: inline-block; padding-left: 2.5rem; }
.vx-depth-3 { display: inline-block; padding-left: 3.75rem; }
@media (max-width: 767.98px) {
  .vx-boq td:empty { display: none; }
  .vx-boq tr { display: flex; flex-wrap: wrap; column-gap: 8px; }
  .vx-boq td { width: auto; border-bottom: 0; padding: 6px 8px; }
  .vx-boq td[data-label="Item"], .vx-boq td[data-label="Actions"], .vx-boq .vx-boq-edit td { flex-basis: 100%; }
  .vx-boq .vx-boq-edit { border-bottom: 2px solid var(--vx-border); }
  .vx-boq-rw tr:not(.vx-boq-edit) { border-bottom: 0; }
  .vx-depth-1, .vx-depth-2, .vx-depth-3 { padding-left: 0; }
  .vx-boq .vx-boq-section td { font-size: 1.05rem; }
}

/* Execution: progress bars, late flag, home counts (tokens only; orange stays for now/next) */
.vx-bar { display: inline-block; vertical-align: middle; width: 6rem; height: 8px; background: var(--vx-surface-muted); border: 1px solid var(--vx-border); border-radius: 999px; overflow: hidden; }
.vx-bar-fill { display: block; height: 100%; background: var(--vx-success); }
.vx-bar-pct { font-size: 0.85rem; white-space: nowrap; }
.vx-badge-late, .vx-badge-danger { background: var(--vx-danger-soft); color: var(--vx-text); border-left: 4px solid var(--vx-danger); padding: 2px 8px; white-space: nowrap; }
.vx-progress-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 12px; }
.vx-progress-head .vx-bar { width: 12rem; }
.vx-hint { font-size: 0.8rem; color: var(--vx-text-muted); }
.vx-counts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.vx-count { display: flex; align-items: baseline; gap: 8px; min-width: 9rem; padding: 10px 14px; border: 1px solid var(--vx-border); border-radius: 3px; background: var(--vx-surface-muted); color: var(--vx-text); text-decoration: none; }
.vx-count:hover { background: var(--vx-row-hover); }
.vx-count-num { font-size: 1.6rem; }
.vx-count-late { border-left: 4px solid var(--vx-danger); }
.vx-use-forms { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.vx-use-forms .vx-inline-form .vx-input { flex: 1 1 6rem; }
.vx-progress-form { margin-bottom: 14px; }

/* Gantt (schedule page). Positions are inline percentages; colours are tokens only. Orange is
 * the today line and its label and nothing else. Status colours: done --vx-success, on track
 * --vx-gantt-ok (navy, lighter in dark mode), at risk --vx-warning, late --vx-danger; the done
 * part is the solid fill, the rest the soft tint; not started is an outline. Stacking: gridlines
 * (0), links and arrows (1) under bars with their handles and dot (2), so a link's click area
 * never takes a press meant for a bar; the today line (3) stays visible and ignores the pointer.
 * Lanes and the overlay clip horizontally, so bars outside the window are cut at its edges; the
 * resize handles and the link dot sit inside the bar's own width (on a narrow bar the dot sits
 * just above its end), so a bar inside the window is always fully editable. */
.vx-schedule { padding: 0; }
.vx-gtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 10px; padding: 14px; background: var(--vx-bg); border-bottom: 1px solid var(--vx-border); }
.vx-gtile-cell { position: relative; display: flex; min-width: 0; }
.vx-gtile { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--vx-border); border-left: 4px solid var(--vx-border); border-radius: 6px; background: var(--vx-surface); color: var(--vx-text); text-decoration: none; }
.vx-gtile.is-danger { border-left-color: var(--vx-danger); }
.vx-gtile.is-warning { border-left-color: var(--vx-warning); }
.vx-gtile.is-navy { border-left-color: var(--vx-gantt-ok); }
a.vx-gtile:hover { background: var(--vx-row-hover); }
a.vx-gtile[aria-pressed="true"] { background: var(--vx-row-hover); border-color: var(--vx-gantt-ok); box-shadow: inset 0 0 0 1px var(--vx-gantt-ok); }
.vx-gtile-title { font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.vx-gtile.is-calm .vx-gtile-title { font-size: 1rem; font-weight: 600; color: var(--vx-text-muted); }
.vx-gtile-detail { font-size: 0.8rem; color: var(--vx-text-muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.vx-gtile-cell:has(.vx-gtile-more) .vx-gtile { padding-bottom: 28px; }
.vx-gtile-more { position: absolute; left: 16px; bottom: 8px; font-size: 0.8rem; color: var(--vx-link); }
.vx-gantt-closed { margin: 0; padding: 14px; background: var(--vx-bg); border-bottom: 1px solid var(--vx-border); color: var(--vx-text-muted); font-weight: 600; }
.vx-gantt-notice { margin: 0; padding: 8px 14px; border-bottom: 1px solid var(--vx-border); color: var(--vx-text-muted); font-size: 0.875rem; }
.vx-gantt-notice a { color: var(--vx-link); font-weight: 600; margin-left: 4px; }
.vx-gantt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; }
.vx-gantt-toolbar h2 { margin: 0; font-size: 1rem; }
.vx-gantt-scale { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 0.8rem; }
.vx-gswitch { display: inline-flex; padding: 2px; border: 1px solid var(--vx-border); border-radius: 8px; background: var(--vx-surface-muted); }
.vx-gswitch a { padding: 4px 14px; border-radius: 6px; color: var(--vx-text-muted); font-weight: 500; text-decoration: none; }
.vx-gswitch a:hover { color: var(--vx-text); }
.vx-gswitch a[aria-current] { background: var(--vx-surface); color: var(--vx-text); box-shadow: 0 1px 2px var(--vx-shadow); }
.vx-gantt-empty, .vx-schedule > #schedule-body > .vx-muted, .vx-schedule .vx-alert-error { margin: 0 14px 14px; }
.vx-gantt-scroll { overflow-x: auto; border-top: 1px solid var(--vx-border); }
.vx-gantt { --vx-gantt-label-w: 15rem; --vx-gantt-due-w: 4.75rem; --vx-gantt-status-w: 6.5rem; --vx-gantt-cols-w: calc(var(--vx-gantt-label-w) + var(--vx-gantt-due-w) + var(--vx-gantt-status-w)); --vx-gantt-row-h: 32px; position: relative; min-width: 720px; background: var(--vx-surface); font-size: 0.85rem; }
.vx-gantt-head, .vx-gantt-row { display: flex; }
.vx-gantt-head { height: 44px; background: var(--vx-surface-muted); border-bottom: 1px solid var(--vx-border); color: var(--vx-text-muted); font-size: 0.8rem; font-weight: 500; }
.vx-gantt-head > .vx-gantt-label, .vx-gantt-head > .vx-gantt-cell { align-items: flex-end; padding-bottom: 8px; }
.vx-gantt-label { flex: none; width: var(--vx-gantt-label-w); display: flex; align-items: center; gap: 6px; padding: 0 8px; overflow: hidden; }
.vx-gantt-cell { flex: none; display: flex; align-items: center; padding: 0 6px; overflow: hidden; white-space: nowrap; }
.vx-gantt-due-cell { width: var(--vx-gantt-due-w); }
.vx-gantt-status-cell { width: var(--vx-gantt-status-w); border-right: 1px solid var(--vx-border); }
.vx-gantt-lane { position: relative; flex: 1; min-width: 0; overflow: hidden; overflow: clip; }
.vx-gantt-tick { position: absolute; top: 0; bottom: 0; padding: 3px 0 0 6px; white-space: nowrap; }
.vx-gantt-tick.is-month { border-left: 1px solid var(--vx-border); color: var(--vx-text); font-weight: 700; }
.vx-gantt-tick.is-week { top: 22px; padding: 2px 0 0 3px; font-size: 0.7rem; font-weight: 400; }
.vx-gantt-today-label { position: absolute; z-index: 1; bottom: 3px; transform: translateX(-50%); padding: 1px 8px; border-radius: 999px; background: var(--vx-orange); color: var(--vx-primary-text); font-size: 0.7rem; font-weight: 700; white-space: nowrap; }
.vx-gantt-rows { position: relative; }
.vx-gantt-row { height: var(--vx-gantt-row-h); border-bottom: 1px solid var(--vx-surface-muted); }
.vx-gantt-row:hover { background: var(--vx-row-hover); }
.vx-gantt-row.is-late { background: var(--vx-danger-soft); }
.vx-gantt-row.is-risk { background: var(--vx-warning-soft); }
.vx-gantt-section > .vx-gantt-label, .vx-gantt-section > .vx-gantt-cell { background: var(--vx-bg); }
.vx-gantt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.vx-gantt-section .vx-gantt-name { font-weight: 700; }
.vx-gantt-due { color: var(--vx-text); }
.vx-gantt-due.is-late { color: var(--vx-danger); font-weight: 700; }
.vx-gantt-pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 7px; border-radius: 999px; background: var(--vx-surface-muted); color: var(--vx-text); font-size: 0.75rem; font-weight: 500; }
.vx-gantt-pill::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--vx-grey); }
.vx-gantt-pill.is-done { background: var(--vx-success-soft); }
.vx-gantt-pill.is-done::before { background: var(--vx-success); }
.vx-gantt-pill.is-ok { background: var(--vx-gantt-ok-soft); }
.vx-gantt-pill.is-ok::before { background: var(--vx-gantt-ok); }
.vx-gantt-pill.is-risk { background: var(--vx-warning-soft); box-shadow: inset 0 0 0 1px var(--vx-warning); }
.vx-gantt-pill.is-risk::before { background: var(--vx-warning); }
.vx-gantt-pill.is-late { background: var(--vx-danger-soft); box-shadow: inset 0 0 0 1px var(--vx-danger); }
.vx-gantt-pill.is-late::before { background: var(--vx-danger); }
/* Stalled: a small pause mark beside the name (the tooltip says for how long). */
.vx-gantt-stall { flex: none; width: 10px; height: 10px; border-left: 3px solid var(--vx-text-muted); border-right: 3px solid var(--vx-text-muted); }
.vx-gantt-early-mark { display: none; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--vx-warning); color: var(--vx-primary-text); font-weight: 700; text-align: center; line-height: 18px; }
.vx-gantt-row.is-early .vx-gantt-early-mark { display: inline-block; }
/* A bar: 16px, status border and soft tint, the done part as a solid fill. The percent is
 * written twice, once on the tint and once (clipped to the fill) on the fill, so it reads on
 * both; a bar too narrow for the text hides it (the bar is a size container). */
.vx-gantt-bar { --vx-bar: var(--vx-gantt-ok); --vx-bar-soft: var(--vx-gantt-ok-soft); --vx-bar-text: var(--vx-gantt-fill-text); container-type: inline-size; position: absolute; z-index: 2; top: 8px; height: 16px; min-width: 4px; border: 1px solid var(--vx-bar); border-radius: 4px; background: var(--vx-bar-soft); touch-action: none; }
.vx-gantt-bar.is-done { --vx-bar: var(--vx-success); --vx-bar-soft: var(--vx-success-soft); }
.vx-gantt-bar.is-risk { --vx-bar: var(--vx-warning); --vx-bar-soft: var(--vx-warning-soft); --vx-bar-text: var(--vx-primary-text); }
.vx-gantt-bar.is-late { --vx-bar: var(--vx-danger); --vx-bar-soft: var(--vx-danger-soft); }
.vx-gantt-bar.is-future { --vx-bar-soft: var(--vx-surface); border-width: 1.5px; }
.vx-gantt-row.is-critical .vx-gantt-bar { outline: 2px solid var(--vx-text); outline-offset: 1px; }
.vx-gantt-row.is-early .vx-gantt-bar { border-color: var(--vx-warning); border-style: dashed; }
.vx-gantt-done { position: absolute; top: 0; bottom: 0; left: 0; max-width: 100%; overflow: hidden; border-radius: 3px; background: var(--vx-bar); pointer-events: none; }
.vx-gantt-pct { position: absolute; top: 0; left: 5px; line-height: 14px; font-size: 0.66rem; font-weight: 700; white-space: nowrap; color: var(--vx-text); pointer-events: none; }
.vx-gantt-done .vx-gantt-pct { color: var(--vx-bar-text); }
@container (max-width: 44px) { .vx-gantt-pct { display: none; } }
.vx-gantt-overdue { position: absolute; z-index: 2; top: 10px; height: 12px; border: 1px solid var(--vx-danger); border-left: 0; background: repeating-linear-gradient(45deg, var(--vx-danger) 0 2px, var(--vx-danger-soft) 2px 6px); pointer-events: none; }
/* Section: a bracket (ends turned down) over the children's span. */
.vx-gantt-summary { position: absolute; top: 10px; height: 8px; border: 3px solid var(--vx-gantt-ok); border-bottom: 0; border-radius: 2px 2px 0 0; }
.vx-gantt-overlay { position: absolute; top: 0; bottom: 0; left: var(--vx-gantt-cols-w); right: 0; pointer-events: none; overflow: hidden; overflow: clip; }
.vx-gantt-grid { position: absolute; z-index: 0; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--vx-surface-muted); }
.vx-gantt-grid.is-month { border-left-color: var(--vx-border); }
.vx-gantt-arrow { position: absolute; z-index: 1; width: 0; height: 0; margin: -3.5px 0 0 -7px; border-style: solid; border-width: 3.5px 0 3.5px 7px; border-color: transparent transparent transparent var(--vx-gantt-ok); }
.vx-gantt-arrow.is-risk { border-left-color: var(--vx-danger); }
/* Edge text for a bar wholly outside the window: a chip above the links so a connector passing
 * to that bar never strikes the words through. */
.vx-gantt-edge { position: absolute; z-index: 2; top: 7px; padding: 0 6px; border-radius: 4px; background: var(--vx-surface); line-height: 18px; white-space: nowrap; font-size: 0.75rem; color: var(--vx-text-muted); }
.vx-gantt-edge.is-before { left: 2px; }
.vx-gantt-edge.is-after { right: 2px; }
.vx-gantt-today { position: absolute; z-index: 3; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--vx-orange); }
.vx-gantt-links { position: absolute; z-index: 1; top: 0; left: 0; overflow: visible; }
.vx-gantt-link-line { fill: none; stroke: var(--vx-gantt-ok); stroke-width: 1.5; stroke-linejoin: round; }
.vx-gantt-link.is-risk .vx-gantt-link-line { stroke: var(--vx-danger); }
.vx-gantt-link.is-critical .vx-gantt-link-line { stroke-width: 2.5; }
.vx-gantt-link-hit { fill: none; stroke: var(--vx-text); stroke-opacity: 0; stroke-width: 10; }
.vx-gantt-temp { fill: none; stroke: var(--vx-gantt-ok); stroke-width: 1.5; stroke-dasharray: 4 3; }
/* Legend under the chart: one key per colour and mark the chart uses. */
.vx-gantt-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 10px 14px; list-style: none; border-top: 1px solid var(--vx-border); color: var(--vx-text-muted); font-size: 0.8rem; }
.vx-gantt-legend li { display: inline-flex; align-items: center; gap: 6px; }
.vx-gkey { flex: none; width: 22px; height: 10px; border-radius: 3px; border: 1px solid var(--vx-gantt-ok); background: var(--vx-gantt-ok); }
.vx-gkey.is-done { border-color: var(--vx-success); background: var(--vx-success); }
.vx-gkey.is-risk { border-color: var(--vx-warning); background: var(--vx-warning); }
.vx-gkey.is-late { border-color: var(--vx-danger); background: var(--vx-danger); }
.vx-gkey.is-overdue { border-color: var(--vx-danger); border-radius: 0; background: repeating-linear-gradient(45deg, var(--vx-danger) 0 2px, var(--vx-danger-soft) 2px 6px); }
.vx-gkey.is-future { border-width: 1.5px; background: var(--vx-surface); }
.vx-gkey.is-critical { background: var(--vx-gantt-ok-soft); outline: 2px solid var(--vx-text); outline-offset: 1px; }
.vx-gkey.is-stalled { width: 10px; border: 0; border-left: 3px solid var(--vx-text-muted); border-right: 3px solid var(--vx-text-muted); border-radius: 0; background: none; }
/* Editing affordances: gantt.js adds them only for the Project Manager on wide screens. */
.vx-gantt.is-live .vx-gantt-bar { cursor: grab; }
.vx-gantt.is-busy .vx-gantt-bar { cursor: progress; }
.vx-gantt.is-live .vx-gantt-bar.is-dragging { cursor: grabbing; box-shadow: 0 2px 6px var(--vx-shadow); }
.vx-gantt.is-live .vx-gantt-link-hit { pointer-events: stroke; cursor: pointer; }
.vx-gantt.is-live .vx-gantt-link:hover .vx-gantt-link-line { stroke: var(--vx-danger); stroke-width: 2.5; }
.vx-gantt-handle { position: absolute; z-index: 1; top: -3px; bottom: -3px; width: 7px; cursor: ew-resize; }
.vx-gantt-handle-start { left: -1px; }
.vx-gantt-handle-end { right: -1px; }
.vx-gantt-dot { position: absolute; z-index: 2; right: 7px; top: 2px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--vx-gantt-ok); background: var(--vx-surface); box-shadow: 0 0 0 1px var(--vx-surface); cursor: crosshair; }
/* A bar too narrow to hold the dot beside its end handle: the dot sits just above the bar's
 * end, still inside the bar's own width and the row's lane, so it is never clipped at the
 * window's right edge and the end handle keeps the bar's full height below it. */
@container (max-width: 40px) { .vx-gantt-dot { right: -1px; top: -9px; } }
/* The link dot appears on a bar's hover or focus only (it still takes the press while hidden). */
.vx-gantt-dot { opacity: 0; }
.vx-gantt-bar:hover .vx-gantt-dot, .vx-gantt-bar:focus-within .vx-gantt-dot, .vx-gantt-bar.is-dragging .vx-gantt-dot { opacity: 1; }
.vx-gantt-bar:hover .vx-gantt-dot, .vx-gantt-dot:focus-visible { background: var(--vx-gantt-ok); }
@media (prefers-reduced-motion: no-preference) {
  .vx-gtile, .vx-gswitch a { transition: background-color 120ms ease, box-shadow 120ms ease; }
}
.vx-toast { position: fixed; right: 16px; bottom: 16px; z-index: 70; max-width: min(28rem, calc(100vw - 32px)); padding: 10px 14px; border-radius: 3px; background: var(--vx-surface); color: var(--vx-text); border: 1px solid var(--vx-border); border-left: 4px solid var(--vx-danger); box-shadow: 0 4px 12px var(--vx-shadow); }
.vx-gantt-toast { position: fixed; right: 16px; bottom: 16px; z-index: 50; max-width: min(28rem, calc(100vw - 32px)); display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 3px; background: var(--vx-surface); color: var(--vx-text); border: 1px solid var(--vx-border); border-left: 4px solid var(--vx-success); box-shadow: 0 4px 12px var(--vx-shadow); }
.vx-gantt-toast[hidden] { display: none; }
.vx-gantt-toast.is-error { border-left-color: var(--vx-danger); }
.vx-gantt-toast.is-warning { border-left-color: var(--vx-warning); }
.vx-gantt-unscheduled { margin: 8px 0 0; padding-left: 20px; }
@media (max-width: 699.98px) {
  .vx-gantt { --vx-gantt-label-w: 9rem; --vx-gantt-due-w: 3.75rem; --vx-gantt-status-w: 1.75rem; min-width: 560px; }
  .vx-gantt-status-cell { padding: 0; justify-content: center; }
  .vx-gantt-head .vx-gantt-status-cell { font-size: 0; }
  .vx-gantt-pill { padding: 0; width: 15px; height: 15px; justify-content: center; }
  .vx-gantt-pill-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .vx-gtiles { padding: 10px; gap: 8px; }
  .vx-gantt-scale { margin-left: 0; }
}
.vx-badge-info { background: var(--vx-surface-muted); color: var(--vx-text); border-left: 4px solid var(--vx-link); padding: 2px 8px; white-space: nowrap; }

/* Per-project dashboard (tokens only). Bands: green/amber/red/grey = success/warning/danger/muted;
 * orange stays reserved for "now/next". Cards reflow to one column on a phone. */
.vx-dash-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.vx-dash-head h2 { overflow-wrap: anywhere; }
.vx-dash-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.vx-dash-pills li { padding: 4px 12px; border: 1px solid var(--vx-border); border-radius: 999px; background: var(--vx-surface); }
.vx-dash-pills li.is-red { border-color: var(--vx-danger); background: var(--vx-danger-soft); }
.vx-dash-pill-label { font-size: 0.8rem; color: var(--vx-text-muted); }
.vx-dash { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .vx-dash { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); } }
.vx-dash-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); align-content: start; }
.vx-dash-wide { grid-column: 1 / -1; min-width: 0; }
.vx-dash-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.vx-dash-cards > .vx-card, .vx-dash-side > .vx-card { min-width: 0; }
.vx-dash-title { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--vx-text-muted); margin-bottom: 10px; }
.vx-dash .vx-head-row { margin-bottom: 10px; }
.vx-dash .vx-head-row .vx-dash-title { margin-bottom: 0; }
.vx-dash-big { font-size: 2.4rem; margin: 0; line-height: 1.1; }
.vx-dash-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.vx-dash-task-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; justify-content: space-between; }
.vx-dash-task-name { overflow-wrap: anywhere; min-width: 0; }
.vx-bar-full { width: calc(100% - 3.5rem); }
.vx-band { display: inline-block; padding: 1px 8px; border-left: 4px solid var(--vx-border); background: var(--vx-surface-muted); color: var(--vx-text); white-space: nowrap; font-size: 0.85rem; }
.vx-band-green { border-left-color: var(--vx-success); background: var(--vx-success-soft); }
.vx-band-amber { border-left-color: var(--vx-warning); background: var(--vx-warning-soft); }
.vx-band-red { border-left-color: var(--vx-danger); background: var(--vx-danger-soft); }
.vx-band-grey { border-left-color: var(--vx-grey); }
.vx-gauge { margin: 0 auto; max-width: 14rem; text-align: center; }
.vx-gauge svg { display: block; width: 100%; height: auto; }
.vx-gauge path { fill: none; stroke-width: 12; stroke-linecap: butt; }
.vx-gauge-track { stroke: var(--vx-surface-muted); }
.vx-gauge-value.is-green { stroke: var(--vx-success); }
.vx-gauge-value.is-amber { stroke: var(--vx-warning); }
.vx-gauge-value.is-red { stroke: var(--vx-danger); }
.vx-gauge figcaption { display: flex; flex-direction: column; margin-top: -8px; }
.vx-gauge-pct { font-size: 1.8rem; }
.vx-dash-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.vx-dash-counts > div { padding: 6px 8px; border-left: 4px solid var(--vx-border); background: var(--vx-surface-muted); min-width: 0; }
.vx-dash-counts > div.is-green { border-left-color: var(--vx-success); }
.vx-dash-counts > div.is-amber { border-left-color: var(--vx-warning); }
.vx-dash-counts > div.is-red { border-left-color: var(--vx-danger); }
.vx-dash-counts dt { font-size: 0.75rem; color: var(--vx-text-muted); }
.vx-dash-counts dd { margin: 0; font-size: 1.4rem; }
.vx-dash-facts { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.vx-dash-facts > div { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; align-items: baseline; }
.vx-dash-facts dt { color: var(--vx-text-muted); font-size: 0.85rem; }
.vx-dash-facts dd { margin: 0; overflow-wrap: anywhere; }
.vx-dash-money { border-left: 4px solid var(--vx-border); }
.vx-dash-money.is-green { border-left-color: var(--vx-success); }
.vx-dash-money.is-amber { border-left-color: var(--vx-warning); }
.vx-dash-money.is-red { border-left-color: var(--vx-danger); }
.vx-dash-boq .vx-dash-section td { background: var(--vx-surface-muted); }
.vx-dash-boq .vx-dash-group td { font-weight: 600; }
/* Overall dashboard: budget-vs-actual bars and the timeline (inline SVG, tokens only; orange
 * only for the today marker). */
.vx-pf-bars, .vx-tl-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.vx-pf-bar, .vx-tl-row { display: grid; gap: 4px 12px; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 700px) {
    .vx-pf-bar { grid-template-columns: minmax(0, 10rem) minmax(0, 1fr) minmax(0, 16rem); }
    .vx-tl-row, .vx-tl-axis-row { grid-template-columns: minmax(0, 10rem) minmax(0, 1fr) minmax(0, 6rem); }
}
.vx-pf-name, .vx-tl-name { overflow-wrap: anywhere; min-width: 0; }
.vx-pf-fig { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 0.85rem; }
.vx-pf-svg, .vx-tl-svg { display: block; width: 100%; height: 14px; overflow: visible; }
.vx-pf-track, .vx-tl-track { fill: var(--vx-surface-muted); }
.vx-pf-budget { fill: var(--vx-border); }
.vx-pf-actual.is-green, .vx-tl-bar.is-green { fill: var(--vx-success); }
.vx-pf-actual.is-amber, .vx-tl-bar.is-amber { fill: var(--vx-warning); }
.vx-pf-actual.is-red, .vx-tl-bar.is-red { fill: var(--vx-danger); }
.vx-pf-actual.is-grey, .vx-tl-bar.is-grey { fill: var(--vx-grey); }
.vx-tl-today { stroke: var(--vx-orange); stroke-width: 2px; stroke-dasharray: 3 2; }
.vx-tl-axis-row { display: grid; gap: 4px 12px; grid-template-columns: minmax(0, 1fr); margin-bottom: 6px; font-size: 0.8rem; color: var(--vx-text-muted); }
.vx-tl-axis { position: relative; display: flex; justify-content: space-between; gap: 8px; min-height: 2.4em; }
.vx-tl-axis-today { position: absolute; bottom: 0; transform: translateX(-50%); white-space: nowrap; color: var(--vx-text); }
.vx-pf-table .vx-band { font-variant-numeric: tabular-nums; }
.vx-dash-counts.vx-pf-counts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }

/* Reports page: report list (left) and the open report's filters (right). Tokens only; orange
 * is the open report's tick. Search and paging of the list come from reports.js. */
.vx-reports { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .vx-reports { grid-template-columns: minmax(0, 19rem) minmax(0, 1fr); } }
.vx-rlist { background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: 3px; min-width: 0; }
.vx-rlist-head { display: flex; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--vx-border); }
.vx-rlist-head:not(:has(> :not([hidden]))) { display: none; }
.vx-rlist-search { flex: 1; min-width: 0; color: var(--vx-text-muted); padding-inline-end: 6px; }
.vx-rlist-search .vx-icon { width: 16px; height: 16px; }
.vx-rlist-search[hidden], .vx-rlist-pager[hidden] { display: none; }
.vx-rlist-pager { display: flex; align-items: center; gap: 2px; flex: none; margin-inline-start: auto; }
.vx-rlist-count { margin-inline-end: 4px; font-size: 0.8rem; color: var(--vx-text-muted); white-space: nowrap; }
.vx-rlist-pager .vx-ibtn[disabled] { opacity: 0.4; cursor: default; }
.vx-rlist-items { list-style: none; margin: 0; padding: 4px 0; }
.vx-rlist-items > li[hidden] { display: none; }
.vx-rlist-link { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 9px 14px; color: var(--vx-text); text-decoration: none; }
.vx-rlist-link:hover { background: var(--vx-row-hover); }
.vx-rlist-link.is-active { background: var(--vx-row-hover); }
.vx-rlist-link.is-active .vx-rlist-name { font-weight: 700; }
.vx-rlist-link.is-active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; background: var(--vx-orange); }
.vx-rlist-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 5px; background: var(--vx-surface-muted); color: var(--vx-link); }
.vx-rlist-icon .vx-icon { width: 17px; height: 17px; }
.vx-rlist-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.vx-rlist-name { overflow-wrap: anywhere; }
.vx-rlist-name mark { background: var(--vx-warning-soft); color: inherit; padding: 0; }
.vx-rlist-sub { color: var(--vx-text-muted); font-size: 0.8rem; }
.vx-rlist-empty { margin: 0; padding: 20px 14px; text-align: center; color: var(--vx-text-muted); font-size: 0.9rem; }
.vx-rlist-empty[hidden] { display: none; }

.vx-report-panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 20px; }
.vx-report-head h2 { font-size: 1.25rem; overflow-wrap: anywhere; }
.vx-report-head p { margin: 4px 0 0; }
.vx-report-panel .vx-alert-error { margin: 0; }
.vx-report-form .vx-field { margin-bottom: 16px; }
.vx-report-row { display: flex; flex-wrap: wrap; gap: 0 32px; }
.vx-report-form fieldset { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.vx-report-form legend { padding: 0; margin-bottom: 4px; }
.vx-report-foot { display: flex; justify-content: flex-end; padding-top: 14px; border-top: 1px solid var(--vx-border); }
.vx-report-foot .vx-icon { width: 18px; height: 18px; }

/* Project picker: a <details> dropdown of checkboxes; ticked projects show as chips. */
.vx-picker { position: relative; }
.vx-picker-box {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 40px; padding: 5px 8px 5px 10px;
    list-style: none; cursor: pointer; background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: 3px;
}
.vx-picker-box::-webkit-details-marker { display: none; }
.vx-picker-box:hover { border-color: var(--vx-text-muted); }
.vx-picker[open] > .vx-picker-box { border-color: var(--vx-link); }
.vx-picker-chips { display: contents; }
.vx-picker-all[hidden] { display: none; }
.vx-picker-caret { margin-inline-start: auto; display: inline-flex; color: var(--vx-text-muted); }
.vx-picker-caret .vx-icon { width: 16px; height: 16px; transition: transform 0.15s ease; }
.vx-picker[open] .vx-picker-caret .vx-icon { transform: rotate(180deg); }
.vx-picker-drop { left: 0; right: 0; top: calc(100% + 4px); display: flex; flex-direction: column; gap: 6px; }
.vx-picker-search { padding: 6px 10px; }
.vx-picker-search[hidden] { display: none; }
.vx-picker-list { max-height: 16rem; overflow-y: auto; display: flex; flex-direction: column; }
.vx-picker-opt { cursor: pointer; }
.vx-picker-opt[hidden] { display: none; }
.vx-picker-opt input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--vx-navy); }
.vx-picker-none { margin: 4px 10px; }
.vx-picker-none[hidden] { display: none; }
.vx-picker-foot { display: flex; justify-content: flex-end; }
.vx-picker-foot:not(:has(> :not([hidden]))) { display: none; }
.vx-picker-foot > [hidden] { display: none; }

/* Segmented toggle built on checkboxes (labour types). */
.vx-toggle { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--vx-border); border-radius: 5px; overflow: hidden; background: var(--vx-surface); }
.vx-toggle-opt { position: relative; display: inline-flex; cursor: pointer; }
.vx-toggle-opt + .vx-toggle-opt { border-inline-start: 1px solid var(--vx-border); }
.vx-toggle-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.vx-toggle-opt > span { padding: 6px 14px; font-size: 0.9rem; color: var(--vx-text-muted); }
.vx-toggle-opt:hover > span { background: var(--vx-row-hover); color: var(--vx-text); }
.vx-toggle-input:checked + span { background: var(--vx-navy); color: var(--vx-on-dark); font-weight: 500; }
.vx-toggle-input:focus-visible + span { outline: 2px solid var(--vx-focus); outline-offset: -2px; }

.vx-date-row { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.vx-date-opt { display: flex; align-items: center; gap: 8px; }
.vx-date-opt .vx-input { width: auto; padding: 6px 10px; }
.vx-picker-x { border: 0; background: none; font: inherit; cursor: pointer; }
.vx-date-opt > .vx-hint { min-width: 2.2rem; }

/* ---- import wizard: upload step (template cards, sheet picture, drop zone) ---------------- */
.vx-btn-dark { background: var(--vx-btn-dark); border-color: var(--vx-btn-dark); color: var(--vx-on-dark); }
.vx-btn-dark:hover { background: var(--vx-btn-dark-hover); border-color: var(--vx-btn-dark-hover); }
.vx-import-step { min-width: 0; }
.vx-guide-step { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; font-size: 1rem; }
.vx-guide-step:first-of-type { margin-top: 0; }
.vx-guide-num {
    display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none;
    border-radius: 50%; background: var(--vx-btn-dark); color: var(--vx-on-dark); font-size: 0.75rem;
}
.vx-guide-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 12px; }
.vx-guide-card {
    position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px; padding-right: 7.5rem;
    border: 1px solid var(--vx-border); border-radius: 6px; background: var(--vx-surface); cursor: pointer;
}
.vx-guide-card:hover { background: var(--vx-row-hover); }
.vx-guide-radio:checked + .vx-guide-card { border-color: var(--vx-focus); box-shadow: inset 0 0 0 1px var(--vx-focus); background: var(--vx-orange-soft); }
.vx-guide-radio:focus-visible + .vx-guide-card { outline: 2px solid var(--vx-focus); outline-offset: 2px; }
.vx-guide-text { display: flex; flex-direction: column; min-width: 0; }
.vx-guide-text .vx-muted { font-size: 0.85rem; }
.vx-guide-dl { position: absolute; top: 8px; right: 8px; min-height: 26px; padding: 2px 10px; font-size: 0.8rem; }
.vx-guide-dl svg { width: 14px; height: 14px; }
.vx-guide-sketch { display: flex; flex-direction: column; gap: 4px; flex: none; width: 52px; padding: 6px; border-radius: 4px; background: var(--vx-surface-muted); }
.vx-guide-sketch i { display: block; height: 5px; border-radius: 2px; background: var(--vx-grey); }
.vx-guide-sketch-nested i:first-child { background: var(--vx-text-muted); }
.vx-guide-sketch-nested i + i { margin-left: 12px; }
/* :has shows the chosen card's picture and Template button; without :has both show. */
.vx-import-step:has(#guide-linear:checked) [data-kind=nested],
.vx-import-step:has(#guide-nested:checked) [data-kind=linear],
.vx-import-step:has(#guide-linear:checked) [for=guide-nested] .vx-guide-dl,
.vx-import-step:has(#guide-nested:checked) [for=guide-linear] .vx-guide-dl { display: none; }
.vx-guide-picture + .vx-guide-picture { margin-top: 12px; }

.vx-sheet-box { border: 1px solid var(--vx-border); border-radius: 4px; overflow: hidden; background: var(--vx-surface); }
.vx-sheet { overflow-x: auto; }
.vx-guide-picture:has(.vx-sheet-radio[value=boq]:checked) .vx-sheet[data-sheet=bom],
.vx-guide-picture:has(.vx-sheet-radio[value=bom]:checked) .vx-sheet[data-sheet=boq],
.vx-guide-picture:has(.vx-sheet-radio[value=boq]:checked) .vx-legend[data-sheet=bom],
.vx-guide-picture:has(.vx-sheet-radio[value=bom]:checked) .vx-legend[data-sheet=boq] { display: none; }
.vx-sheet-grid { border-collapse: collapse; width: 100%; font-size: 0.8rem; }
.vx-sheet-grid th, .vx-sheet-grid td { padding: 4px 8px; border: 1px solid var(--vx-border); white-space: nowrap; text-align: left; }
.vx-sheet-letters th, .vx-sheet-grid th[scope=row] {
    background: var(--vx-surface-muted); color: var(--vx-text-muted); font-weight: 400; text-align: center; font-size: 0.7rem;
}
.vx-sheet-grid th[scope=row] { width: 24px; }
.vx-sheet-head td { background: var(--vx-sheet-head); color: var(--vx-on-dark); font-weight: 700; }
.vx-sheet-head td.is-optional { background: var(--vx-sheet-head-optional); }
.vx-sheet-section td { background: var(--vx-sheet-section); font-weight: 700; }
.vx-sheet-grid td.is-text { background: var(--vx-sheet-text); }
.vx-sheet-req, .vx-sheet-arrow { color: var(--vx-orange); font-weight: 700; }
.vx-sheet-tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 6px; border-top: 1px solid var(--vx-border); background: var(--vx-surface-muted); font-size: 0.8rem; }
.vx-sheet-tabs label { padding: 4px 12px; color: var(--vx-text-muted); cursor: pointer; border-bottom: 2px solid transparent; }
.vx-sheet-radio:checked + label { background: var(--vx-surface); color: var(--vx-success); font-weight: 700; border-bottom-color: var(--vx-success); }
.vx-sheet-radio:focus-visible + label { outline: 2px solid var(--vx-focus); outline-offset: -2px; }
.vx-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 2px; padding: 0; list-style: none; font-size: 0.8rem; color: var(--vx-text-muted); }
.vx-sw { display: inline-block; width: 12px; height: 12px; margin-right: 4px; border: 1px solid var(--vx-border); border-radius: 2px; vertical-align: -1px; }
.vx-sw-optional { background: var(--vx-sheet-head-optional); }
.vx-sw-text { background: var(--vx-sheet-text); }
.vx-sw-section { background: var(--vx-sheet-section); }

.vx-drop {
    display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 16px; text-align: center;
    border: 2px dashed var(--vx-border); border-radius: 6px; color: var(--vx-text-muted); cursor: pointer;
}
.vx-drop:hover { border-color: var(--vx-text-muted); }
.vx-drop:focus-within { border-color: var(--vx-focus); }
.vx-drop strong { color: var(--vx-text); }
.vx-drop-input { max-width: 100%; color: var(--vx-text); font: inherit; }
.vx-import-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ---- import wizard: Match columns and Review ----------------------------------------------- */
.vx-match { display: grid; grid-template-columns: minmax(9rem, 13rem) minmax(0, 1fr); gap: 16px; }
@media (max-width: 640px) { .vx-match { grid-template-columns: minmax(0, 1fr); } }
.vx-match-file { display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; min-width: 0; }
.vx-match-name { overflow-wrap: anywhere; }
.vx-match select { max-width: 100%; }
.vx-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 10px 0; border-bottom: 1px solid var(--vx-border); }
.vx-tab { padding: 6px 14px; color: var(--vx-text-muted); cursor: pointer; border-bottom: 2px solid transparent; }
.vx-tab-radio:checked + .vx-tab { color: var(--vx-text); font-weight: 700; border-bottom-color: var(--vx-orange); }
.vx-tab-radio:focus-visible + .vx-tab { outline: 2px solid var(--vx-focus); outline-offset: -2px; }
.vx-import-step:has(#match-sheet-boq:checked) .vx-sheet-pane[data-sheet=bom],
.vx-import-step:has(#match-sheet-bom:checked) .vx-sheet-pane[data-sheet=boq],
.vx-import-step:has(#rv-boq:checked) .vx-review-pane[data-sheet=bom],
.vx-import-step:has(#rv-bom:checked) .vx-review-pane[data-sheet=boq],
.vx-import-step:has(#rv-problems:checked) tbody tr:not(.vx-row-problem) { display: none; }
.vx-review-head { margin: 0 0 8px; font-size: 1rem; }
.vx-review-ok { margin: 0 0 8px; }
.vx-issue-group { display: flex; flex-direction: column; margin: 6px 0; padding: 6px 10px; border-left: 4px solid var(--vx-danger); background: var(--vx-danger-soft); color: var(--vx-text); }
.vx-row-problem { background: var(--vx-danger-soft); }
.vx-row-section td { font-weight: 700; }
.vx-autopay-opt { flex-basis: 100%; }
.vx-autopay-opt input:disabled { cursor: not-allowed; }
.vx-autopay-opt label:has(input:disabled) { color: var(--vx-text-muted); }
.vx-autopay-line { margin: 12px 0 0; }

/* ---- task calendar (view-only span bars). Tokens only: late uses danger, due today the orange
 * "now/next", done success, upcoming the link colour; today's cell is outlined in orange. A week
 * row is a 7-column grid whose rows the template sets (dates, lanes, "+N more", filler). The
 * month grid scrolls inside its own box on a phone; the week grid always fits the width. ---- */
.vx-cal { min-width: 0; }
.vx-cal-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.vx-cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.vx-cal-title { margin: 0 0 0 6px; font-size: 1.1rem; }
.vx-cal-period { display: inline-flex; border: 1px solid var(--vx-border); border-radius: 5px; overflow: hidden; background: var(--vx-surface); }
.vx-cal-period a { padding: 3px 12px; color: var(--vx-text); text-decoration: none; font-size: 0.85rem; }
.vx-cal-period a:hover { background: var(--vx-surface-muted); }
.vx-cal-period a[aria-current] { background: var(--vx-navy); color: var(--vx-on-dark); }
.vx-cal-undated { margin: 0 0 8px; font-size: 0.85rem; }
.vx-cal-scroll { max-width: 100%; overflow-x: auto; }
.vx-cal-grid { border: 1px solid var(--vx-border); border-radius: 3px; background: var(--vx-surface); }
.vx-cal-p-month .vx-cal-grid { min-width: 42rem; }
.vx-cal-head, .vx-cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.vx-cal-head { background: var(--vx-surface-muted); color: var(--vx-text-muted); font-size: 0.75rem; font-weight: 700; text-align: center; }
.vx-cal-head span { padding: 4px 2px; }
.vx-cal-week { border-top: 1px solid var(--vx-border); }
.vx-cal-p-month .vx-cal-week { min-height: 6.5rem; }
.vx-cal-p-week .vx-cal-week { min-height: 16rem; }
.vx-cal-day { border-left: 1px solid var(--vx-border); }
.vx-cal-day:first-child { border-left: 0; }
.vx-cal-out { background: var(--vx-surface-muted); }
.vx-cal-today { outline: 2px solid var(--vx-orange); outline-offset: -2px; }
.vx-cal-date { padding: 2px 6px; font-size: 0.8rem; color: var(--vx-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vx-cal-date[aria-current] { color: var(--vx-text); font-weight: 700; }
.vx-cal-hday { display: block; color: var(--vx-text); font-size: 0.85rem; }
.vx-cal-hnow { color: var(--vx-text); }
.vx-cal-hnow .vx-cal-hday { text-decoration: underline 2px var(--vx-orange); text-underline-offset: 3px; }
.vx-cal-p-week .vx-cal-week { padding-top: 2px; }
.vx-cal-item {
    position: relative; z-index: 1; display: flex; min-width: 0; margin: 1px 2px; padding: 1px 4px;
    border: 0; border-left: 3px solid var(--vx-link); border-radius: 3px; background: var(--vx-row-hover);
    color: var(--vx-text); font-size: 0.75rem; line-height: 1.35; text-decoration: none; white-space: nowrap; overflow: hidden;
}
.vx-cal-item:hover { text-decoration: underline; }
.vx-cal-item:focus-visible { outline: 2px solid var(--vx-focus); outline-offset: 1px; }
.vx-cal-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.vx-cal-p-week .vx-cal-item { white-space: normal; overflow-wrap: anywhere; }
.vx-cal-from { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.vx-cal-on { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.vx-cal-late { border-left-color: var(--vx-danger); background: var(--vx-danger-soft); }
.vx-cal-due { border-left-color: var(--vx-orange); background: var(--vx-orange-soft); }
.vx-cal-done { border-left-color: var(--vx-success); background: var(--vx-success-soft); }
.vx-cal-not_started, .vx-cal-in_progress { border-left-color: var(--vx-link); background: var(--vx-row-hover); }
.vx-cal-more { z-index: 1; padding: 0 6px; font-size: 0.75rem; color: var(--vx-text-muted); white-space: nowrap; }
.vx-cal-legend .vx-sw { border-left-width: 4px; }
