﻿/* The app's design tokens. Loads LAST, after both Tabler and Radzen, because it exists to
   reconcile them.

   This file replaces navMenu.css, dashboard.css and workerdashboard.css (2137 lines, of which
   ~10 selectors were still reachable). Those were copied verbatim from the WASM portal and
   styled a header that no longer exists; three of their rules leaked onto Tabler classes the
   new shell does use, which is why icon buttons rendered grey and the header avatar rendered
   at the wrong size.

   The brand green was previously set on --rz-primary only, so Radzen's controls were green
   while every Tabler button, link, badge and nav item stayed Tabler's default blue. One token,
   fed to both systems, is the whole point of this file. */

:root {
    /* #0AA89A, owner decision 2026-10-07 (was #12b886); -dark is 12% darker, for hover and contrast. */
    --smartag-brand: #0aa89a;
    --smartag-brand-rgb: 10, 168, 154;
    --smartag-brand-dark: #099487;

    /* Scouting (observation tasks): deep indigo, owner decision 2026-10-08. A placeholder shade until the
       designer picks the exact one; used by the calendar's scouting rounds and the planting form's badge. */
    --smartag-scouting: #3b3fb6;
    --smartag-scouting-soft: #e8e9fb;

    /* Secondary text on a raised surface. --tblr-secondary is a fixed grey that Tabler does not
       lighten for dark mode, and at 0.75rem uppercase it lands at 3.05:1 there — below the 4.5:1
       small text needs. Overridden per theme below. */
    --smartag-muted: var(--tblr-secondary);

    /* Tabler. --tblr-primary-rgb is not optional: Tabler builds every translucent variant
       (.bg-primary-lt, focus rings, active nav backgrounds) from the rgb triplet, so setting
       only --tblr-primary leaves those blue. */
    --tblr-primary: var(--smartag-brand);
    --tblr-primary-rgb: var(--smartag-brand-rgb);
    --tblr-primary-darken: var(--smartag-brand-dark);
    --tblr-link-color: var(--smartag-brand);
    --tblr-link-color-rgb: var(--smartag-brand-rgb);

    /* Radzen. !important because Radzen's base stylesheet declares --rz-primary on :root too,
       and this file cannot rely on being the later of two equal-specificity declarations
       once a theme swap rewrites that <link>'s href. */
    --rz-primary: var(--smartag-brand) !important;

    /* RadzenNumeric's spinner buttons do NOT read --rz-primary. The default theme paints them from
       --rz-secondary (#35a0d7), so all 67 numeric fields in the app wore a blue that appears nowhere
       else in the design — measured across six pages, these two buttons are its only occurrence.
       The darker brand rather than the base one, for contrast against the white arrow glyphs. */
    --rz-numeric-button-background-color: var(--smartag-brand-dark) !important;
}

/* Tabler's own dark palette lightens its primary for contrast on a dark surface; the brand
   green needs the same treatment or it reads muddy against --tblr-bg-surface. */
[data-bs-theme="dark"] {
    --smartag-brand: #2fb5a9;
    --smartag-brand-rgb: 47, 181, 169;
    --smartag-brand-dark: #0aa89a;

    --smartag-scouting: #7c80f0;
    --smartag-scouting-soft: #23264a;

    /* 6.1:1 on --tblr-bg-surface-secondary, against the 3.05:1 --tblr-secondary gives there. */
    --smartag-muted: #9aa8b6;
}

/* Validation messages inherit Blazor's default red; align them with Tabler's danger so they
   match every other error surface in the app. */
.validation-message {
    color: var(--tblr-danger);
}

/* Kept from dashboard.css and rewritten against Tabler's variables — it was hardcoded to light-mode
   hex (#f8f9fa) and inverted badly the moment a dark theme was possible.

   The .card-table heading rule that used to sit here has gone: the Tables section below supersedes
   every one of its declarations, and leaving a dead copy above it reads as if the tinted heading
   strip were still intended. */
.list-group-item {
    transition: background-color 0.15s ease;
    background-color: transparent;
}

.list-group-item:hover {
    background-color: var(--tblr-bg-surface-secondary);
}

.list-group-item.active {
    background-color: var(--tblr-bg-surface-secondary);
    color: var(--tblr-body-color);
    border-left: 3px solid var(--tblr-primary);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Avatars are circular here, which Tabler's default (a rounded rect) is not. The old rule also
   pinned width/height to 48px, which silently beat every .avatar-sm/.avatar-md modifier — including
   the one on the header's user initials. Shape only; Tabler keeps ownership of the size. */
.avatar {
    border-radius: 50%;
}

.avatar .icon {
    font-size: 20px;
}

/* Icon sizing helpers used by the auth pages and the shell. */
.small-icon { font-size: 14px; }
.medium-icon { font-size: 16px; }

/* -------------------------------------------------------------------------------------------- */
/* App shell                                                                                      */
/* -------------------------------------------------------------------------------------------- */

/* The theme toggle's two icons.

   Tabler ships .hide-theme-dark / .hide-theme-light for exactly this, and they CANNOT be used here.
   Both are scoped to <body> — and the second is written as
   `body:not(.theme-dark):not([data-bs-theme=dark]) .hide-theme-light`. This app sets data-bs-theme on
   <html>, because the pre-paint script in App.razor runs in <head> and has no <body> to write to yet,
   so that :not() is permanently true and Tabler hides the light-mode icon in BOTH themes. Re-scoping
   the dark rule to the root is not enough; the light rule has to be escaped entirely, so these are
   own class names Tabler does not style.

   Driven by CSS rather than JS so the correct icon is present on the very first paint. */
.theme-toggle-to-dark,
.theme-toggle-to-light {
    display: none;
}

[data-bs-theme="light"] .theme-toggle-to-dark,
[data-bs-theme="dark"] .theme-toggle-to-light {
    display: flex;
}

/* Two rows in one sticky header (2026-09-30 design): a top bar — brand, notifications, user — and a
   menu bar beneath it whose active group is underlined. Both rows sit on the surface colour, each
   closed by a hairline, so the header reads as one block over the page canvas. */
.app-header {
    background: var(--tblr-bg-surface);
}

.app-menubar {
    padding: 0;
    background: transparent;
}

.app-menubar .navbar-nav {
    gap: 0.5rem;
}

/* The bell: a round, bordered icon button, as in the design. */
.app-bell {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0 !important;
    justify-content: center;
    border: 1px solid var(--tblr-border-color);
    border-radius: 50% !important;
}

.app-bell-menu {
    min-width: 16rem;
}

@media (min-width: 768px) {
    /* Tall, square-cornered links so the underline can sit on the menu bar's own bottom edge. */
    .app-menubar .nav-link {
        position: relative;
        padding: 1.15rem 0.875rem !important;
        border-radius: 0 !important;
        color: var(--tblr-body-color);
        font-weight: 500;
    }

    .app-menubar .nav-link:hover {
        color: var(--tblr-primary);
        background: transparent;
    }

    /* The active underline. ::before because Tabler draws the dropdown chevron with ::after. The
       plain Dashboard link is active through NavLink's class on the <a>; a group is active through
       NavMenu's class on its <li> — both are covered. */
    .app-menubar .nav-link.active::before,
    .app-menubar .nav-item.dropdown.active > .nav-link::before {
        content: "";
        position: absolute;
        left: 0.5rem;
        right: 0.5rem;
        bottom: -1px;
        height: 2px;
        border-radius: 2px 2px 0 0;
        background: var(--tblr-primary);
    }

    .app-menubar .nav-link.active {
        color: var(--tblr-primary);
    }

    /* Tabler's horizontal navbar draws its own active marker on the <li>; this bar draws one. */
    .app-menubar .nav-item::after {
        display: none;
    }
}

.app-header .navbar-brand-image {
    height: 36px;
    width: auto;
}

/* Same CSS-only swap as the theme toggle icons, for the same reason: chosen before first paint. */
.brand-mark-light,
.brand-mark-dark {
    display: none;
}

[data-bs-theme="light"] .brand-mark-light,
[data-bs-theme="dark"] .brand-mark-dark {
    display: block;
}

/* The active group in the menu bar. Tabler highlights .nav-link.active on plain links but a
   dropdown toggle is never itself "current", so the state is carried on the <li> instead. */
.navbar-nav .nav-item.dropdown.active > .nav-link {
    color: var(--tblr-primary);
    font-weight: 600;
}

.navbar-nav .dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav .dropdown-menu .dropdown-item-icon {
    font-size: 18px;
    opacity: 0.7;
}

.navbar-nav .dropdown-menu .dropdown-item.active {
    background-color: var(--tblr-bg-surface-secondary);
    color: var(--tblr-primary);
}

.navbar-nav .dropdown-menu .dropdown-item.active .dropdown-item-icon {
    opacity: 1;
}

/* Font Awesome in the menu (2026-10-14). Its glyphs read larger than Material Symbols at the same size, and
   fa-fw gives every icon the same width so the labels line up. */
.navbar-nav .nav-link-icon .fa-solid {
    font-size: 1rem;
}

.navbar-nav .dropdown-menu .dropdown-item-icon.fa-solid {
    font-size: 0.95rem;
}

/* Seven top-level groups since Equipment and Fleet (owner decision 2026-10-27) do not fit one line of the menu bar
   below about 1280px with their labels, so between the horizontal-nav breakpoint (768px) and 1280px the labels go
   and the icons stay; each toggle carries the label as title and aria-label (NavMenu.razor). Phones keep the
   collapsed menu with full labels. tools/ui-check.mjs asserts both widths. */
@media (min-width: 768px) and (max-width: 1279.98px) {
    .app-menubar .navbar-nav > .nav-item > .nav-link .nav-link-title {
        display: none;
    }

    .app-menubar .navbar-nav > .nav-item > .nav-link .nav-link-icon {
        margin-right: 0;
    }
}

/* ============================================================================================== */
/* DESIGN LANGUAGE                                                                                */
/*                                                                                                */
/* Soft bento: a warm neutral canvas, white cards with a large radius and no border, one diffuse   */
/* shadow doing the separating that borders used to, and generous internal padding.                */
/*                                                                                                */
/* Driven through Tabler's OWN custom properties wherever it has one, rather than by out-styling   */
/* its selectors. Tabler declares the card variables on `.card` itself, so those have to be        */
/* redeclared at the same specificity — this file loads later, which is what makes that work. The  */
/* payoff is that all 67 pages inherit the language without being touched: 67 of them use .card,   */
/* 61 use .page-header, 33 use .card-table.                                                        */
/* ============================================================================================== */

:root {
    /* One diffuse shadow, two layers: a tight one for the edge, a wide one for the lift. Borders
       are gone, so this is the only thing separating a card from the canvas. */
    --smartag-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 16px -4px rgba(16, 24, 40, 0.06);
    --smartag-shadow-raised: 0 2px 4px rgba(16, 24, 40, 0.05), 0 14px 32px -8px rgba(16, 24, 40, 0.12);

    /* #f8f9fa by owner decision, 2026-11-16: a lighter, neutral grey. It replaced the warm #f3f2ef this
       look started with (chosen over Tabler's blue-grey #f6f8fb). */
    --tblr-body-bg: #f8f9fa;

    --tblr-shadow-card: var(--smartag-shadow);

    --tblr-border-radius-sm: 6px;
    --tblr-border-radius: 8px;
    --tblr-border-radius-lg: 12px;
    --tblr-border-radius-xl: 18px;
}

[data-bs-theme="dark"] {
    --smartag-shadow: 0 1px 2px rgba(0, 0, 0, 0.28), 0 6px 16px -4px rgba(0, 0, 0, 0.32);
    --smartag-shadow-raised: 0 2px 4px rgba(0, 0, 0, 0.32), 0 14px 32px -8px rgba(0, 0, 0, 0.45);

    --tblr-body-bg: #10161d;
}

/* -------------------------------------------------------------------------------------------- */
/* Cards                                                                                          */
/* -------------------------------------------------------------------------------------------- */

.card {
    --tblr-card-border-width: 0;
    --tblr-card-border-radius: 18px;
    --tblr-card-inner-border-radius: 18px;
    --tblr-card-spacer-y: 1.5rem;
    --tblr-card-spacer-x: 1.5rem;
    --tblr-card-cap-padding-y: 1.25rem;
    --tblr-card-cap-padding-x: 1.5rem;

    /* The header's tinted strip is what makes a stock Tabler card read as a panel rather than a
       surface. The reference has no such strip anywhere. */
    --tblr-card-cap-bg: transparent;
}

.card-header {
    border-bottom: 0;
    padding-bottom: 0.5rem;
}

/* A header immediately followed by a table still needs the rule — without it the column headings
   float. Everything else loses it. */
.card-header + .table,
.card-header + .table-responsive,
.card-header + .card-table {
    border-top: 1px solid var(--tblr-border-color);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-footer {
    border-top: 1px solid var(--tblr-border-color);
    background: transparent;
}

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

.page-body {
    margin-top: 1.5rem;
}

/* Tabler gives .page-header a TOP margin and no bottom one, because its own layout puts the header
   outside .page-body and lets the body's padding do the separating. Every page in this app puts the
   header inside the body instead, so whatever follows sits hard against the title.

   The selector has to carry .page-wrapper. Tabler declares this twice — once as `.page-header` and
   again as `.page-wrapper .page-header` — and the second wins on specificity for every page in this
   app, because MainLayout puts them all inside .page-wrapper. A bare `.page-header` here is simply
   never applied. */
.page-wrapper .page-header {
    margin-bottom: 1.25rem;
}

.page-pretitle {
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    color: lightslategrey;
    font-weight: 600;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* -------------------------------------------------------------------------------------------- */
/* Controls                                                                                       */
/* -------------------------------------------------------------------------------------------- */

.btn {
    font-weight: 500;
}

.badge {
    border-radius: var(--tblr-border-radius-pill);
    font-weight: 500;
    padding: 0.3em 0.7em;
}

.dropdown-menu {
    border: 0;
    border-radius: 14px;
    box-shadow: var(--smartag-shadow-raised);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
}

.dropdown-header {
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--smartag-muted);
    font-weight: 600;
}

/* Radzen's inputs sit inside Tabler cards on every form in the app; matching the radius is what
   stops the two systems reading as two systems. */
.rz-textbox,
.rz-textarea,
.rz-dropdown,
.rz-numeric,
.rz-datepicker,
.rz-button {
    border-radius: var(--tblr-border-radius) !important;
}

/* -------------------------------------------------------------------------------------------- */
/* Tables                                                                                         */
/*                                                                                                */
/* There are TWO table idioms in this app and they have to end up looking like one thing: 42       */
/* hand-rolled `table card-table table-vcenter` and 7 RadzenDataGrid. Whether a list can sort and  */
/* page is a real difference and a Phase 3 question; whether it looks like the same product is     */
/* not, and until this section the grid pages were visibly a different one — grey header strip,    */
/* vertical rules between every cell, zebra striping, square corners inside a rounded card.        */
/*                                                                                                */
/* Everything below is expressed once and then pointed at both idioms.                             */
/* -------------------------------------------------------------------------------------------- */

:root {
    --smartag-table-cell-y: 0.75rem;
    /* 1.25rem, not 1rem, because that is the inset Tabler already gives .card-table — the value that
       makes a table bleeding to the card's edge line its text up with the card's own content. The
       grid is brought to it rather than the other way round. */
    --smartag-table-cell-x: 1.25rem;
    /* Hover has to be visible on white and on the dark surface without becoming a block of colour.
       A translucent tint of the body text does that in both themes from one declaration. */
    --smartag-row-hover: rgba(var(--tblr-body-color-rgb, 24, 36, 51), 0.035);
}

[data-bs-theme="dark"] {
    --smartag-row-hover: rgba(255, 255, 255, 0.045);
}

/* ---- hand-rolled tables ---- */

/* The tinted heading strip goes; the tracking and the muted colour stay, because they are what make
   a heading row read as a heading without a fill behind it. */
.card-table thead th {
    background-color: transparent;
    border-bottom: 1px solid var(--tblr-border-color);
    color: var(--smartag-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.table > tbody > tr > td,
.table > thead > tr > th {
    padding-top: var(--smartag-table-cell-y);
    padding-bottom: var(--smartag-table-cell-y);
}

.table tbody tr {
    transition: background-color 0.12s ease;
}

.table tbody tr:hover > td {
    background-color: var(--smartag-row-hover);
}

/* The last row's rule would otherwise sit against the card's bottom edge, or against a footer that
   already has one of its own. */
.table tbody tr:last-child td {
    border-bottom: 0;
}

/* Figures line up column-wise only with tabular numerals; proportional digits make a right-aligned
   column of numbers ragged at the decimal point. */
.table td.text-end,
.table th.text-end,
.rz-grid-table .rz-text-align-right {
    font-variant-numeric: tabular-nums;
}

/* The empty state is a single colspan cell on 33 pages, written by hand each time. Give it room. */
.table tbody td[colspan] {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
    color: var(--smartag-muted);
}

.table-responsive {
    scrollbar-width: thin;
}

/* ---- RadzenDataGrid ---- */

/* Driven entirely through Radzen's own custom properties, which turn out to cover every difference
   that mattered — surface, both border axes, cell rhythm, heading typography and striping.
   Out-styling its selectors was the first attempt and it was worse in two specific ways:

   - `border-right: 0` silently does nothing. Radzen draws the vertical rules with the LOGICAL
     property `border-inline-end`, and a physical longhand does not override a logical one.
   - the striping rule is `tbody>tr:not(.rz-expanded-row-content):nth-child(even)>td`. Beating that
     takes a longer selector, and the next Radzen upgrade that touches it would win back silently.

   Variables have neither problem, and they put the two table idioms on the same numbers rather than
   on numbers that happen to match today. */
:root {
    /* The grid is inside a card; the card is the surface. */
    --rz-grid-background-color: transparent;
    --rz-grid-border: none;
    --rz-grid-header-background-color: transparent;
    --rz-grid-header-sorted-background-color: transparent;

    /* Horizontal rules only. */
    --rz-grid-right-cell-border: none;
    --rz-grid-header-cell-border: none;
    --rz-grid-header-cell-border-bottom: 1px solid var(--tblr-border-color);
    --rz-grid-bottom-cell-border: 1px solid var(--tblr-border-color);

    /* The same two tokens the hand-rolled tables use, so the rhythm cannot drift apart.
       --rz-grid-header-title-padding-inline is zeroed because Radzen pads the inner .rz-column-title
       as well as the th; left at its default the heading sits 0.5rem right of the column it labels. */
    --rz-grid-cell-padding: var(--smartag-table-cell-y) var(--smartag-table-cell-x);
    --rz-grid-header-cell-padding: var(--smartag-table-cell-y) var(--smartag-table-cell-x);
    --rz-grid-header-title-padding-inline: 0 0;

    /* Matched to .card-table thead th above. */
    --rz-grid-header-font-size: 0.6875rem;
    --rz-grid-header-font-weight: 600;
    --rz-grid-header-text-transform: uppercase;
    --rz-grid-header-color: var(--smartag-muted);

    /* Striping and hover are two ways to answer "which row am I on", and the striped one answers it
       permanently — at the cost of the surface reading as a grid rather than a list. The design uses
       hover. */
    --rz-grid-stripe-background-color: transparent;
    --rz-grid-stripe-odd-background-color: transparent;
}

/* Letter-spacing is the one heading property Radzen does not expose. */
.rz-grid-table thead th .rz-column-title {
    letter-spacing: 0.06em;
}

.rz-grid-table .rz-data-row {
    transition: background-color 0.12s ease;
}

/* Matched at `>td` because that is where the stripe rule puts its colour; a background on the <tr>
   would sit behind the cells and never be seen. */
.rz-grid-table tbody > tr.rz-data-row:hover > td {
    background-color: var(--smartag-row-hover);
}

/* The sort affordance is a control, not content — it should not compete with the heading. */
.rz-sortable-column .rz-sortable-column-icon {
    opacity: 0.55;
}

/* ---- the pager ---- */

.rz-pager {
    border: 0;
    background: transparent;
    padding: 0.75rem var(--smartag-table-cell-x);
}

.rz-pager .rz-pager-element {
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--smartag-muted);
    min-width: 2rem;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.rz-pager .rz-pager-element:hover:not(.rz-state-disabled) {
    background: var(--tblr-bg-surface-secondary);
    color: var(--tblr-body-color);
}

.rz-pager .rz-pager-element.rz-state-active {
    background: var(--smartag-brand);
    color: #fff;
}

.rz-pager .rz-state-disabled {
    opacity: 0.35;
}

/* -------------------------------------------------------------------------------------------- */
/* Shell                                                                                          */
/* -------------------------------------------------------------------------------------------- */

/* The header sits on the canvas rather than floating above it, so the hairline is the whole
   separation — declared once, in the Shell section above. */
.navbar-nav .nav-link {
    border-radius: 8px;
}

/* -------------------------------------------------------------------------------------------- */
/* Stat tile — Components/Shared/StatTile.razor                                                   */
/* -------------------------------------------------------------------------------------------- */

/* Not scoped CSS: the glyphs are rendered by RadzenIcon, a child component whose <i> never carries
   this component's scope attribute. See the note at the top of StatTile.razor. */

.stat-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 150px;
    padding: 1.25rem;
    border-radius: 18px;
    background: var(--tblr-bg-surface);
    box-shadow: var(--smartag-shadow);
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

/* Only tiles that go somewhere lift, so the movement means "this is clickable" rather than
   decorating every tile on the page. */
.stat-tile:has(.stat-tile-go):hover {
    box-shadow: var(--smartag-shadow-raised);
    transform: translateY(-2px);
}

.stat-tile-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    /* Reserve the corner so a long label never runs under the arrow. */
    padding-right: 2rem;
}

.stat-tile-icon {
    display: inline-flex;
    color: var(--smartag-muted);
}

.stat-tile-icon .rzi {
    font-size: 18px;
}

.stat-tile-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--tblr-body-color);
}

.stat-tile-value {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-top: auto;
}

/* Light weight at a large size is the whole character of the figure — at 600 it reads as a heading
   rather than a measurement. Tabular numerals so a changing value does not jitter. */
.stat-tile-number {
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.stat-tile-number-loading {
    color: var(--smartag-muted);
}

.stat-tile-unit {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--smartag-muted);
}

.stat-tile-badge {
    margin-left: 0.5rem;
    padding: 0.2em 0.6em;
    border-radius: var(--tblr-border-radius-pill);
    font-size: 0.6875rem;
    font-weight: 500;
    background: var(--tblr-bg-surface-secondary);
    color: var(--smartag-muted);
}

.stat-tile-caption {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--smartag-muted);
}

.stat-tile-go {
    position: absolute;
    top: 0.875rem;
    right: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    color: var(--smartag-muted);
    background: transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.stat-tile-go .rzi {
    font-size: 16px;
}

.stat-tile:hover .stat-tile-go {
    background: var(--tblr-bg-surface-secondary);
    color: var(--tblr-body-color);
}

/* The accent variant. One per screen. */
.stat-tile-accent {
    background: var(--smartag-brand);
    color: #fff;
}

.stat-tile-accent .stat-tile-label,
.stat-tile-accent .stat-tile-number {
    color: #fff;
}

.stat-tile-accent .stat-tile-icon,
.stat-tile-accent .stat-tile-unit,
.stat-tile-accent .stat-tile-caption,
.stat-tile-accent .stat-tile-go {
    color: rgba(255, 255, 255, 0.85);
}

.stat-tile-accent .stat-tile-badge {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.stat-tile-accent:hover .stat-tile-go,
.stat-tile-accent .stat-tile-badge {
    background: rgba(255, 255, 255, 0.22);
}

.stat-tile-accent:hover .stat-tile-go {
    color: #fff;
}

/* On the darker surface the brand green needs no lightening — it is already the foreground. Pin it
   to the light-mode value so the tile does not wash out against a dark canvas. */
[data-bs-theme="dark"] .stat-tile-accent {
    background: var(--smartag-brand-dark);
}

@media (max-width: 575.98px) {
    .stat-tile-number {
        font-size: 2rem;
    }
}

/* The tile row. Auto-fit rather than Bootstrap columns because the tiles are permission-gated: a
   user who cannot see Reports gets four tiles that fill the row, not four twelfths of one. */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* One or two tiles on a page laid out for cards (a farm's page): keep them tile-sized, not full width. */
.stat-grid-narrow {
    grid-template-columns: repeat(auto-fill, minmax(220px, 280px));
}

/* Leaflet draws its tiles into a plain <div>, so a map inside a rounded card kept square corners.
   Rounding the container is not enough on its own — the tile pane is absolutely positioned and
   overflows it. */
.leaflet-container {
    border-radius: 14px;
    overflow: hidden;
}

/* A clicked shape (a facility, a plot, a boundary) takes focus, and the browser drew its focus ring as a
   black rectangle around the shape's bounding box (2026-11-12). A shape is selected by mouse or touch, not
   tabbed to, and the selection already shows in its own style, so the ring is only noise. */
.leaflet-container path.leaflet-interactive:focus {
    outline: none;
}

/* The length of each placed side while a shape is drawn on the farm map (farmBoundaryEditor.js
   showSideLengths, 2026-11-13): a small dark pill at the side's middle, readable on satellite imagery. */
.leaflet-tooltip.side-length {
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: rgba(30, 42, 59, 0.85);
    border: 0;
    border-radius: 999px;
    box-shadow: none;
}

.leaflet-tooltip.side-length::before {
    display: none;
}

/* A crop icon's hover card on the farm setup screen's map (farmBoundaryEditor.js cropCardHtml, 2026-12-02): a dark
   card, title and subtitle, then label / value rows. */
.leaflet-tooltip.crop-card {
    min-width: 15rem;
    padding: 10px 12px;
    color: #fff;
    background: rgba(33, 37, 41, 0.9);
    border: 0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.leaflet-tooltip-top.crop-card::before {
    border-top-color: rgba(33, 37, 41, 0.9);
}

.crop-card .crop-card-title {
    font-size: 15px;
    font-weight: 700;
}

.crop-card .crop-card-subtitle {
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.6);
}

.crop-card .crop-card-rows {
    width: 100%;
}

.crop-card .crop-card-label {
    padding: 1px 16px 1px 0;
    color: rgba(255, 255, 255, 0.6);
}

.crop-card .crop-card-value {
    text-align: right;
}

.crop-card .crop-card-icon {
    margin-right: 4px;
    font-size: 16px;
    vertical-align: -3px;
}

/* The map's focus button, while the map already shows everything it would focus on
   (farmBoundaryEditor.js updateFocusState, 2026-11-13). */
.leaflet-control.focus-in-view {
    display: none !important;
}

/* SIDE PANEL (2026-10-27, Equipment and Fleet): a right-hand panel over a backdrop, drawn without JavaScript. Used by
   Assets/AssetSetup and Components/Shared/AssetCheckOutPanel / AssetCheckInPanel. */

/* Above the sticky header (1000, MainLayout.razor.css), which it must cover from inside the page's stacking context.
   That also puts it above Radzen's dialogs (1001), which is why a panel confirms a delete inline, in its own
   footer, and never opens a DialogService confirm. */
.sp-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(24, 36, 51, 0.32);
}

.sp-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1045;
    display: flex;
    flex-direction: column;
    width: min(36rem, 100%);
    background: var(--tblr-bg-surface);
    border-left: 1px solid var(--tblr-border-color);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
}

.sp-head,
.sp-foot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
}

.sp-head {
    justify-content: space-between;
    border-bottom: 1px solid var(--tblr-border-color);
}

.sp-foot {
    justify-content: flex-end;
    border-top: 1px solid var(--tblr-border-color);
}

.sp-title {
    margin: 0;
    font-size: 1.1rem;
}

.sp-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 1.25rem 1.25rem;
}

.sp-section {
    margin: 1.25rem 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tblr-secondary);
}

/* INVENTORY (2026-10-28, plan .claude/plans/inventory.md): the toolbar, segmented tabs and clickable rows the
   Equipment and Fleet pages draw in their scoped CSS, shared here by the five Inventory pages instead of five
   copies. Same look on purpose. */

.inv-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 1rem 0;
}

.inv-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.inv-select {
    width: auto;
    min-width: 9rem;
}

.inv-search {
    position: relative;
}

    .inv-search input {
        padding-left: 2rem;
        min-width: 14rem;
    }

    .inv-search i {
        position: absolute;
        left: 0.65rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--tblr-secondary);
        pointer-events: none;
    }

.inv-segment {
    display: inline-flex;
    padding: 0.2rem;
    gap: 0.2rem;
    background: var(--tblr-bg-surface-secondary);
    border: 1px solid var(--tblr-border-color);
    border-radius: 10px;
}

.inv-segment-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--tblr-secondary);
    font-weight: 500;
}

    .inv-segment-btn.active {
        background: var(--tblr-bg-surface);
        color: var(--tblr-body-color);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    }

.inv-row {
    cursor: pointer;
}

    .inv-row:focus-visible {
        outline: 2px solid var(--tblr-primary);
        outline-offset: -2px;
    }

/* The stock list's inline reorder level (phase 3): a narrow number box beside its save and cancel buttons. */
.inv-reorder-input {
    width: 6rem;
}

.inv-reorder {
    cursor: pointer;
}

/* The KPI strip above the stock list. */
.inv-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.inv-kpi {
    padding: 0.75rem 1rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: 10px;
    background: var(--tblr-bg-surface);
}

    .inv-kpi .inv-kpi-label {
        color: var(--tblr-secondary);
        font-size: 0.8rem;
    }

    .inv-kpi .inv-kpi-value {
        font-size: 1.35rem;
        font-weight: 600;
    }

    .inv-kpi.inv-kpi-danger {
        border-color: var(--tblr-danger);
    }

/* Entry lines on Stock in and Count: a table that becomes stacked cards on a phone. */
.inv-lines td {
    vertical-align: top;
}

.inv-num {
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .inv-lines thead {
        display: none;
    }

    .inv-lines tr {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--tblr-border-color);
    }

    .inv-lines td {
        display: block;
        border: 0;
        padding: 0.25rem var(--tblr-card-spacer-x, 1.25rem);
    }

        .inv-lines td[data-label]::before {
            content: attr(data-label);
            display: block;
            font-size: 0.75rem;
            color: var(--tblr-secondary);
        }

    .inv-num {
        text-align: left;
    }
}

@media (max-width: 575.98px) {
    .inv-filters,
    .inv-search,
    .inv-search input,
    .inv-select {
        width: 100%;
        min-width: 0;
    }
}

/* Platform System log (Features/Platform/SystemLog, 2026-11-11). A stack trace keeps its line breaks but wraps
   rather than widening the page at phone width, and a long one scrolls inside its box. */
.log-detail {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 24rem;
  overflow: auto;
  /* Tabler's <pre> is light text on a dark block; set both so it reads in either theme. */
  background: var(--tblr-bg-surface-secondary);
  color: var(--tblr-body-color);
}

/* Task Overview's side panel (#cal-peek, 2026-11-06). Blazor opens it by adding .show, so Bootstrap's offcanvas JS
   never runs and never locks the page behind it: the wheel scrolled the calendar instead of the panel. While it is
   open the page does not scroll; the gutter is kept so the calendar does not shift sideways when its scrollbar goes. */
html:has(#cal-peek.show) {
    overflow: hidden;
    scrollbar-gutter: stable;
}

body:has(#cal-peek.show) {
    overflow: hidden;
}
