/* agroNET Poultry base styles and the app frame (research R17 layer 1b, R19; spec FR-SH-12).
   Tokens (colours, sizes) are in theme.css, loaded before this file: no colour values here. */

body.app {
    background: var(--agronet-bg);
    color: var(--agronet-text);
    min-height: 100vh;
}

/* ---- Type and Bootstrap components on the mockup's values (spec FR-UI-2, FR-UI-3) ---- */
/* Headings: Bootstrap has no heading-font variable, and theme.css has no element selectors. */
h1, h2, h3, .h1, .h2, .h3 { font-family: var(--agronet-font-display); font-weight: 700; text-wrap: balance; }
h1, .h1 { font-size: 22px; }
h2, .h2 { font-size: 16px; }
h3, .h3 { font-size: 14px; }

.btn {
    --bs-btn-border-radius: var(--agronet-radius-btn);
    --bs-btn-font-weight: 600;
    --bs-btn-font-size: 13px;
    --bs-btn-padding-y: 7px;
    --bs-btn-padding-x: 13px;
}

/* The mockup's buttons (.btn, .btn.sec, .btn.sm), on Bootstrap's own classes so every page gets them:
   btn-primary and btn-dark = the main button, the app's dark navy; btn-outline-secondary = the secondary one
   (white, grey border, normal weight); btn-sm = the small size. */
.btn-primary,
.btn-dark {
    --bs-btn-color: var(--agronet-on-dark);
    --bs-btn-bg: var(--agronet-navy);
    --bs-btn-border-color: var(--agronet-navy);
    --bs-btn-hover-color: var(--agronet-on-dark);
    --bs-btn-hover-bg: var(--agronet-navy-dark);
    --bs-btn-hover-border-color: var(--agronet-navy-dark);
    --bs-btn-active-color: var(--agronet-on-dark);
    --bs-btn-active-bg: var(--agronet-navy-dark);
    --bs-btn-active-border-color: var(--agronet-navy-dark);
    --bs-btn-disabled-color: var(--agronet-on-dark);
    --bs-btn-disabled-bg: var(--agronet-navy);
    --bs-btn-disabled-border-color: var(--agronet-navy);
    --bs-btn-disabled-opacity: 0.45;
}

.btn-outline-secondary {
    --bs-btn-color: var(--agronet-text);
    --bs-btn-bg: var(--agronet-surface);
    --bs-btn-border-color: var(--agronet-border-strong);
    --bs-btn-font-weight: 500;
    --bs-btn-hover-color: var(--agronet-text);
    --bs-btn-hover-bg: var(--agronet-surface-soft);
    --bs-btn-hover-border-color: var(--agronet-border-strong);
    --bs-btn-active-color: var(--agronet-text);
    --bs-btn-active-bg: var(--agronet-surface-soft);
    --bs-btn-active-border-color: var(--agronet-border-strong);
    --bs-btn-disabled-color: var(--agronet-text);
    --bs-btn-disabled-bg: var(--agronet-surface);
    --bs-btn-disabled-border-color: var(--agronet-border-strong);
    --bs-btn-disabled-opacity: 0.45;
}

.btn-sm {
    --bs-btn-padding-y: 3px;
    --bs-btn-padding-x: 9px;
    --bs-btn-font-size: 12px;
    --bs-btn-border-radius: var(--agronet-radius-input);
}

.card {
    --bs-card-border-radius: var(--agronet-radius-lg);
    --bs-card-inner-border-radius: calc(var(--agronet-radius-lg) - 1px);
    --bs-card-border-color: var(--agronet-border);
    --bs-card-spacer-y: 14px;
    --bs-card-spacer-x: 16px;
}

.form-control, .form-select { --bs-border-color: var(--agronet-border-strong); }

/* The mockup's 12 px gap (Bootstrap's gap-* gives 8 or 16). */
.ag-gap { gap: var(--agronet-gap); }

/* Figures line up in columns: KPIs, tables, sheets. */
.ag-num, table td { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--agronet-status-planned); outline-offset: 2px; }

.ag-skip { position: absolute; left: 8px; top: 8px; z-index: 2100; background: var(--agronet-surface); padding: 6px 10px; border-radius: var(--agronet-radius-sm); }

/* ======================= App frame: sidebar | (top bar, sub-bar, page) ======================= */
.ag-app {
    display: grid;
    grid-template-columns: var(--agronet-side-width) minmax(0, 1fr);
    min-height: 100vh;
}

.ag-main { min-width: 0; display: flex; flex-direction: column; }
.ag-view { padding: 16px 24px 60px; min-width: 0; width: 100%; flex: 1 1 auto; }
.ag-view:focus { outline: none; }

/* ---------- Sidebar ---------- */
.ag-side {
    background: var(--agronet-side);
    color: var(--agronet-side-ink);
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 45;
}

.ag-side__brand { margin-bottom: 14px; }
.ag-side__spacer { flex: 1; }
.ag-side__divider { border: 0; border-top: 1px solid var(--agronet-side-line); margin: 6px 4px; width: calc(100% - 8px); opacity: 1; }

.ag-side__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: inherit;
    font-size: 14px;
    white-space: nowrap;
    text-align: left;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.ag-side__link .ag-icon { flex-shrink: 0; opacity: 0.8; }
.ag-side__link:hover { background: var(--agronet-side-hover); color: inherit; }
.ag-side__link.is-active { background: var(--agronet-green); color: var(--agronet-on-dark); font-weight: 600; }
.ag-side__link.is-active .ag-icon { opacity: 1; }
.ag-side__link.is-disabled { color: var(--agronet-side-sub); cursor: not-allowed; }
.ag-side__link.is-disabled:hover { background: none; }
.ag-side__short { display: none; }

.ag-side__badge {
    margin-left: auto;
    background: var(--agronet-status-today);
    color: var(--agronet-on-dark);
    border-radius: var(--agronet-radius-pill);
    font-size: 11px;
    font-weight: 600;
    padding: 0 7px;
}

/* Farms under Dashboard (FR-SH-13): open the dashboard for one farm */
.ag-side__farm {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 42px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--agronet-side-sub);
    text-decoration: none;
    white-space: nowrap;
}

.ag-side__farm:hover { color: var(--agronet-side-ink); background: var(--agronet-side-hover); }
.ag-side__farm.is-active { background: var(--agronet-side-hover); color: var(--agronet-on-dark); font-weight: 600; }
.ag-side__farm.is-active::before { content: ""; position: absolute; left: 28px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--agronet-green); }
.ag-side__farm .ag-side__label { overflow: hidden; text-overflow: ellipsis; }

.ag-side__farm-badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--agronet-radius-pill);
    display: grid;
    place-items: center;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
    color: var(--agronet-on-dark);
}

.ag-side__farm-badge--urgent { background: var(--agronet-status-urgent); }
.ag-side__farm-badge--today { background: var(--agronet-status-today); }
.ag-side__farm-badge--planned { background: var(--agronet-status-planned); }

.ag-side__collapse { color: var(--agronet-side-sub); font-size: 13px; }
.ag-side__expand-icon { display: none; }

/* ---------- Brand: white-label logos, or the "a" mark with agroNET / Poultry ---------- */
.ag-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: 9px;
    color: var(--agronet-on-dark);
    text-decoration: none;
}

.ag-brand:hover { color: var(--agronet-on-dark); background: var(--agronet-side-hover); }

.ag-brand__mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--agronet-green);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-family: var(--agronet-font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--agronet-on-dark);
}

.ag-brand__text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.ag-brand__text b { font-family: var(--agronet-font-display); font-size: 15px; }
.ag-brand__text small { font-size: 12px; color: var(--agronet-side-sub); }
.ag-brand__logos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ag-brand__logo { max-height: 36px; max-width: 170px; }
.ag-brand__logo.brand-lunagroup { background: var(--agronet-surface); padding: 4px; border-radius: 4px; }

/* ---------- Rail: the sidebar collapsed to icons (above 860 px; layout.js) ---------- */
@media (min-width: 861px) {
    /* MT-G4: the width slides; labels fade out before collapsing and in after expanding (layout.js sets the classes). */
    .ag-app { transition: grid-template-columns var(--ag-motion) var(--ag-ease-in-out); }
    .ag-app--animating .ag-side__label,
    .ag-app--animating .ag-brand__text { white-space: nowrap; }
    .ag-app--animating .ag-side { overflow: hidden; }
    .ag-app--collapsing .ag-side__label,
    .ag-app--collapsing .ag-brand__text,
    .ag-app--collapsing .ag-side__farm { opacity: 0; transition: opacity var(--ag-motion-fast) var(--ag-ease-out); }
    .ag-app--expanding .ag-side__label,
    .ag-app--expanding .ag-brand__text,
    .ag-app--expanding .ag-side__farm { animation: ag-fade var(--ag-motion) var(--ag-ease-out) 120ms backwards; }
    .ag-app--rail { grid-template-columns: var(--agronet-rail-width) minmax(0, 1fr); }
    .ag-app--rail .ag-side__label,
    .ag-app--rail .ag-brand__text,
    .ag-app--rail .ag-side__farm { display: none; }
    .ag-app--rail .ag-side__link { justify-content: center; padding: 10px 0; }
    .ag-app--rail .ag-side__badge { position: absolute; top: 1px; right: 5px; padding: 0 5px; font-size: 10px; line-height: 15px; }
    .ag-app--rail .ag-brand { justify-content: center; padding: 6px 0; }
    .ag-app--rail .ag-brand__logo { max-width: 44px; }
    .ag-app--rail .ag-side__collapse-icon { display: none; }
    .ag-app--rail .ag-side__expand-icon { display: inline; }
}

/* ---------- Top bar ---------- */
.ag-top {
    background: var(--agronet-top);
    color: var(--agronet-on-dark);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    height: var(--agronet-top-height);
    position: sticky;
    top: 0;
    z-index: 40;
}

.ag-top__brand { display: none; }
.ag-top__spacer { flex: 1; }

.ag-path { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; }
.ag-path__part { color: var(--agronet-on-dark-muted); text-decoration: none; }
a.ag-path__part:hover { color: var(--agronet-on-dark); text-decoration: underline; }
.ag-path__sep { opacity: 0.5; }
.ag-path__current { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

.ag-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--agronet-on-dark);
    font-size: 12.5px;
    white-space: nowrap;
}

.ag-user:hover, .ag-user[aria-expanded="true"] { background: var(--agronet-on-dark-hover); }

.ag-user__avatar {
    font-style: normal;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--agronet-on-dark-soft);
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 12px;
}

.ag-user__name { font-weight: 500; }
.ag-user__menu { min-width: 200px; }

.ag-lang { display: flex; align-items: center; margin: 0; }

.ag-lang select {
    appearance: none;
    max-width: 10rem;
    height: 32px;
    padding: 0 26px 0 8px;
    border: 0;
    border-radius: 8px;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M2 4.5 6 8.5 10 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    color: var(--agronet-on-dark);
    font-size: 12.5px;
    cursor: pointer;
}

.ag-lang select:hover,
.ag-lang select:focus-visible { background-color: var(--agronet-on-dark-hover); outline: none; }
.ag-lang select:focus-visible { outline: 2px solid var(--agronet-surface); outline-offset: 1px; } /* hover alone is no focus sign (SC-6) */

.ag-lang select option { background: var(--agronet-surface); color: var(--agronet-text); }

.ag-bell {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--agronet-on-dark);
}

.ag-bell:hover, .ag-bell[aria-expanded="true"] { background: var(--agronet-on-dark-hover); }
.ag-bell { position: relative; }
.ag-bell-wrap { position: relative; }

/* the mockup's count badge (.bc) and popover (.pop) */
.ag-bell__count {
    position: absolute;
    top: 1px;
    right: 0;
    min-width: 16px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--agronet-status-urgent);
    color: var(--agronet-on-dark);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 16px;
}

.ag-bell__pop {
    position: absolute;
    right: -60px;
    top: 44px;
    width: min(380px, calc(100vw - 32px));
    max-height: min(480px, 70vh);
    overflow: auto;
    padding: 12px;
    background: var(--agronet-surface);
    color: var(--agronet-text);
    border: 1px solid var(--agronet-border-strong);
    border-radius: var(--agronet-radius-lg);
    box-shadow: var(--agronet-shadow-pop);
    z-index: 60;
}

.ag-bell__pop h3 { margin-bottom: 6px; }
.ag-bell__item { padding: 8px 0; border-top: 1px solid var(--agronet-border); font-size: 13px; }
.ag-bell__item b { font-weight: 600; }
.ag-bell__item a { color: var(--agronet-status-planned); }

@media (max-width: 860px) {
    .ag-bell__pop { position: fixed; left: 16px; right: 16px; top: calc(var(--agronet-top-height) + 4px); width: auto; }
}

@media (max-width: 1180px) {
    .ag-user__name { display: none; }
}

/* ---------- Sub-bar: the house scope (picker, daily entry) and the tabs of the section or house ---------- */
.ag-subbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 16px;
    background: var(--agronet-surface);
    border-bottom: 1px solid var(--agronet-border);
    padding: 0 24px 0 14px;
    position: sticky;
    top: var(--agronet-top-height);
    z-index: 30;
}

.ag-subbar > .ag-subbar { display: contents; }

.ag-scope {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 8px 0;
    border-right: 1px solid var(--agronet-border);
    min-width: 0;
}

.ag-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 0 1 auto; }

.ag-tabs__tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 10px 10px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    color: var(--agronet-text-muted);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
}

.ag-tabs__tab:hover { color: var(--agronet-text); }
.ag-tabs__tab.is-active { color: var(--agronet-text); border-bottom-color: var(--agronet-green); font-weight: 600; }
.ag-tabs__tab.is-disabled { color: var(--agronet-status-neutral); cursor: not-allowed; }

.ag-tabs__badge {
    background: var(--agronet-status-today);
    color: var(--agronet-on-dark);
    border-radius: var(--agronet-radius-pill);
    font-size: 11px;
    padding: 0 6px;
    line-height: 17px;
    font-weight: 600;
}

.ag-subbar + .ag-view { padding-top: 18px; }

/* ---------- House picker in the sub-bar: a searchable list grouped by farm (houseHeader.js) ---------- */
.house-picker { position: relative; flex: 0 1 auto; min-width: 0; }

.house-picker__button {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    min-width: 220px;
    max-width: 340px;
    padding: 0 12px 0 6px;
    font-size: 13px;
    text-align: left;
    background: var(--agronet-green-bg);
    color: var(--agronet-green-ink);
    border: 1.5px solid color-mix(in srgb, var(--agronet-green) 45%, transparent);
    border-radius: 11px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.house-picker__button:hover,
.house-picker__button[aria-expanded="true"] {
    border-color: var(--agronet-green);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--agronet-green) 18%, transparent);
}

.house-picker__icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--agronet-green);
    color: var(--agronet-on-dark);
}

.house-picker__text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.2; }

.house-picker__text small {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.house-picker__text b {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.house-picker__caret { margin-left: 4px; font-size: 12px; opacity: 0.8; }
.house-picker__sub { margin-left: auto; font-size: 12px; color: var(--agronet-text-muted); white-space: nowrap; }

/* The daily-entry button next to the picker: a pencil, with a dot (amber: not entered today, green: entered). */
.house-debtn {
    position: relative;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border: 1.5px solid var(--agronet-border-strong);
    border-radius: 11px;
    background: var(--agronet-surface);
    color: var(--agronet-text);
}

.house-debtn:hover { border-color: var(--agronet-green); color: var(--agronet-green-ink); }

.house-debtn i {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid var(--agronet-surface);
    background: var(--agronet-status-today);
}

.house-debtn i.is-ok { background: var(--agronet-status-ok); }

.house-picker__menu {
    position: absolute;
    z-index: 1050;
    left: 0;
    top: 52px;
    width: min(360px, calc(100vw - 24px));
    max-height: min(460px, 70vh);
    overflow: auto;
    background: var(--agronet-surface);
    border: 1px solid var(--agronet-border-strong);
    border-radius: var(--agronet-radius-lg);
    box-shadow: var(--agronet-shadow-pop);
    padding: 8px;
}

.house-picker__farm {
    margin: 8px 0 2px;
    padding: 0 8px;
    font-family: var(--agronet-font-mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--agronet-text-muted);
}

.house-picker__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 8px;
    border-radius: 7px;
    font-size: 13.5px;
    color: var(--agronet-text);
    text-decoration: none;
}

.house-picker__item:hover,
.house-picker__item:focus-visible,
.house-picker__item[aria-selected="true"] { background: var(--agronet-surface-soft); color: var(--agronet-text); }

/* ---------- Phones and small tablets (≤ 860 px): the sidebar becomes a bottom bar with short labels ---------- */
@media (max-width: 860px) {
    .ag-app { grid-template-columns: minmax(0, 1fr); }

    .ag-side {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        height: auto;
        flex-direction: row;
        gap: 2px;
        padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
        overflow: visible;
        max-width: 100vw;
        border-top: 1px solid var(--agronet-side-line);
    }

    .ag-side__brand, .ag-side__divider, .ag-side__spacer, .ag-side__collapse, .ag-side__farm { display: none; }
    /* flex-basis 0 and min-width 0: six items share the width and shrink (labels ellipsize), so the fixed bar never
       makes the page wider than the screen. */
    .ag-side__link { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 2px; font-size: 11px; min-width: 0; overflow: hidden; }
    .ag-side__link.is-active { background: var(--agronet-side-hover); }
    .ag-side__label { display: none; }
    .ag-side__short { display: block; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .ag-side__badge { position: absolute; top: 1px; left: calc(50% + 6px); margin: 0; padding: 0 5px; font-size: 10px; line-height: 15px; }

    .ag-main { padding-bottom: 64px; }
    .ag-top { padding: 0 8px 0 10px; }
    .ag-top__brand { display: block; }
    .ag-top__brand .ag-brand { padding: 4px; }
    .ag-top__brand .ag-brand__text { display: none; }
    .ag-path .is-mid, .ag-path .is-mid-sep, .ag-path .is-mid + .ag-path__sep { display: none; }
    .ag-view { padding: 12px 16px 50px; }
    .ag-subbar { padding: 0 6px; }
    .ag-subbar + .ag-view { padding-top: 14px; }
    .ag-scope { width: 100%; padding: 8px 4px; border-right: 0; border-bottom: 1px solid var(--agronet-border); }
    .house-picker { flex: 1; }
    .house-picker__button { max-width: none; width: 100%; }
}

/* ======================= Loader (agronet.loader / Module.loader) ======================= */
/* MT-G2: over the content area only (site.js sets top/left/size from <main>; without the frame, the window). Shown
   after a short delay, faded; the old app's #loaderContainer look: the logo and "Loading…" pulsing (2.5 s). */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 1030; /* frameless pages; in the frame it sits under the sidebar and the top bar (below) */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 8vh;
    background: var(--agronet-loader-veil);
    color: var(--agronet-text);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--ag-motion) var(--ag-ease-out), visibility 0s linear var(--ag-motion);
}

/* In the frame: under the sidebar (45) and the top bar (40), so they stay usable (the phones' bottom bar too). */
.ag-app ~ .page-loader { z-index: 39; }

.page-loader.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity var(--ag-motion) var(--ag-ease-out), visibility 0s;
}
.page-loader-logo,
.page-loader p { animation: agronet-pulse 2.5s ease-out infinite alternate; }
.page-loader-logo { width: 90px; }
.page-loader p { font-size: 18px; font-weight: 500; color: var(--agronet-text); }

@keyframes agronet-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .page-loader-logo, .page-loader p { animation: none; }
    .ag-side__link { transition: none; }
}

/* ======================= Pages without frame (LayoutFrame.None): login, password reset, errors ======================= */
/* The mockup has no login screen: built from its brand mark, card and form styles (spec FR-UI-6, closing note). */
.ag-auth {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 32px 16px;
}

.ag-auth__brand { display: flex; align-items: center; gap: 10px; color: var(--agronet-text); }
.ag-auth__brand .ag-brand__mark { width: 40px; height: 40px; border-radius: 10px; font-size: 20px; }
.ag-auth__brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.ag-auth__brand-text b { font-family: var(--agronet-font-display); font-size: 20px; }
.ag-auth__brand-text small { font-size: 13px; color: var(--agronet-text-muted); }
.ag-auth__body { width: min(400px, 100%); }

/* Terms of use and Privacy policy (FR-SH-15): a readable column, in the frame or frameless like the login page. */
.ag-legal { width: min(860px, 100%); }
.ag-legal-page { justify-content: flex-start; padding: 32px 16px; }
.ag-legal__note { margin-bottom: 12px; }
.ag-legal__text {
    background: var(--agronet-surface);
    border: 1px solid var(--agronet-border);
    border-radius: 12px;
    padding: 24px 28px;
    line-height: 1.6;
}
.ag-legal__text .ag-legal__title { font-size: 24px; margin: 0 0 8px; }
.ag-legal__text h2 { font-size: 18px; margin: 16px 0 8px; }
.ag-legal__text a { color: var(--agronet-green); overflow-wrap: anywhere; }
.ag-legal__back { margin: 16px 0 0; }
@media (max-width: 600px) { .ag-legal__text { padding: 16px; } }

.ag-auth__card {
    background: var(--agronet-surface);
    border: 1px solid var(--agronet-border);
    border-radius: var(--agronet-radius-lg);
}

.ag-auth__card .card-body { padding: 24px; }
.ag-auth__card h1 { font-size: 22px; font-weight: 700; }
/* The validation summary is a <ul> in the red box: no list margins or bullets, so the text sits evenly in it. */
.ag-auth .validation-summary-errors ul, .ag-login .validation-summary-errors ul { margin: 0; padding: 0; list-style: none; }
.ag-login .validation-summary-errors { padding: 10px 14px; line-height: 1.4; }

/* ======================= Sign-in page (LG-1–LG-4): full screen as the old app ======================= */
/* A slim green bar with the white wordmark; below it the form on the left half and the poultryNET scene on the right
   half (LG-5: the mobile app's dark poultry house, its amber wordmark, the birds along the bottom); phones: a band with
   the wordmark above the form. No card. The panels slide; Contact us is a dialog. */
.ag-login {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--agronet-surface);
}

.ag-login__bar {
    flex: none;
    display: flex;
    align-items: center;
    height: 58px;
    padding: 0 24px;
    background: var(--agronet-top);
}
.ag-login__logo { height: 40px; width: auto; }

.ag-login__split { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; }

.ag-login__panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--agronet-surface);
}
.ag-login__views { width: min(420px, 100%); }

/* The old app's sign-in photo (Content/img/loginBackground.png), as webp with a jpg fallback. */
.ag-login__photo {
    background-color: #c9c23a;
    background-image: url("../img/login-photo.jpg");
    background-image: image-set(url("../img/login-photo.webp") type("image/webp"), url("../img/login-photo.jpg") type("image/jpeg"));
    background-size: cover;
    background-position: center;
}

.ag-login__view { opacity: 0; translate: 16px 0; transition: opacity var(--ag-motion) var(--ag-ease-out), translate var(--ag-motion) var(--ag-ease-out); }
.ag-login__view.is-active { opacity: 1; translate: none; }
.ag-login__title { font-size: 26px; font-weight: 700; margin: 0 0 22px; }
.ag-login__sub { color: var(--agronet-text-muted); font-size: 14px; margin: -14px 0 20px; }
.ag-login .form-label { font-weight: 600; font-size: 13px; }
.ag-login .form-control-lg { font-size: 15px; border-radius: 8px; }
.ag-login__submit { background: var(--agronet-green); border-color: var(--agronet-green); color: #fff; font-size: 16px; border-radius: 8px; padding: 10px 16px; }
.ag-login__submit:hover, .ag-login__submit:focus-visible { background: var(--agronet-green-ink); border-color: var(--agronet-green-ink); color: #fff; }
/* Signing in (login.js): the pressed button keeps its look, with a spinner before the label. */
.ag-login__submit.is-busy:disabled, .ag-login__external.is-busy:disabled { opacity: 1; cursor: progress; }
.ag-login__submit.is-busy:disabled { background: var(--agronet-green-ink); border-color: var(--agronet-green-ink); color: #fff; }
.ag-login__spin { margin-inline-end: 8px; vertical-align: -2px; }
.ag-login__row { display: flex; justify-content: flex-end; margin: 0 0 18px; }
.ag-login__link { background: none; border: 0; padding: 0; color: var(--agronet-green); font-size: 13.5px; font-weight: 500; text-decoration: none; cursor: pointer; }
.ag-login__link:hover, .ag-login__link:focus-visible { text-decoration: underline; color: var(--agronet-green-ink); }
.ag-login__or { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--agronet-text-muted); font-size: 12.5px; }
.ag-login__or::before, .ag-login__or::after { content: ""; flex: 1; height: 1px; background: var(--agronet-border); }
/* The lockout page (Account/Lockout), as the old app's lockoutPanel. */
.ag-lockout { width: 100%; max-width: 520px; }
.ag-lockout__icon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 25px; border-radius: 50%;
    background: var(--agronet-green-bg); color: var(--agronet-green); }
.ag-lockout__message h1, .ag-lockout__message h2 { margin: 0 0 10px; font-size: 22px; font-weight: 700; color: var(--agronet-text); }
.ag-lockout__message p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--agronet-text-muted); }
.ag-lockout__divider { margin: 22px 0; border-top: 1px solid var(--agronet-border); }
.ag-lockout__contact { display: inline-flex; align-items: center; gap: 8px; margin: 28px 0 25px; font-size: 17px; color: var(--agronet-green); text-decoration: none; }
.ag-lockout__contact:hover, .ag-lockout__contact:focus-visible { color: var(--agronet-green-ink); text-decoration: underline; }
.ag-login__externals { display: grid; gap: 8px; }
.ag-login__external { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; padding: 10px 12px;
    border: 1px solid var(--agronet-border); border-radius: 8px; background: #fff; color: var(--agronet-text); font-size: 13px; font-weight: 600; }
.ag-login__external:hover, .ag-login__external:focus-visible { border-color: var(--agronet-text-muted); background: #f7f7f7; color: var(--agronet-text); }
.ag-login__external svg { flex: none; }
.ag-login__external span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-login__foot { margin: 22px 0 0; text-align: center; }
.ag-login__status { border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 12px; }
.ag-login__status.is-ok { background: var(--agronet-status-ok-bg); color: var(--agronet-green-ink); }
.ag-login__status.is-error { background: var(--agronet-status-urgent-bg); color: var(--agronet-status-urgent); }

.ag-login__contact {
    width: min(460px, calc(100% - 32px));
    border: 1px solid var(--agronet-border);
    border-radius: 12px;
    padding: 0;
    background: var(--agronet-surface);
    color: var(--agronet-text);
    box-shadow: var(--agronet-shadow-pop);
}
.ag-login__contact[open] { animation: ag-pop var(--ag-motion) var(--ag-ease-out) both; }
.ag-login__contact::backdrop { background: rgba(15, 25, 20, 0.45); }
.ag-login__contact-form { padding: 20px 22px; }
.ag-login__contact-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ag-login__contact-head h2 { font-size: 18px; margin: 0; }
.ag-login__contact-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 860px) {
    .ag-login__split { grid-template-columns: minmax(0, 1fr); }
    .ag-login__photo { display: none; }
    .ag-login__panel { align-items: flex-start; padding: 32px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .ag-login__contact[open] { animation: none; }
    .ag-login__view { transition: none; translate: none; }
}
