/* ==========================================================================
   VitiAgri UI: shared components for the module-by-module UI upgrade.

   Rules of the road
   - Everything here is opt-in: a class only applies where a page uses it.
     Pages that haven't been upgraded yet are unaffected.
   - Every class is prefixed va- (not me-, which clashes with Bootstrap 5's
     margin utilities such as me-2).
   - Take colours, radii and type sizes from the tokens below instead of
     hard-coding them.
   - Blade wrappers for these live in resources/views/components/va/.
   ========================================================================== */

:root {
    /* Brand greens */
    --va-green-900: #1c3829;   /* header bar */
    --va-green-800: #1b5e20;   /* titles, values */
    --va-green-700: #2e7d32;   /* primary actions, accents */
    --va-green-600: #28682F;   /* links */
    --va-green-100: #e8f5e9;   /* tints */
    --va-green-50:  #f0f7f0;   /* hover / soft fills */

    /* Neutrals */
    --va-text:        #272727;
    --va-text-strong: #111111;
    --va-muted:       #6b6b6b;
    --va-subtle:      #6f6f6f;   /* hints, footer: lightest grey that still passes 4.5:1 on the page */
    --va-label:       #555555;
    --va-border:      #e3e8e3;
    --va-border-soft: #e8ece8;
    --va-input-border:#d6d6d6;
    --va-bg:          #F9FAF9;
    --va-surface:     #ffffff;

    /* Status tones: soft pill background / text. Every pair is >= 4.5:1
       (checked by tests/Unit/VaContrastTest.php). */
    --va-success-bg: #e8f5e9;  --va-success-fg: #2e7d32;
    --va-warning-bg: #fff3e0;  --va-warning-fg: #b23c00;
    --va-danger-bg:  #ffebee;  --va-danger-fg:  #c62828;
    --va-info-bg:    #e3f2fd;  --va-info-fg:    #1565c0;
    --va-neutral-bg: #eef0ee;  --va-neutral-fg: #555555;
    --va-accent-bg:  #f3e5f5;  --va-accent-fg:  #6a1b9a;

    /* KPI tile tones: gradient start, gradient end, icon circle, value */
    --va-kpi-green-a: #e8f5e9; --va-kpi-green-b: #c8e6c9; --va-kpi-green-icon: #2e7d32; --va-kpi-green-value: #1b5e20;
    --va-kpi-blue-a:  #e3f2fd; --va-kpi-blue-b:  #bbdefb; --va-kpi-blue-icon:  #1565c0; --va-kpi-blue-value:  #0d47a1;
    --va-kpi-amber-a: #fff8e1; --va-kpi-amber-b: #ffecb3; --va-kpi-amber-icon: #f57f17; --va-kpi-amber-value: #e65100;
    --va-kpi-pink-a:  #fce4ec; --va-kpi-pink-b:  #f8bbd0; --va-kpi-pink-icon:  #ad1457; --va-kpi-pink-value:  #880e4f;

    /* Chart palette (read by public/js/vitiagri-ui.js) */
    --va-chart-1: #2e7d32;
    --va-chart-2: #1565c0;
    --va-chart-3: #f57f17;
    --va-chart-4: #ad1457;
    --va-chart-5: #00897b;
    --va-chart-6: #81c784;
    --va-chart-7: #90caf9;
    --va-chart-8: #bdbdbd;

    /* Shape */
    --va-radius-sm: 5px;   /* inputs, small buttons */
    --va-radius:    6px;   /* buttons */
    --va-radius-md: 10px;  /* pills, inner panels */
    --va-radius-lg: 14px;  /* cards */
    --va-shadow-card:  0 3px 12px rgba(0, 0, 0, 0.06);
    --va-shadow-hover: 0 6px 18px rgba(0, 0, 0, 0.12);

    /* Type */
    --va-font-body:    'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --va-font-heading: 'Rubik', 'IBM Plex Sans', sans-serif;
    --va-fs-xs:   11px;
    --va-fs-sm:   12px;
    --va-fs-th:   12.5px;
    --va-fs-ctl:  13px;
    --va-fs-base: 14px;
    --va-fs-lg:   17px;
    --va-fs-xl:   24px;
}

/* --------------------------------------------------------------------------
   Page header: breadcrumb, then icon + title (+ tag) on the left and the
   date + actions on the right.
   -------------------------------------------------------------------------- */
.va-page-header {
    margin: 14px 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--va-border);
}
.va-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
    font-size: var(--va-fs-ctl);
    color: var(--va-label);
}
.va-breadcrumb a { color: var(--va-green-600); text-decoration: none; }
.va-breadcrumb a:hover { text-decoration: underline; }
.va-breadcrumb .va-breadcrumb__sep { color: #9e9e9e; font-size: 11px; }
.va-breadcrumb [aria-current="page"] { color: var(--va-label); }

.va-page-header__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.va-page-header__title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.va-page-header__title i { font-size: 24px; color: var(--va-green-700); }
.va-page-header__title h1 {
    margin: 0;
    font-family: var(--va-font-heading);
    font-size: var(--va-fs-xl);
    font-weight: 700;
    color: var(--va-text);
    line-height: 1.25;
}
.va-page-header__aside {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.va-page-header__date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--va-fs-ctl);
    color: var(--va-muted);
}

/* --------------------------------------------------------------------------
   Filter bar: one card, labels above fields, Filter + Reset at the end.
   -------------------------------------------------------------------------- */
.va-filter {
    background: var(--va-surface);
    border: 1px solid var(--va-border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.va-filter__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}
.va-filter__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 160px;
    min-width: 140px;
}
.va-filter__field--wide { flex: 2 1 260px; }
.va-filter__label {
    margin: 0;
    font-size: var(--va-fs-sm);
    font-weight: 600;
    color: var(--va-label);
}
.va-filter__actions { display: flex; gap: 8px; }

/* Native inputs/selects inside va- containers */
.va-input,
.va-filter select,
.va-filter input[type="text"],
.va-filter input[type="search"],
.va-filter input[type="date"],
.va-filter input[type="month"],
.va-filter input[type="number"] {
    height: 31px;
    padding: 0 10px;
    border: 1px solid var(--va-input-border);
    border-radius: var(--va-radius-sm);
    background: var(--va-surface);
    font-family: var(--va-font-body);
    font-size: var(--va-fs-ctl);
    color: var(--va-text);
    width: 100%;
}
.va-input:focus,
.va-filter select:focus,
.va-filter input:focus {
    outline: none;
    border-color: var(--va-green-700);
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.15);
}
/* select2 inside a filter bar: match the native control height (the template's
   components.css gives it min-height 38px and 5px padding) */
.va-filter .select2-container.select2-container--default .select2-selection--single {
    height: 31px !important;
    min-height: 0;
    padding: 0 !important;
    border: 1px solid var(--va-input-border);
    border-radius: var(--va-radius-sm);
}
.va-filter .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 10px;
    line-height: 29px;
    font-size: var(--va-fs-ctl);
}
.va-filter .select2-container.select2-container--default .select2-selection--single .select2-selection__arrow { height: 29px !important; }

/* Status chips with counts (All 61 · Active 38 · ...) */
.va-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.va-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--va-input-border);
    border-radius: 15px;
    background: var(--va-surface);
    font-size: var(--va-fs-ctl);
    font-weight: 600;
    color: var(--va-text);
    text-decoration: none;
    cursor: pointer;
}
.va-chip:hover { background: var(--va-green-50); color: var(--va-green-800); text-decoration: none; }
.va-chip.is-active { background: var(--va-green-700); border-color: var(--va-green-700); color: #fff; }
.va-chip__count { font-weight: 700; }
/* As a button (e.g. a video chapter that seeks the player) */
button.va-chip { font-family: inherit; }

/* --------------------------------------------------------------------------
   Link list: one guide, download or video per row, with a toned icon tile
   (Help & Resources). <x-va.link-item> renders a row; .va-link-list__section
   heads a group inside the list, with an optional link on the right.
   -------------------------------------------------------------------------- */
.va-link-list { display: flex; flex-direction: column; gap: 2px; }
.va-link-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: var(--va-radius);
    background: none;
    font: inherit;
    text-align: left;
    color: inherit;
    text-decoration: none;
}
a.va-link-item:hover, button.va-link-item:hover { background: var(--va-green-50); color: inherit; text-decoration: none; }
a.va-link-item:focus-visible, button.va-link-item:focus-visible { outline: 2px solid var(--va-green-700); outline-offset: 1px; }
button.va-link-item { cursor: pointer; }
.va-link-item__icon {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: var(--va-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: var(--va-neutral-bg);
    color: var(--va-neutral-fg);
}
.va-link-item__icon--success { background: var(--va-success-bg); color: var(--va-success-fg); }
.va-link-item__icon--info    { background: var(--va-info-bg);    color: var(--va-info-fg); }
.va-link-item__icon--danger  { background: var(--va-danger-bg);  color: var(--va-danger-fg); }
.va-link-item__icon--accent  { background: var(--va-accent-bg);  color: var(--va-accent-fg); }
.va-link-item__body { min-width: 0; }
.va-link-item__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 600; color: var(--va-text-strong); line-height: 1.3; }
.va-link-item__desc { margin-top: 2px; font-size: var(--va-fs-sm); color: var(--va-muted); line-height: 1.4; }
.va-link-item.is-disabled .va-link-item__title { color: var(--va-muted); }
.va-link-list__section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 10px 10px 4px;
    border-top: 1px solid var(--va-border-soft);
    font-size: var(--va-fs-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--va-label);
}
.va-link-list__section a { margin-left: auto; font-size: var(--va-fs-sm); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--va-green-700); }

/* --------------------------------------------------------------------------
   Video playlist and player (Video Tutorials): a numbered list where the
   playing item is .is-active and a watched number is .is-done, beside a
   .va-player with the title, description and chapter chips under it.
   -------------------------------------------------------------------------- */
.va-playlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.va-playlist__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: var(--va-radius);
    background: none;
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
}
.va-playlist__item:hover { background: var(--va-green-50); }
.va-playlist__item:focus-visible { outline: 2px solid var(--va-green-700); outline-offset: 1px; }
.va-playlist__item.is-active { background: var(--va-green-100); }
.va-playlist__num {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--va-fs-xs);
    font-weight: 700;
    background: var(--va-green-50);
    color: var(--va-green-800);
}
.va-playlist__item.is-active .va-playlist__num, .va-playlist__num.is-done { background: var(--va-green-700); color: #fff; }
.va-playlist__title { font-weight: 600; color: var(--va-text-strong); line-height: 1.3; }
.va-playlist__meta { margin-top: 2px; font-size: var(--va-fs-xs); color: var(--va-muted); }
.va-player { margin-bottom: 14px; border-radius: var(--va-radius); overflow: hidden; background: #000; line-height: 0; }
.va-player video { display: block; width: 100%; max-height: 70vh; }
.va-player__title { margin: 0 0 4px; font-family: var(--va-font-heading); font-size: 17px; font-weight: 700; color: var(--va-green-800); }
.va-player__desc { margin: 0 0 12px; color: var(--va-muted); line-height: 1.5; }

/* --------------------------------------------------------------------------
   Buttons. Standalone class: never combine with .btn, because
   custom_styles.css forces .btn { color: #fff !important }.
   -------------------------------------------------------------------------- */
.va-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: var(--va-radius);
    background: var(--va-green-700);
    color: #fff;
    font-family: var(--va-font-body);
    font-size: var(--va-fs-ctl);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s;
}
.va-btn i { font-size: 15px; }
.va-btn:hover { background: var(--va-green-800); color: #fff; text-decoration: none; }
.va-btn:focus-visible { outline: 2px solid var(--va-green-700); outline-offset: 2px; }
.va-btn:disabled, .va-btn.is-disabled { opacity: .45; pointer-events: none; }

.va-btn--outline { background: var(--va-surface); color: var(--va-green-700); border-color: var(--va-green-700); }
.va-btn--outline:hover { background: var(--va-green-50); color: var(--va-green-800); }

.va-btn--secondary { background: #e4e4e4; color: #444; }
.va-btn--secondary:hover { background: #d6d6d6; color: #333; }

.va-btn--filter { background: var(--va-info-fg); }
.va-btn--filter:hover { background: #0d47a1; }

.va-btn--ghost { background: transparent; color: var(--va-green-700); }
.va-btn--ghost:hover { background: var(--va-green-50); color: var(--va-green-800); }

.va-btn--danger { background: var(--va-surface); color: var(--va-danger-fg); border-color: #ef9a9a; }
.va-btn--danger:hover { background: var(--va-danger-bg); color: var(--va-danger-fg); }

.va-btn--sm { height: 28px; padding: 0 10px; font-size: var(--va-fs-sm); }

/* Square icon-only button (row actions). Soft tinted tiles so each action reads
   as a button and its colour hints at what it does: green = open/view,
   blue = edit, red = delete. */
.va-btn--icon {
    width: 30px;
    height: 30px;
    padding: 0;
    border-color: #d3e5d4;
    background: var(--va-green-50);
    color: var(--va-green-700);
}
.va-btn--icon i { font-size: 16px; }
.va-btn--icon:hover { background: var(--va-green-100); border-color: var(--va-green-700); color: var(--va-green-800); }
.va-btn--icon.va-btn--info { border-color: #c9dbf3; background: #eef4fc; color: var(--va-info-fg); }
.va-btn--icon.va-btn--info:hover { background: var(--va-info-bg); border-color: var(--va-info-fg); color: #0d47a1; }
.va-btn--icon.va-btn--danger { border-color: #f1caca; background: #fdf2f2; color: var(--va-danger-fg); }
.va-btn--icon.va-btn--danger:hover { background: var(--va-danger-bg); border-color: var(--va-danger-fg); color: #b71c1c; }

/* Row action group: the main action as a labelled button, the rest as icon tiles */
.va-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }

/* --------------------------------------------------------------------------
   KPI tiles (the "Key Indicators" row)
   -------------------------------------------------------------------------- */
.va-eyebrow {
    margin: 0 0 8px;
    font-size: var(--va-fs-sm);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--va-muted);
}
.va-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.va-kpi {
    --tone-a: var(--va-kpi-green-a);
    --tone-b: var(--va-kpi-green-b);
    --tone-icon: var(--va-kpi-green-icon);
    --tone-value: var(--va-kpi-green-value);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--tone-a), var(--tone-b));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
/* Only tiles that link somewhere lift on hover, so the lift means "clickable" */
a.va-kpi--link { color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
a.va-kpi--link:hover { transform: translateY(-2px); box-shadow: var(--va-shadow-hover); color: inherit; text-decoration: none; }
a.va-kpi--link:focus-visible { outline: 2px solid var(--va-green-700); outline-offset: 2px; }
.va-kpi--blue  { --tone-a: var(--va-kpi-blue-a);  --tone-b: var(--va-kpi-blue-b);  --tone-icon: var(--va-kpi-blue-icon);  --tone-value: var(--va-kpi-blue-value); }
.va-kpi--amber { --tone-a: var(--va-kpi-amber-a); --tone-b: var(--va-kpi-amber-b); --tone-icon: var(--va-kpi-amber-icon); --tone-value: var(--va-kpi-amber-value); }
.va-kpi--pink  { --tone-a: var(--va-kpi-pink-a);  --tone-b: var(--va-kpi-pink-b);  --tone-icon: var(--va-kpi-pink-icon);  --tone-value: var(--va-kpi-pink-value); }
.va-kpi__icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--tone-icon);
    color: #fff;
    font-size: 20px;
}
.va-kpi__body { min-width: 0; line-height: 1.25; }
.va-kpi__label { font-size: var(--va-fs-ctl); font-weight: 500; color: #444; }
.va-kpi__value {
    font-family: var(--va-font-heading);
    font-size: 26px;
    font-weight: 700;
    color: var(--tone-value);
}
.va-kpi__sub { font-size: var(--va-fs-sm); color: #555; }

/* --------------------------------------------------------------------------
   Cards and section titles (green left bar + subtitle)
   -------------------------------------------------------------------------- */
.va-card {
    background: var(--va-surface);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--va-radius-lg);
    box-shadow: var(--va-shadow-card);
    padding: 16px;
    margin-bottom: 16px;
}
.va-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.va-card__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Action row above a table inside a card or tab pane (e.g. "+ Planting") */
.va-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: 14px 0 10px; }
.va-section-title {
    margin: 0;
    padding-left: 10px;
    border-left: 4px solid var(--va-green-700);
    font-family: var(--va-font-heading);
    font-size: var(--va-fs-lg);
    font-weight: 700;
    line-height: 1.3;
    color: var(--va-green-800);
}
.va-section-title--danger { border-left-color: var(--va-danger-fg); color: var(--va-danger-fg); }
.va-section-sub {
    margin: 2px 0 0;
    padding-left: 14px;
    font-size: var(--va-fs-ctl);
    color: var(--va-muted);
}
/* <x-va.card icon count>: icon before the title, count pill after it */
.va-section-title { display: flex; align-items: center; gap: 8px; }
.va-section-title > i { font-size: 18px; }
.va-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--va-green-50);
    color: var(--va-green-800);
    font-family: var(--va-font-body);
    font-size: var(--va-fs-sm);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Tables. Add .va-table to a <table> (works with or without DataTables).
   Out-specifies custom_styles.css's global .table th/td sizes.
   Style: horizontal row lines (no vertical gridlines) with a faint tint on
   every other row, so the eye can follow long rows across wide tables.
   -------------------------------------------------------------------------- */
/* position: relative keeps absolutely positioned bits inside the scroll box (e.g. the
   .va-sr-only "Actions" header), which would otherwise widen the page on phones */
.va-table-wrap { position: relative; width: 100%; overflow-x: auto; }
table.va-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-family: var(--va-font-body);
    color: var(--va-text);
}
table.va-table > thead > tr > th {
    padding: 9px 12px;
    border: 0;
    border-bottom: 2px solid var(--va-border);
    background: transparent;
    font-family: var(--va-font-heading);
    font-size: var(--va-fs-th);
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: var(--va-text-strong);
    white-space: nowrap;
    vertical-align: middle;
}
table.va-table > tbody > tr > td {
    padding: 9px 12px;
    border: 0;
    border-bottom: 1px solid var(--va-border-soft);
    background: var(--va-surface);
    font-size: var(--va-fs-base);
    color: var(--va-text);
    vertical-align: middle;
}
table.va-table > tbody > tr:nth-child(even) > td { background: #f6f9f6; }
table.va-table > tbody > tr:hover > td { background: #eaf3ea; }
table.va-table .va-num { text-align: right; font-variant-numeric: tabular-nums; }
/* Wide numeric tables (e.g. one column per year) inside .va-table-wrap: the first
   column stays put while the rest scroll sideways. Cells already have opaque fills. */
table.va-table--sticky-first > thead > tr > th:first-child,
table.va-table--sticky-first > tbody > tr > td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 240px;
    box-shadow: inset -1px 0 0 var(--va-border);
}
table.va-table--sticky-first > thead > tr > th:first-child { background: var(--va-surface); }
/* Add --sticky-narrow when the first column holds short names (e.g. officers), so more columns fit */
table.va-table--sticky-narrow > thead > tr > th:first-child,
table.va-table--sticky-narrow > tbody > tr > td:first-child { min-width: 150px; }
/* A line under a chart saying what's missing or how to read it ("No GDP figures yet for 2023"). */
.va-chart-note { margin: 6px 0 0; font-size: var(--va-fs-sm); color: var(--va-subtle); }
/* Text utilities: secondary text (e.g. the dash for an empty cell) and a figure that's over its limit */
.va-muted { color: var(--va-muted); }
.va-text-danger { color: var(--va-danger-fg); font-weight: 600; }
/* A system code shown as-is (e.g. a reference type group like GENDER_TYPE) */
.va-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--va-fs-sm); color: var(--va-neutral-fg); background: var(--va-neutral-bg); padding: 1px 6px; border-radius: var(--va-radius-sm); }
/* Long unspaced text in a table cell (ids, JSON) wraps instead of widening the table */
.va-break { overflow-wrap: anywhere; min-width: 160px; }
/* A form submit button that reads as a text link (e.g. a farmer name that POSTs to the profile) */
.va-link-button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--va-green-800);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.va-link-button:hover { color: var(--va-green-800); text-decoration: underline; }
.va-link-button:focus-visible { outline: 2px solid var(--va-green-700); outline-offset: 2px; border-radius: 2px; }
table.va-table .va-sub { display: block; font-size: var(--va-fs-sm); color: var(--va-muted); }
table.va-table a { color: var(--va-green-600); font-weight: 600; text-decoration: none; }
table.va-table a:hover { text-decoration: underline; }
table.va-table td.va-actions-cell { width: 1%; text-align: right; white-space: nowrap; }
/* A short value that reads badly when broken (dates like 01-Feb-2027, flag badges) */
table.va-table td.va-nowrap { white-space: nowrap; }
/* Wide numeric tables: let the header labels wrap so the count columns stay narrow */
table.va-table--wrap-head > thead > tr > th { white-space: normal; }
/* Bootstrap's own striping would fight the zebra above */
table.va-table.table-striped > tbody > tr > * { --bs-table-accent-bg: transparent; }

/* Footer row under a table: "Showing 1–12 of 61" + pager */
.va-table-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: var(--va-fs-ctl);
    color: var(--va-muted);
}

/* Square pager, used by .va-dt and server-side paginators */
.va-pager { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.va-pager a, .va-pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--va-input-border);
    border-radius: var(--va-radius);
    background: var(--va-surface);
    font-size: var(--va-fs-ctl);
    font-weight: 600;
    color: var(--va-text);
    text-decoration: none;
}
.va-pager a:hover { background: var(--va-green-50); }
.va-pager .is-active { background: var(--va-green-700); border-color: var(--va-green-700); color: #fff; }
.va-pager .is-disabled { color: #bbb; pointer-events: none; }

/* DataTables chrome inside a .va-dt wrapper (set by VA.dataTable()). */
.va-dt .dataTables_length,
.va-dt .dataTables_filter,
.va-dt .dataTables_info { font-size: var(--va-fs-ctl); color: var(--va-muted); }
.va-dt .dataTables_filter input,
.va-dt .dataTables_length select {
    height: 31px;
    border: 1px solid var(--va-input-border);
    border-radius: var(--va-radius-sm);
    font-size: var(--va-fs-ctl);
}
.va-dt .dataTables_paginate { padding-top: 12px; }
.va-dt .dataTables_paginate .pagination { gap: 6px; }
.va-dt .dataTables_paginate .page-item .page-link {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--va-input-border);
    border-radius: var(--va-radius) !important;
    background: var(--va-surface);
    font-size: var(--va-fs-ctl);
    font-weight: 600;
    color: var(--va-text);
    box-shadow: none;
}
/* The template's bootstrap-extended.css sets the active page blue with !important */
.va-dt .dataTables_paginate .page-item.active .page-link,
.va-dt .dataTables_paginate .page-item.active .page-link:hover {
    background-color: var(--va-green-700) !important;
    border-color: var(--va-green-700) !important;
    color: #fff !important;
}
.va-dt .dataTables_paginate .page-item.disabled .page-link { color: #bbb; }
/* "…" between page numbers looks like the server pager's gap, not a disabled button */
.va-dt .dataTables_paginate .page-item.disabled:not(.previous):not(.next) .page-link {
    border-color: transparent;
    background: transparent;
    color: var(--va-muted);
}
.va-dt .dataTables_paginate .page-link i { font-size: 14px; }
.va-dt .dataTables_paginate .page-item.disabled .page-link { background: var(--va-surface); }
/* VA.dataTable() lays out "<'va-dt__top'lf>t<'va-table-foot'ip>": controls above,
   info + pager in the same .va-table-foot row the server pager uses. */
.va-dt__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.va-dt__top:empty { display: none; }
.va-dt .va-table-foot .dataTables_info,
.va-dt .va-table-foot .dataTables_paginate { padding: 0 !important; margin: 0; }
/* The template's bootstrap-extended.css adds margins around prev/next and the list */
.va-dt .dataTables_paginate .pagination { margin: 0 !important; gap: 6px; }
.va-dt .dataTables_paginate .page-item { margin: 0 !important; }
.va-dt .dataTables_paginate { float: none !important; text-align: right; line-height: 0; }
.va-dt table.dataTable { margin-top: 0 !important; margin-bottom: 0 !important; }
.va-dt table.dataTable > thead .sorting::before,
.va-dt table.dataTable > thead .sorting::after,
.va-dt table.dataTable > thead .sorting_asc::before,
.va-dt table.dataTable > thead .sorting_asc::after,
.va-dt table.dataTable > thead .sorting_desc::before,
.va-dt table.dataTable > thead .sorting_desc::after { opacity: .25; font-size: 10px; }
.va-dt table.dataTable > thead .sorting_asc::before,
.va-dt table.dataTable > thead .sorting_desc::after { opacity: .8; color: var(--va-green-700); }
.va-dt .dataTables_empty { padding: 28px 12px !important; color: var(--va-muted); font-style: italic; text-align: center; }

/* --------------------------------------------------------------------------
   Status badges: soft pills. Tone comes from App\Support\StatusTone.
   -------------------------------------------------------------------------- */
.va-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: var(--va-radius-md);
    background: var(--va-neutral-bg);
    color: var(--va-neutral-fg);
    font-size: var(--va-fs-sm);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}
/* A long label (e.g. "Land Resource & Planning Development: Not submitted") wraps
   inside its table cell instead of spilling into the next column. */
.va-badge--wrap { white-space: normal; text-align: left; margin: 1px 0; }
.va-badge--success { background: var(--va-success-bg); color: var(--va-success-fg); }
.va-badge--warning { background: var(--va-warning-bg); color: var(--va-warning-fg); }
.va-badge--danger  { background: var(--va-danger-bg);  color: var(--va-danger-fg); }
.va-badge--info    { background: var(--va-info-bg);    color: var(--va-info-fg); }
.va-badge--accent  { background: var(--va-accent-bg);  color: var(--va-accent-fg); }
.va-badge--neutral { background: var(--va-neutral-bg); color: var(--va-neutral-fg); }

/* --------------------------------------------------------------------------
   Tabs: green underline. Works as plain links (.va-tabs > a.va-tab) and on
   existing Bootstrap 4 markup (<ul class="nav nav-tabs va-tabs"> with
   data-toggle="tab"). The legacy teal pill rules in custom_styles.css use
   !important, so the nav-tabs overrides below have to as well.
   .cop-tabs > a.cop-tab (monitoring/partials/cop_tabs) is a legacy alias: tests
   and tutorial 03 select those class names, so the partial keeps them.
   -------------------------------------------------------------------------- */
.va-tabs,
.cop-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 16px;
    padding: 0;
    border-bottom: 2px solid var(--va-border);
    list-style: none;
}
.va-tabs .va-tab,
.cop-tabs .cop-tab,
.va-tabs.nav.nav-tabs .nav-item .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 -2px !important;
    padding: 9px 14px !important;
    border: 0 !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 6px 6px 0 0 !important;
    background: transparent !important;
    color: var(--va-label) !important;
    font-size: var(--va-fs-base);
    font-weight: 600;
    text-decoration: none;
    text-transform: none !important;
}
.va-tabs .va-tab i,
.cop-tabs .cop-tab i,
.va-tabs.nav.nav-tabs .nav-link i { font-size: 16px; }
.va-tabs .va-tab:hover,
.cop-tabs .cop-tab:not(.active):hover,
.va-tabs.nav.nav-tabs .nav-item .nav-link:not(.active):hover,
.va-tabs.nav.nav-tabs .nav-item .nav-link:not(.active):hover span {
    background: var(--va-green-50) !important;
    color: var(--va-green-600) !important;
}
.va-tabs .va-tab.is-active,
.va-tabs .va-tab.active,
.cop-tabs .cop-tab.active,
.va-tabs.nav.nav-tabs .nav-item .nav-link.active,
.va-tabs.nav.nav-tabs .nav-item.show .nav-link {
    background: transparent !important;
    color: var(--va-green-600) !important;
    border-bottom-color: var(--va-green-600) !important;
}
/* Undo the legacy li.button teal fill and the template's active-tab arrow */
.va-tabs.nav.nav-tabs .nav-item,
.va-tabs.nav.nav-tabs .nav-item.button {
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent !important;
}
.va-tabs.nav.nav-tabs .nav-link::before,
.va-tabs.nav.nav-tabs .nav-link::after,
.va-tabs.nav.nav-tabs .nav-item::before,
.va-tabs.nav.nav-tabs .nav-item::after { display: none !important; }
.va-tab__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    background: var(--va-green-100);
    color: var(--va-green-800);
    font-size: var(--va-fs-xs);
    font-weight: 700;
}
/* A count that needs action (e.g. COP updates waiting on your review) */
.va-tab__count--danger { background: var(--va-danger-fg); color: #fff; }

/* --------------------------------------------------------------------------
   Detail hero band (record pages: farmer, cluster, trial ...)
   -------------------------------------------------------------------------- */
.va-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 18px 22px;
    border-radius: var(--va-radius-lg);
    background: linear-gradient(135deg, #1a5c20 0%, #28682F 50%, #3d9b47 100%);
    color: #fff;
}
.va-hero__main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.va-hero__avatar {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    font-family: var(--va-font-heading);
    font-size: 20px;
    font-weight: 700;
}
.va-hero__title {
    margin: 0;
    font-family: var(--va-font-heading);
    font-size: 21px;
    font-weight: 700;
    color: #fff;
}
.va-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 4px;
    font-size: var(--va-fs-ctl);
    color: rgba(255, 255, 255, 0.85);
}
.va-hero__meta span { display: inline-flex; align-items: center; gap: 5px; }
.va-hero__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.va-hero__titlerow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.va-hero__titlerow .va-badge { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6); }
.va-hero .va-hero__actions form { margin: 0; }
/* Buttons sitting on the green band */
.va-hero .va-btn--outline { background: #fff; border-color: #fff; color: var(--va-green-800); }
.va-hero .va-btn--outline:hover { background: var(--va-green-50); }
.va-hero .va-btn--ghost { color: #fff; border-color: rgba(255, 255, 255, 0.6); }
.va-hero .va-btn--ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */
.va-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 28px 16px;
    text-align: center;
    color: var(--va-muted);
}
.va-empty > i { font-size: 30px; color: #b0bab2; }
.va-empty__message { margin: 0; font-size: var(--va-fs-base); }
.va-empty__hint { margin: 0; font-size: var(--va-fs-sm); color: var(--va-subtle); }
/* One line instead of a centred block, e.g. a dashboard group with nothing in it yet */
.va-empty--row { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; column-gap: 12px; padding: 4px 0; text-align: left; }
.va-empty--row > i { font-size: 26px; }
.va-empty--row .va-empty__text { flex: 1 1 240px; }
.va-empty--row .va-empty__message { color: var(--va-text); font-weight: 600; }

/* A heading over a group of cards (e.g. one programme on a dashboard) */
.va-group-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 8px 0 12px;
    font-family: var(--va-font-heading);
    font-size: var(--va-fs-lg);
    font-weight: 600;
    color: var(--va-text-strong);
}
.va-group-title > i { align-self: center; font-size: 22px; color: var(--va-green-700); }
.va-group-title__meta { font-family: var(--va-font-body); font-size: var(--va-fs-ctl); font-weight: 400; color: var(--va-muted); }

/* --------------------------------------------------------------------------
   Form fields (<x-va.field>) and controls. Styles both server-side errors
   ($errors) and jQuery Validate's inserted label.error, which the app's
   AJAX forms use today.
   -------------------------------------------------------------------------- */
.va-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
.va-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
/* A one-field form with its button beside it (e.g. Settings > Permissions "Add access"):
   the field grows, the button lines up with the control. Stacks on phones. */
/* One row of an add/remove list (a picker or file input + its remove tile), e.g. officers and
   evidence on the COP update forms. No !important, so a script can still hide the row. */
.va-repeat-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.va-repeat-row > :first-child { flex: 1 1 auto; min-width: 0; }
.va-field-row { display: flex; align-items: flex-end; gap: 12px; }
.va-field-row > .va-field { flex: 1 1 auto; min-width: 0; }
.va-field-row > .va-btn { margin-bottom: 14px; flex: 0 0 auto; }
@media (max-width: 575.98px) {
    .va-field-row { flex-direction: column; align-items: stretch; }
}
.va-field__label {
    margin: 0;
    font-size: var(--va-fs-ctl);
    font-weight: 600;
    color: var(--va-label);
}
.va-field__required { margin-left: 2px; color: var(--va-danger-fg); }
.va-field__hint { margin: 0; font-size: var(--va-fs-sm); color: var(--va-muted); }
.va-field__error,
.va-field label.error,
.va-field span.error {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-size: var(--va-fs-sm);
    font-weight: 500;
    color: var(--va-danger-fg);
}
.va-field label.error::before,
.va-field span.error::before { content: "\26A0"; font-size: 11px; }

.va-input,
.va-select,
.va-textarea {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--va-input-border);
    border-radius: var(--va-radius-sm);
    background: var(--va-surface);
    font-family: var(--va-font-body);
    font-size: var(--va-fs-base);
    color: var(--va-text);
    transition: border-color .15s, box-shadow .15s;
}
.va-textarea { height: auto; min-height: 84px; padding: 8px 10px; line-height: 1.45; resize: vertical; }
.va-input::placeholder, .va-textarea::placeholder { color: var(--va-subtle); opacity: 1; }
.va-input:focus, .va-select:focus, .va-textarea:focus {
    outline: none;
    border-color: var(--va-green-700);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}
.va-input:disabled, .va-select:disabled, .va-textarea:disabled,
.va-input[readonly], .va-textarea[readonly] {
    background: #f3f5f3;
    color: var(--va-muted);
    cursor: not-allowed;
}
.va-field.is-invalid .va-input, .va-field.is-invalid .va-select, .va-field.is-invalid .va-textarea,
.va-field .va-input.error, .va-field .va-select.error, .va-field .va-textarea.error {
    border-color: var(--va-danger-fg);
}
.va-field.is-invalid .va-input:focus, .va-field .va-input.error:focus,
.va-field.is-invalid .va-select:focus, .va-field .va-select.error:focus,
.va-field.is-invalid .va-textarea:focus, .va-field .va-textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15);
}
/* Filter bars keep their compact 31px controls */
.va-filter .va-input, .va-filter .va-select { height: 31px; font-size: var(--va-fs-ctl); }
.va-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }

/* --------------------------------------------------------------------------
   Modal (<x-va.modal>). Bootstrap markup; works with both data-toggle (BS4)
   and $('#id').modal('show') (BS5) openers.
   -------------------------------------------------------------------------- */
/* Clear the sticky header bar (~70px), which sits above Bootstrap's backdrop */
.va-modal .modal-dialog:not(.modal-dialog-centered) { margin-top: 90px; }
.va-modal .modal-dialog-centered { min-height: calc(100% - 120px); margin-top: 90px; }
/* A long form in a popup (.modal-dialog-scrollable): the header and buttons stay put and only
   the fields scroll. Works with the form wrapped around .modal-body and .modal-footer. */
/* align-items: Bootstrap 4 makes the scrollable dialog a flex box, which would stretch the
   popup to the full height of the screen; it should only be as tall as its fields */
.va-modal .modal-dialog-scrollable { height: calc(100% - 90px - 1.75rem); max-height: none; align-items: flex-start; }
.va-modal .modal-dialog-scrollable .modal-content { max-height: 100%; }
.va-modal .modal-dialog-scrollable .modal-content > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.va-modal .modal-dialog-scrollable .modal-body { overflow-y: auto; }
/* Shorter text boxes, for a popup with several of them (e.g. the COP outcome forms) */
.va-modal.va-modal--compact textarea.form-control { min-height: 60px; }
.va-modal .modal-content {
    border: 0;
    border-radius: var(--va-radius-lg);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}
/* A combobox's suggestion list has to drop past the popup's edge rather than be
   clipped; the header and footer carry their own rounded corners for this case. */
.va-modal .modal-content:has(.va-combobox) { overflow: visible; }
.va-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--va-border);
    border-radius: var(--va-radius-lg) var(--va-radius-lg) 0 0;
    background: var(--va-surface);
}
.va-modal .modal-title {
    margin: 0;
    font-family: var(--va-font-heading);
    font-size: var(--va-fs-lg);
    font-weight: 700;
    color: var(--va-green-800);
}
.va-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: -4px -6px -4px 8px;
    border: 0;
    border-radius: var(--va-radius);
    background: transparent;
    color: var(--va-label);
    font-size: 18px;
    cursor: pointer;
}
.va-modal__close:hover { background: var(--va-green-50); color: var(--va-green-800); }
.va-modal__close:focus-visible { outline: 2px solid var(--va-green-700); outline-offset: 2px; }
.va-modal .modal-body { padding: 18px 20px 6px; color: var(--va-text); }
.va-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--va-border);
    border-radius: 0 0 var(--va-radius-lg) var(--va-radius-lg);
    background: #fbfcfb;
}
.va-modal .modal-footer > * { margin: 0; }

/* Old Bootstrap forms on upgraded pages, inside a .va-modal shell or wrapped in
   .va-legacy-form (inline edit forms on detail pages): .form-group / label /
   .form-control get the va- field look without touching the field markup or ids.
   Buttons that also carry .form-control (the clone add/remove buttons) are styled
   separately below. */
:is(.va-modal, .va-legacy-form) .form-group { margin-bottom: 14px; }
:is(.va-modal, .va-legacy-form) label:not(.error):not(.form-check-label):not(.custom-control-label):not(.va-check) {
    margin-bottom: 4px;
    font-size: var(--va-fs-ctl);
    font-weight: 600;
    color: var(--va-label);
    text-transform: none !important;
}
:is(.va-modal, .va-legacy-form) .form-control:not(.btn),
:is(.va-modal, .va-legacy-form) .custom-select {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--va-input-border);
    border-radius: var(--va-radius-sm);
    background-color: var(--va-surface);
    box-shadow: none;
    font-family: var(--va-font-body);
    font-size: var(--va-fs-base);
    color: var(--va-text);
    transition: border-color .15s, box-shadow .15s;
}
:is(.va-modal, .va-legacy-form) textarea.form-control,
:is(.va-modal, .va-legacy-form) select.form-control[multiple] { height: auto; min-height: 84px; padding: 8px 10px; line-height: 1.45; }
:is(.va-modal, .va-legacy-form) .form-control:not(.btn)::placeholder { color: var(--va-subtle); opacity: 1; }
:is(.va-modal, .va-legacy-form) .form-control:not(.btn):focus,
:is(.va-modal, .va-legacy-form) .custom-select:focus {
    outline: none;
    border-color: var(--va-green-700);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}
:is(.va-modal, .va-legacy-form) .form-control:not(.btn):disabled,
:is(.va-modal, .va-legacy-form) .form-control:not(.btn)[readonly] { background-color: #f3f5f3; color: var(--va-muted); }
:is(.va-modal, .va-legacy-form) .form-control.error:not(.btn) { border-color: var(--va-danger-fg); }
/* File inputs: a bordered box with a "Choose file" button on the left */
:is(.va-modal, .va-legacy-form) input[type="file"].form-control,
.va-file {
    height: auto;
    padding: 0;
    overflow: hidden;
    line-height: 32px;
}
:is(.va-modal, .va-legacy-form) input[type="file"]::file-selector-button,
.va-file::file-selector-button {
    height: 32px;
    margin: 0 10px 0 0;
    padding: 0 12px;
    border: 0;
    border-right: 1px solid var(--va-input-border);
    background: var(--va-green-50);
    color: var(--va-green-800);
    font: 600 var(--va-fs-ctl) var(--va-font-body);
    cursor: pointer;
}
:is(.va-modal, .va-legacy-form) label.error,
:is(.va-modal, .va-legacy-form) span.error {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 4px 0 0;
    font-size: var(--va-fs-sm);
    font-weight: 500;
    color: var(--va-danger-fg);
}
:is(.va-modal, .va-legacy-form) label.error::before,
:is(.va-modal, .va-legacy-form) span.error::before { content: "\26A0"; font-size: 11px; }
:is(.va-modal, .va-legacy-form) .select2-container .select2-selection {
    min-height: 34px;
    border: 1px solid var(--va-input-border) !important;
    border-radius: var(--va-radius-sm) !important;
}
:is(.va-modal, .va-legacy-form) .select2-container--focus .select2-selection { border-color: var(--va-green-700) !important; }
/* select2 single select: the same 34px box as .form-control (the template's components.css
   gives it min-height 38px and 5px padding, and its select2.min.css loads after this file) */
:is(.va-modal, .va-legacy-form) .select2-container.select2-container--default .select2-selection--single {
    height: 34px !important;
    min-height: 0 !important;
    padding: 0 !important;
}
:is(.va-modal, .va-legacy-form) .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 10px;
    line-height: 32px !important;
    font-size: var(--va-fs-base);
    color: var(--va-text);
}
:is(.va-modal, .va-legacy-form) .select2-container.select2-container--default .select2-selection--single .select2-selection__arrow { height: 32px !important; }
/* Long programme / activity names wrap inside the open list instead of running off the page */
body.va-ui .select2-container--default .select2-results__option { white-space: normal; word-break: break-word; }
/* select2 multi-select: tags as soft green chips */
:is(.va-modal, .va-legacy-form) .select2-selection--multiple .select2-selection__choice {
    margin-top: 4px;
    padding: 1px 8px;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--va-green-50) !important;
    color: var(--va-green-800) !important;
    font-size: var(--va-fs-ctl);
}
:is(.va-modal, .va-legacy-form) .select2-selection--multiple .select2-selection__choice__remove { margin-right: 4px; color: var(--va-green-800) !important; }
/* Clone add/remove buttons next to a repeatable input (.btn-clone* / .btn-remove*,
   which the page JS relies on): small square tiles instead of full-width buttons */
:is(.va-modal, .va-legacy-form) .btn.form-control:is([class*="btn-clone"], [class*="btn-remove"]) {
    flex: 0 0 34px;
    max-width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #c8e6c9 !important;
    border-radius: var(--va-radius-sm);
    background: var(--va-green-50) !important;
    color: var(--va-green-800) !important;
    font-size: 16px;
    line-height: 1;
    box-shadow: none !important;
}
:is(.va-modal, .va-legacy-form) .btn.form-control[class*="btn-remove"] {
    border-color: #f5c6c6 !important;
    background: var(--va-danger-bg) !important;
    color: var(--va-danger-fg) !important;
}

/* Checkbox groups: .va-checks grid of .va-check (label wrapping or beside the box) */
.va-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 8px 16px;
    margin: 4px 0 14px;
}
.va-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: var(--va-fs-base);
    font-weight: 500;
    color: var(--va-text);
    cursor: pointer;
}
.va-check input[type="checkbox"],
.va-check input[type="radio"],
.va-checks input[type="checkbox"] {
    flex: none;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--va-green-700);
    cursor: pointer;
}
/* The old .form-check-label markup inside a .va-checks group */
.va-checks .form-check-label { display: inline; margin: 0 0 0 8px; float: none; font-weight: 500; color: var(--va-text); }
.va-checks .form-check { display: flex; align-items: center; margin: 0; padding: 0; float: none !important; border: 0 !important; }
.va-checks .form-check-input { position: static; margin: 0; }
/* An old row/col form laid out as one wide grid (e.g. the Add Farmer popup): put
   .va-legacy-grid on the form's container. Bootstrap .row elements, and wrappers
   marked .va-dissolve, dissolve (display: contents), so every field lands in one
   4-column grid. Nothing moves in the markup, and anything the page JS hides with
   style.display = 'none' stays hidden: the dissolve rule skips it, and the
   !important beats the inline display: block the JS uses to show it again. */
.va-legacy-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0 16px;
    align-items: start;
}
.va-legacy-grid .row:not(.pl-1):not([style*="none"]),
.va-legacy-grid .va-dissolve:not([style*="none"]) { display: contents !important; }
.va-legacy-grid [class*="col-"] {
    flex: none;
    width: auto;
    max-width: none;
    min-width: 0;
    padding: 0;
    float: none !important;
}
.va-legacy-grid .row.pl-1 { margin: 0; padding-left: 0 !important; flex-wrap: nowrap; gap: 6px; }
.va-legacy-grid .row.pl-1 > .form-control:not(.btn) { flex: 1 1 auto; max-width: none; margin: 0 !important; }
/* Single fields take one column even when the old markup said col-md-12; repeatable
   rows (input + add/remove buttons) and multi-selects get two. */
.va-legacy-grid .col-md-12:has(.row.pl-1, select[multiple]) { grid-column: span 2; }
.va-legacy-grid .text-center,
.va-legacy-grid .va-form-subhead,
.va-legacy-grid .col-md-12:has(.form-check-label) { grid-column: 1 / -1; }
.va-legacy-grid .text-center { text-align: left !important; }
.va-legacy-grid .text-center :is(p, h4, h5, h6, b, strong) { margin: 4px 0 6px; font-weight: 600; color: var(--va-green-800); }
/* Checkbox groups inside it: label beside the box, four per line */
.va-legacy-grid .col-md-12:has(.form-check-label) {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px 16px;
    margin-bottom: 8px;
}
.va-legacy-grid .col-md-12:has(.form-check-label) > :is(p, label:not(.form-check-label)) { grid-column: 1 / -1; margin: 0 0 4px; color: var(--va-muted); }
.va-legacy-form .form-group:has(> .form-check-label) {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.va-legacy-form .form-group:has(> .form-check-label) > input[type="checkbox"] {
    float: none !important;
    width: 16px;
    height: 16px;
    margin: 0 !important;
    border: 0 !important;
    accent-color: var(--va-green-700);
    cursor: pointer;
}
.va-legacy-form .form-check-label { margin: 0; font-weight: 500; color: var(--va-text); text-transform: none !important; }
.va-legacy-grid .form-group:has(> .form-check-label) {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.va-legacy-grid .form-group:has(> .form-check-label) > input[type="checkbox"] {
    float: none !important;
    width: 16px;
    height: 16px;
    margin: 0 !important;
    border: 0 !important;
    accent-color: var(--va-green-700);
    cursor: pointer;
}
.va-legacy-grid .form-check-label { margin: 0; font-weight: 500; color: var(--va-text); text-transform: none !important; }
:is(.va-modal, .va-legacy-form) .hide { display: none !important; }
@media (max-width: 991px) {
    .va-legacy-grid,
    .va-legacy-grid .col-md-12:has(.form-check-label) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* A sub-heading inside a legacy form (e.g. "Beef cattle" above its count fields) */
.va-form-subhead {
    grid-column: 1 / -1;
    margin: 6px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--va-border-soft);
    font-family: var(--va-font-heading);
    font-size: var(--va-fs-base);
    font-weight: 600;
    color: var(--va-green-800);
}

/* --------------------------------------------------------------------------
   Alerts (<x-va.alert>, <x-va.flash>)
   -------------------------------------------------------------------------- */
.va-alert {
    --tone-bg: var(--va-info-bg);
    --tone-fg: var(--va-info-fg);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding: 11px 14px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-left: 4px solid var(--tone-fg);
    border-radius: var(--va-radius-md);
    background: var(--tone-bg);
    color: var(--va-text);
    font-size: var(--va-fs-base);
}
.va-alert--success { --tone-bg: var(--va-success-bg); --tone-fg: var(--va-success-fg); }
.va-alert--warning { --tone-bg: var(--va-warning-bg); --tone-fg: var(--va-warning-fg); }
.va-alert--danger  { --tone-bg: var(--va-danger-bg);  --tone-fg: var(--va-danger-fg); }
.va-alert__icon { flex: none; margin-top: 1px; font-size: 18px; color: var(--tone-fg); }
.va-alert__body { flex: 1; min-width: 0; }
.va-alert__title { font-weight: 600; color: var(--tone-fg); }
.va-alert__close {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin: -3px -6px -3px 0;
    border: 0;
    border-radius: var(--va-radius);
    background: transparent;
    color: var(--va-label);
    cursor: pointer;
}
.va-alert__close:hover { background: rgba(0, 0, 0, 0.06); }
.va-alert__close:focus-visible { outline: 2px solid var(--tone-fg); outline-offset: 1px; }

/* --------------------------------------------------------------------------
   Key-value summary (<x-va.summary>)
   -------------------------------------------------------------------------- */
/* Rows (default): label left with an optional icon, value right-weighted,
   a soft divider between rows. */
.va-summary {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 28px;
    margin: 0;
    font-size: var(--va-fs-base);
}
.va-summary--2col { grid-template-columns: 1fr 1fr; }
/* :items values typed over several lines (comments, purposes) keep their line breaks */
.va-summary--pre dd { white-space: pre-line; }
@media (max-width: 900px) {
    .va-summary--2col { grid-template-columns: 1fr; }
}
.va-summary__item {
    display: grid;
    grid-template-columns: minmax(120px, 42%) 1fr;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--va-border-soft);
}
.va-summary dt {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: var(--va-fs-ctl);
    font-weight: 500;
    color: var(--va-muted);
}
.va-summary dt i { font-size: 16px; color: var(--va-green-700); }
.va-summary dd { margin: 0; font-weight: 500; color: var(--va-text-strong); overflow-wrap: anywhere; }
.va-summary dd.is-empty { font-weight: 400; color: var(--va-subtle); }

/* Tiles: each item is a small panel, label above value. For profile-style
   facts you want to scan at a glance. */
.va-summary--tiles {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.va-summary--tiles .va-summary__item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--va-border-soft);
    border-radius: var(--va-radius-md);
    background: #f7faf7;
}
.va-summary--tiles dt {
    font-size: var(--va-fs-xs);
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.va-summary--tiles dt i { font-size: 14px; }
.va-summary--tiles dd { font-family: var(--va-font-heading); font-size: 15px; font-weight: 600; }

/* --------------------------------------------------------------------------
   Progress (<x-va.progress>)
   -------------------------------------------------------------------------- */
.va-progress { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.va-progress__head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: var(--va-fs-sm);
    color: var(--va-label);
}
.va-progress__value { font-weight: 600; color: var(--va-text); font-variant-numeric: tabular-nums; }
.va-progress__track {
    display: flex;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e6ebe6;
}
.va-progress--thin .va-progress__track { height: 6px; }
.va-progress__bar { height: 100%; background: var(--va-green-700); transition: width .4s ease; }
.va-progress__bar--success { background: #2e7d32; }
.va-progress__bar--info    { background: #1565c0; }
.va-progress__bar--warning { background: #f59e0b; }
.va-progress__bar--danger  { background: #c62828; }
.va-progress__bar--accent  { background: #6a1b9a; }
.va-progress__bar--neutral { background: #9e9e9e; }
.va-progress__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
    font-size: var(--va-fs-xs);
    color: var(--va-label);
}
.va-progress__legend li { display: inline-flex; align-items: center; gap: 5px; }
.va-progress__legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* Pager gap ("…") */
.va-pager .is-gap { border-color: transparent; background: transparent; color: var(--va-muted); }

/* --------------------------------------------------------------------------
   Ranked bar list (<x-va.bar-list>, VA.barList): label | bar | value rows.
   Bars grow in from the left on load, one after another.
   -------------------------------------------------------------------------- */
.va-bar-list {
    --va-bar-label: 112px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--va-fs-ctl);
}
.va-bar-list__item {
    display: grid;
    grid-template-columns: var(--va-bar-label) 1fr minmax(48px, auto);
    gap: 8px;
    align-items: center;
    padding: 2px 4px;
    border-radius: 4px;
}
.va-bar-list__item[data-va-tip-title] { cursor: default; }
.va-bar-list__item[data-va-tip-title]:hover,
.va-bar-list__item[data-va-tip-title]:focus-visible { background: var(--va-green-50); outline: none; }
.va-bar-list__label { overflow: hidden; color: var(--va-label); white-space: nowrap; text-overflow: ellipsis; }
.va-bar-list__track { height: 12px; }
.va-bar-list__track--full { border-radius: 2px; background: #edf1ed; }
.va-bar-list__bar {
    display: block;
    height: 100%;
    min-width: 3px;
    border-radius: 2px;
    transform-origin: left center;
    animation: va-bar-grow .6s cubic-bezier(.2, .7, .3, 1) both;
    animation-delay: calc(var(--i, 0) * 45ms);
}
.va-bar-list__value { font-weight: 600; color: var(--va-text-strong); text-align: right; font-variant-numeric: tabular-nums; }
/* Main-column charts: roomier rows and thicker bars */
.va-bar-list--md { --va-bar-label: minmax(90px, 32%); gap: 6px; padding: 6px 0 2px; }
/* On the element VA.barList() fills: compact rows, but a label column that grows with a wide card */
.va-bar-host--wide-labels .va-bar-list { --va-bar-label: minmax(112px, 28%); }
.va-bar-list--md .va-bar-list__item { padding: 5px 4px; }
.va-bar-list--md .va-bar-list__track { height: 22px; }
.va-bar-list--md .va-bar-list__bar { border-radius: 3px; }
@keyframes va-bar-grow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
    .va-bar-list__bar { animation: none; }
}

/* --------------------------------------------------------------------------
   Tooltip ([data-va-tip-title], shown by vitiagri-ui.js)
   -------------------------------------------------------------------------- */
.va-tip {
    position: fixed;
    z-index: 2000;
    display: none;
    max-width: 260px;
    padding: 8px 11px;
    border: 1px solid var(--va-border);
    border-radius: 8px;
    background: var(--va-surface);
    box-shadow: var(--va-shadow-hover);
    font-size: var(--va-fs-ctl);
    pointer-events: none;
}
.va-tip__title { font-weight: 600; color: var(--va-text-strong); }
.va-tip__body { color: var(--va-label); }

/* ApexCharts tooltips inside va- cards: readable text (the template's
   components.css forces a faint grey with !important) and the same card look
   as .va-tip */
.va-card .apexcharts-canvas .apexcharts-tooltip.apexcharts-theme-light {
    border: 1px solid var(--va-border);
    border-radius: 8px;
    background: var(--va-surface);
    box-shadow: var(--va-shadow-hover);
    color: var(--va-text) !important;
}
.va-card .apexcharts-tooltip-text-label { color: var(--va-label); }
.va-card .apexcharts-tooltip-text-value { font-weight: 600; color: var(--va-text-strong); }
.va-card .apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {
    border-bottom-color: var(--va-border-soft);
    background: #f6f9f6;
    font-weight: 600;
}
.va-card .apexcharts-tooltip-text-y-label { color: var(--va-label); }
.va-card .apexcharts-tooltip-text-y-value { font-weight: 600; color: var(--va-text-strong); }

/* --------------------------------------------------------------------------
   Combobox (VA.combobox): search box with a styled suggestion list
   -------------------------------------------------------------------------- */
.va-combobox { position: relative; }
.va-combobox__list {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    margin: 0;
    padding: 4px;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--va-border);
    border-radius: var(--va-radius-md);
    background: var(--va-surface);
    box-shadow: var(--va-shadow-hover);
}
.va-combobox__option {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--va-radius);
    font-size: var(--va-fs-ctl);
    color: var(--va-text);
    cursor: pointer;
}
.va-combobox__option:hover,
.va-combobox__option[aria-selected="true"] { background: var(--va-green-50); color: var(--va-green-800); }
.va-combobox__meta { flex: none; color: var(--va-muted); font-variant-numeric: tabular-nums; }
.va-combobox__empty { padding: 7px 10px; font-size: var(--va-fs-sm); color: var(--va-muted); }

/* bootstrap3-typeahead farmer/household search on upgraded pages (body.va-ui):
   the page JS builds ul.typeahead > .list-container > ul.typeahead-dropdown >
   li.typeahead-item with inline styles; this skins it like the combobox list. */
body.va-ui ul.typeahead.dropdown-menu {
    width: 100%;
    max-height: 300px;
    margin-top: 4px;
    padding: 4px;
    overflow-y: auto;
    border: 1px solid var(--va-border);
    border-radius: var(--va-radius-md);
    background: var(--va-surface);
    box-shadow: var(--va-shadow-hover);
}
body.va-ui .typeahead-dropdown { margin: 0; padding: 0; list-style: none; }
body.va-ui ul.typeahead .list-container { height: auto; max-height: 290px; overflow-y: auto; }
body.va-ui .typeahead-item {
    width: auto !important;
    padding: 7px 10px !important;
    border-radius: var(--va-radius) !important;
    font-size: var(--va-fs-ctl);
    color: var(--va-text);
    cursor: pointer;
    animation: none !important;
}
body.va-ui .typeahead-item:hover,
body.va-ui .typeahead-item.active { background: var(--va-green-50); color: var(--va-green-800); }
body.va-ui .typeahead-item p { margin: 0; }
body.va-ui .typeahead-item p:first-child { font-weight: 600; }
body.va-ui .typeahead-item p + p { font-size: var(--va-fs-sm); color: var(--va-muted); }

/* --------------------------------------------------------------------------
   Timeline (record history: COP update, Change of Activity). Divs, not li:
   the template's components.css styles .timeline li.timeline-item.
   <div class="va-timeline">
     <div class="va-timeline__item va-timeline__item--success">
       <div class="va-timeline__date">..</div><div class="va-timeline__title">..</div>
       <div class="va-timeline__note">..</div></div></div>
   A step that hasn't happened yet adds --pending (hollow dot, muted title).
   -------------------------------------------------------------------------- */
.va-timeline { position: relative; margin: 4px 0 0; padding-left: 26px; }
.va-timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--va-border); }
.va-timeline__item { position: relative; padding-bottom: 16px; }
.va-timeline__item:last-child { padding-bottom: 0; }
.va-timeline__item::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--va-surface);
    background: var(--va-neutral-fg);
    box-shadow: 0 0 0 1px var(--va-border);
}
.va-timeline__item--success::before { background: var(--va-success-fg); }
.va-timeline__item--info::before    { background: var(--va-info-fg); }
.va-timeline__item--warning::before { background: #f59e0b; }
.va-timeline__item--danger::before  { background: var(--va-danger-fg); }
.va-timeline__item--accent::before  { background: var(--va-accent-fg); }
.va-timeline__item--pending::before { background: var(--va-surface); border-color: var(--va-subtle); box-shadow: none; }
.va-timeline__item--pending .va-timeline__title { color: var(--va-muted); font-weight: 500; }
.va-timeline__date { font-size: var(--va-fs-sm); color: var(--va-subtle); }
.va-timeline__title { font-weight: 600; color: var(--va-text-strong); }
.va-timeline__by { font-size: var(--va-fs-ctl); color: var(--va-text); }
.va-timeline__note {
    margin-top: 6px;
    padding: 7px 10px;
    border-left: 3px solid var(--va-border);
    border-radius: 0 var(--va-radius-sm) var(--va-radius-sm) 0;
    background: #f6f8f6;
    font-size: var(--va-fs-ctl);
    color: var(--va-text);
    white-space: pre-line;
}
.va-timeline__note--accent { border-left-color: var(--va-accent-fg); }

/* --------------------------------------------------------------------------
   Steps (a workflow's stages in order: COP verification chain).
   <ol class="va-steps"><li class="va-steps__item va-steps__item--done">1. AO Verify</li>
   ... --active (add aria-current="step"), --pending, --skipped
   -------------------------------------------------------------------------- */
.va-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; margin: 0 0 10px; padding: 0; list-style: none; }
.va-steps__item {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 22px;
    padding: 3px 10px;
    border-radius: var(--va-radius-md);
    background: var(--va-neutral-bg);
    color: var(--va-neutral-fg);
    font-size: var(--va-fs-sm);
    font-weight: 600;
}
.va-steps__item:last-child { margin-right: 0; }
.va-steps__item:not(:last-child)::after {
    content: '\203A';
    position: absolute;
    right: -15px;
    color: var(--va-subtle);
    font-size: 16px;
    font-weight: 400;
    text-decoration: none;
}
.va-steps__item--done    { background: var(--va-success-bg); color: var(--va-success-fg); }
.va-steps__item--active  { background: var(--va-warning-bg); color: var(--va-warning-fg); box-shadow: inset 0 0 0 1px #f5c48a; }
.va-steps__item--skipped { text-decoration: line-through; }

/* --------------------------------------------------------------------------
   Accordion (Bootstrap 5 .accordion markup with .va-accordion on the wrapper):
   one bordered section per group, e.g. COP Monitoring's Strategic Priorities.
   custom_styles.css pads every .collapse (the nav uses it), so undo that here.
   -------------------------------------------------------------------------- */
.va-accordion .accordion-item { border: 1px solid var(--va-border); border-radius: var(--va-radius-md) !important; overflow: hidden; background: var(--va-surface); }
.va-accordion .accordion-item + .accordion-item { margin-top: 10px; }
.va-accordion .accordion-button {
    gap: 10px;
    padding: 12px 16px;
    background: var(--va-surface);
    box-shadow: none;
    font-family: var(--va-font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--va-text-strong);
}
.va-accordion .accordion-button:not(.collapsed) { background: var(--va-green-50); color: var(--va-green-800); box-shadow: inset 0 -1px 0 var(--va-border); }
.va-accordion .accordion-button:focus { box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2); border-color: transparent; }
.va-accordion .accordion-button::after { filter: grayscale(1); }
.va-accordion .accordion-collapse.collapse { padding: 0; background: transparent; overflow: visible; }
.va-accordion .accordion-body { padding: 0; }
.va-accordion__count { margin-left: auto; margin-right: 6px; }

/* --------------------------------------------------------------------------
   Legacy hook classes kept on upgraded markup because tests or the tutorial
   scenes select them (see CLAUDE.md): undo the Bootstrap look they'd bring.
   -------------------------------------------------------------------------- */
/* button.btn-warning: tutorial scene 08's Change of Activity button. The template's
   colors.css forces .btn-warning orange with !important, so these need it too. */
.va-btn--outline.btn-warning {
    background-color: var(--va-surface) !important;
    border-color: var(--va-green-700) !important;
    color: var(--va-green-700) !important;
    box-shadow: none !important;
}
.va-btn--outline.btn-warning:hover,
.va-btn--outline.btn-warning:focus,
.va-btn--outline.btn-warning:active {
    background-color: var(--va-green-50) !important;
    color: var(--va-green-800) !important;
}
/* .progress on <x-va.progress>: tutorial scene 10 spotlights #accordionPriorities .progress */
.va-progress.progress { height: auto; overflow: visible; background: none; border-radius: 0; box-shadow: none; font-size: inherit; line-height: normal; }

/* --------------------------------------------------------------------------
   SweetAlert2 dialogs on upgraded pages (body.va-ui is set by vitiagri-ui.js
   when the page has a .va-page-header); other pages keep the old look.
   -------------------------------------------------------------------------- */
body.va-ui .swal2-popup {
    padding: 22px 22px 18px;
    border-radius: var(--va-radius-lg);
    font-family: var(--va-font-body);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}
body.va-ui .swal2-title { font-family: var(--va-font-heading); font-size: 20px; font-weight: 700; color: var(--va-text-strong); }
body.va-ui .swal2-content,
body.va-ui .swal2-html-container { font-size: var(--va-fs-base); color: var(--va-text); }
body.va-ui .swal2-actions { gap: 8px; }
body.va-ui .swal2-styled {
    margin: 0 !important;
    padding: 0 16px !important;
    height: 34px;
    border-radius: var(--va-radius-sm) !important;
    font: 600 var(--va-fs-base) var(--va-font-body) !important;
    box-shadow: none !important;
}
body.va-ui .swal2-styled.swal2-confirm { background-color: var(--va-green-700) !important; }
body.va-ui .swal2-styled.swal2-cancel { background-color: #eceeec !important; color: var(--va-text) !important; }
/* A confirm that deletes something reads as danger */
body.va-ui .swal2-popup:has(.swal2-warning.swal2-icon-show, .swal2-icon.swal2-warning[style*="flex"]) .swal2-confirm { background-color: var(--va-danger-fg) !important; }

/* --------------------------------------------------------------------------
   Attachment (<x-va.attachment>): current file preview + file input
   -------------------------------------------------------------------------- */
.va-attachment { display: flex; flex-direction: column; gap: 8px; }
.va-attachment__current {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--va-border);
    border-radius: var(--va-radius-md);
    background: #fbfcfb;
    font-size: var(--va-fs-ctl);
    color: var(--va-text);
}
.va-attachment__current a { color: var(--va-green-800); font-weight: 600; word-break: break-all; }
.va-attachment__thumb { flex: none; width: 48px; height: 48px; object-fit: cover; border-radius: var(--va-radius); border: 1px solid var(--va-border); }
.va-attachment__icon { flex: none; font-size: 28px; color: var(--va-green-700); }
.va-attachment__current--empty { color: var(--va-muted); background: transparent; border-style: dashed; }

/* --------------------------------------------------------------------------
   Public application forms (layouts/public_form): one centred column, phone first
   -------------------------------------------------------------------------- */
body.va-public { margin: 0; min-height: 100vh; background: var(--va-bg); color: var(--va-text); font-family: var(--va-font-body); font-size: var(--va-fs-base); }
.va-public-band { background: var(--va-green-900); color: #fff; }
.va-public-band__inner { display: flex; align-items: center; gap: 14px; max-width: 920px; margin: 0 auto; padding: 14px 16px; }
.va-public-band__logo { width: 48px; height: 48px; padding: 3px; border-radius: 10px; background: #fff; object-fit: contain; flex: none; }
.va-public-band__org { font-size: var(--va-fs-sm); opacity: .85; }
.va-public-band__title { font-family: var(--va-font-heading); font-size: 19px; font-weight: 700; line-height: 1.25; }
.va-public-main { max-width: 920px; margin: 0 auto; padding: 18px 16px 8px; }
.va-public-main .va-card { margin-bottom: 14px; }
.va-public-intro { margin: 0 0 14px; font-size: var(--va-fs-base); }
.va-public-footer { padding: 18px 16px 26px; text-align: center; color: var(--va-subtle); font-size: var(--va-fs-ctl); }
/* Bigger touch targets for the public */
.va-public .va-legacy-form .form-control:not(.btn),
.va-public .va-legacy-form .custom-select { height: 40px; font-size: 15px; }
.va-public .va-legacy-form textarea.form-control,
.va-public .va-legacy-form select.form-control[multiple] { height: auto; min-height: 96px; }
.va-public .va-legacy-form select.form-control[multiple] { min-height: 132px; padding: 6px; }
.va-public-hint { display: block; margin-top: 3px; font-size: var(--va-fs-sm); color: var(--va-subtle); }
/* A table of inputs (e.g. export commodities): scrolls sideways on phones */
.va-public .va-input-table { min-width: 560px; }
.va-public .va-input-table td { vertical-align: middle; }
.va-public .va-input-table .form-control { min-width: 110px; }
/* Captcha: the image shrinks to fit narrow phones */
.va-captcha { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.va-captcha .captcha-image { display: block; max-width: 100%; padding: 6px; border: 1px solid var(--va-border); border-radius: var(--va-radius-md); background: #fff; }
.va-captcha .captcha-image img { display: block; max-width: 100%; height: auto; }
.va-public-submit { display: flex; justify-content: flex-end; margin: 4px 0 10px; }
@media (max-width: 575.98px) {
    .va-public-band__title { font-size: 16px; }
    .va-public-submit .va-btn { width: 100%; height: 44px; font-size: 15px; }
}
/* A notice that replaces a closed form */
.va-public-closed { padding: 32px 20px; text-align: center; }
.va-public-closed i { font-size: 44px; color: var(--va-green-700); }
.va-public-closed h2 { margin: 10px 0 6px; font-family: var(--va-font-heading); font-size: 22px; font-weight: 600; color: var(--va-green-800); }
/* The template's bootstrap.css colours links lavender */
body.va-public main a:not(.va-btn) { color: var(--va-green-600); text-decoration: underline; }

/* --------------------------------------------------------------------------
   Input with a leading icon and an optional trailing button (show password).
   <div class="va-input-group"><i class="ph ph-envelope-simple"></i><input ...>
       <button type="button" class="va-input-group__btn">...</button></div>
   The same piece as the mobile app's (moafiji-app src/theme/va-components.scss).
   -------------------------------------------------------------------------- */
.va-input-group {
    display: flex;
    align-items: center;
    height: 44px;
    border: 1px solid var(--va-input-border);
    border-radius: var(--va-radius-sm);
    background: var(--va-surface);
    transition: border-color .15s, box-shadow .15s;
}
.va-input-group:focus-within {
    border-color: var(--va-green-700);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}
.va-input-group > i { flex: none; padding-left: 12px; font-size: 20px; color: var(--va-muted); }
.va-input-group > input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 12px;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: var(--va-font-body);
    font-size: 16px;
    color: var(--va-text);
}
.va-input-group > input::placeholder { color: var(--va-subtle); opacity: 1; }
.va-input-group__btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 100%;
    border: 0;
    border-radius: 0 var(--va-radius-sm) var(--va-radius-sm) 0;
    background: transparent;
    color: var(--va-label);
    font-size: 20px;
    cursor: pointer;
}
.va-input-group__btn:focus-visible { outline: 2px solid var(--va-green-700); outline-offset: -2px; }
.va-field.is-invalid .va-input-group { border-color: var(--va-danger-fg); }

/* --------------------------------------------------------------------------
   Sign-in pages (layouts/auth: login, forgot and reset password). The same
   design as the mobile app's sign-in: a dark green band over the farm photo
   with the logo, then a white card overlapping it. The layout has no
   Bootstrap, so this section sets the page basics too.
   -------------------------------------------------------------------------- */
body.va-auth {
    margin: 0;
    min-height: 100vh;
    background: var(--va-bg);
    color: var(--va-text);
    font-family: var(--va-font-body);
    font-size: var(--va-fs-base);
    line-height: 1.45;
}
body.va-auth *, body.va-auth *::before, body.va-auth *::after { box-sizing: border-box; }
.va-auth-page { display: flex; flex-direction: column; min-height: 100vh; }
.va-auth-band {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 32px 16px 76px;
    color: #fff;
    text-align: center;
    background:
        linear-gradient(rgba(28, 56, 41, 0.68), rgba(28, 56, 41, 0.78)),
        var(--va-auth-photo, none) 40% 30% / cover no-repeat,
        var(--va-green-900);
}
.va-auth-band__logo {
    display: block;
    width: 96px;
    height: 96px;
    margin: 0 auto 10px;
    padding: 4px;
    border-radius: 50%;
    background: #fff;
    object-fit: contain;
}
.va-auth-band__title { margin: 0; font-family: var(--va-font-heading); font-size: 26px; font-weight: 700; line-height: 1.2; color: #fff; }
.va-auth-band__sub { margin-top: 2px; font-size: var(--va-fs-base); opacity: .85; }
.va-auth-main {
    flex: none;
    width: 100%;
    max-width: 440px;
    margin: -44px auto 0;
    padding: 0 16px 28px;
}
.va-auth__card { padding: 22px 18px 18px; margin-bottom: 0; }
.va-auth__title { margin: 0 0 4px; font-family: var(--va-font-heading); font-size: 20px; font-weight: 700; color: var(--va-text-strong); }
.va-auth__intro { margin: 0 0 16px; font-size: var(--va-fs-ctl); color: var(--va-muted); }
.va-auth .va-field { margin-bottom: 12px; }
.va-auth .va-input { height: 44px; font-size: 16px; }
/* The auth status / error components print plain lines: stack them */
.va-auth .va-alert { display: block; margin-bottom: 12px; }
.va-auth .va-alert p { margin: 0; }
.va-auth .va-alert p + p { margin-top: 4px; }
.va-auth__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 44px;
    margin: 2px 0 10px;
}
.va-auth .va-check { font-size: var(--va-fs-ctl); }
.va-auth .va-check input[type="checkbox"] { width: 18px; height: 18px; }
.va-auth__link { font-size: var(--va-fs-ctl); font-weight: 600; color: var(--va-green-600); text-decoration: none; }
.va-auth__link:hover { text-decoration: underline; }
.va-auth__link:focus-visible { outline: 2px solid var(--va-green-700); outline-offset: 2px; border-radius: 4px; }
.va-auth__center { margin-top: 14px; text-align: center; }
.va-auth .va-btn { width: 100%; height: 44px; font-size: var(--va-fs-base); }
/* Tablets and desktops: the photo fills the whole page and the logo and card
   sit centred on it. Phones keep the band-over-card layout, as in the app. */
@media (min-width: 640px) {
    .va-auth-page {
        justify-content: center;
        padding: 32px 16px;
        background:
            linear-gradient(rgba(28, 56, 41, 0.68), rgba(28, 56, 41, 0.78)),
            var(--va-auth-photo, none) 40% 30% / cover no-repeat fixed,
            var(--va-green-900);
    }
    .va-auth-band { flex: none; min-height: 0; padding: 0 0 22px; background: none; }
    .va-auth-main { max-width: 400px; margin: 0 auto; padding: 0; }
    .va-auth__card { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); }
}

/* --------------------------------------------------------------------------
   Footer (layout)
   -------------------------------------------------------------------------- */
.va-footer { color: var(--va-subtle); font-size: var(--va-fs-ctl); }
.va-footer a { text-decoration: none; }
.va-footer a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Keyboard focus: a visible green ring on every interactive va- element
   (mouse clicks don't trigger :focus-visible, so it only shows for keyboards)
   -------------------------------------------------------------------------- */
.va-chip:focus-visible,
.va-tabs .va-tab:focus-visible,
.va-tabs.nav.nav-tabs .nav-item .nav-link:focus-visible,
.cop-tabs .cop-tab:focus-visible,
.va-pager a:focus-visible,
.va-breadcrumb a:focus-visible,
table.va-table a:focus-visible,
.va-footer a:focus-visible {
    outline: 2px solid var(--va-green-700) !important;
    outline-offset: 2px;
    border-radius: 4px;
}
