:root {
    color-scheme: light;
    --ag-green: #109800;
    --ag-green-dark: #0c6e00;
    --ag-green-mid: #109800;
    --ag-green-soft: #e8f6e0;
    --ag-orange: #f88818;
    --ag-orange-deep: #e07510;
    --ag-gold: #f88818;
    --ag-earth: #6b4a2e;
    --ag-bg: #f6f3ea;
    --ag-card: #ffffff;
    --ag-ink: #1c1c18;
    --ag-muted: #6b6a62;
    --ag-line: rgba(16, 152, 0, 0.12);
    --ag-shadow: 0 10px 28px rgba(12, 110, 0, 0.08);
}

.agremix-body {
    background: #f3f0e8;
    color: var(--ag-ink);
    font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

.agremix-nav {
    background: #0c3d09 !important;
    box-shadow: none;
    border-bottom: 3px solid var(--ag-orange) !important;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}

.agremix-nav .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.agremix-nav .nav-link {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.brand-mark,
.pos-brand-mark {
    height: 38px;
    width: auto;
    display: block;
}

.brand-word {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-name {
    font-family: Oswald, "Segoe UI", sans-serif;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 1.12rem;
    color: #fff;
}

.brand-tag {
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ag-orange);
    font-weight: 700;
}

.letterhead {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.letterhead-logo {
    height: 86px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.letterhead-legal {
    font-family: Oswald, "Segoe UI", sans-serif;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ag-green);
    font-size: 1.05rem;
}

.letterhead-meta {
    font-size: 0.82rem;
    color: var(--ag-muted);
    line-height: 1.45;
}

.letterhead-meta a {
    color: var(--ag-green-dark);
    text-decoration: none;
    font-weight: 600;
}

.letterhead-foot {
    margin-top: 1.1rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--ag-line);
    font-size: 0.75rem;
    color: var(--ag-muted);
    letter-spacing: 0.01em;
}

.enove-credit {
    margin-top: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.enove-credit::before,
.enove-credit::after {
    content: "";
    width: 2.4rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d9d4c8 70%);
    flex: 0 0 auto;
}

.enove-credit::after {
    background: linear-gradient(90deg, #d9d4c8 30%, transparent);
}

.enove-kicker {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #9a978c;
    line-height: 1;
}

.enove-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

.enove-mark {
    display: block;
    height: 18px;
    width: auto;
}

.enove-word {
    font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: -0.045em;
    color: #161616;
    line-height: 1;
}

.agremix-footer {
    background: var(--ag-green-dark);
    color: rgba(255, 255, 255, 0.82);
    border-top: 3px solid var(--ag-orange);
}

.agremix-footer a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.agremix-footer a:hover {
    color: var(--ag-orange);
}

.footer-legal {
    font-family: Oswald, "Segoe UI", sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    font-weight: 600;
}

.footer-tag {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ag-orange);
    font-weight: 700;
}

.footer-copy,
.footer-meta {
    opacity: 0.88;
}

.page-title {
    font-family: Oswald, "Segoe UI", sans-serif;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--ag-green-dark);
    margin-bottom: 0.25rem;
}

.page-sub {
    color: var(--ag-muted);
    margin-bottom: 1.25rem;
}

.stat-card,
.menu-tile,
.panel-card {
    background: var(--ag-card);
    border: 0;
    border-radius: 18px;
    box-shadow: var(--ag-shadow);
}

.stat-card {
    padding: 1rem 1.1rem;
}

.stat-card .label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ag-muted);
}

.stat-card .value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ag-green);
}

.dash-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1.15rem;
}

.dash-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    font-size: 0.86rem;
    color: var(--ag-muted);
}

.dash-meta a {
    color: var(--ag-green);
    font-weight: 700;
    text-decoration: none;
}

.dash-meta a:hover {
    text-decoration: underline;
    color: var(--ag-green);
}

.pending-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: var(--ag-green-soft);
    color: var(--ag-green);
    font-size: 0.82rem;
    font-weight: 700;
}

.pending-invoices-pos {
    padding: 0.55rem 0.7rem;
}

.pending-invoices-pos:not(.is-collapsed) {
    padding: 0.7rem 0.85rem 0.9rem;
}

.pending-invoices .dash-week-table {
    font-size: 0.9rem;
}

.pending-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.pending-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin: 0;
    padding: 0.2rem 0.15rem;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.pending-search-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.pending-search-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.65rem;
}

.pending-search-row .table-live-search {
    width: min(100%, 280px);
}

.pending-row-actions {
    display: inline-flex;
    justify-content: flex-end;
    gap: 0.35rem;
}

.pending-toggle-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.pending-toggle-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ag-ink);
}

.pending-toggle-caret {
    font-size: 1.15rem;
    color: var(--ag-green-dark);
    line-height: 1;
    transition: transform 0.18s ease;
}

.pending-invoices.is-collapsed .pending-toggle-caret {
    transform: rotate(180deg);
}

.pending-invoices.is-collapsed .pending-invoices-body {
    display: none;
}

.pending-invoices:not(.is-collapsed) .pending-invoices-body {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--ag-line);
}

.pos-topbar-end {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.pos-pending-link {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.pos-pending-link:hover {
    color: #fff;
    text-decoration: underline;
}

.pos-pending-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #fff;
    color: var(--ag-green);
    font-size: 0.75rem;
    font-weight: 800;
}

.dash-meta-alert,
.dash-meta a.dash-meta-alert {
    color: #c62828;
    font-weight: 700;
    text-decoration: none;
}

.dash-meta-alert:hover,
.dash-meta a.dash-meta-alert:hover {
    text-decoration: underline;
    color: #c62828;
}

.dash-stat {
    position: relative;
    padding-left: 1.2rem;
}

.dash-stat::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 16px 0 0 16px;
    background: var(--ag-green-mid);
}

.dash .row > .col-6:nth-child(1) .dash-stat::before { background: var(--ag-green); }
.dash .row > .col-6:nth-child(2) .dash-stat::before { background: var(--ag-orange); }
.dash .row > .col-6:nth-child(3) .dash-stat::before { background: var(--ag-green-dark); }
.dash .row > .col-6:nth-child(4) .dash-stat::before { background: var(--ag-orange-deep); }

.dash-stat .value {
    font-size: 1.2rem;
}

.dash-week-card {
    overflow: hidden;
}

.dash-week-nav {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.dash-week-nav-mid {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.week-nav-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    border: 1.5px solid rgba(16, 152, 0, 0.22);
    background: #fff;
    color: var(--ag-green-dark);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

a.week-nav-btn:hover {
    background: var(--ag-green);
    border-color: var(--ag-green);
    color: #fff;
}

.week-nav-btn.is-faded {
    opacity: 0.32;
    pointer-events: none;
    cursor: default;
    color: var(--ag-muted);
    border-color: rgba(107, 106, 98, 0.25);
    background: #f3f1ea;
}

.dash-week-table {
    --bs-table-hover-bg: rgba(232, 245, 233, 0.55);
}

.dash-week-table thead th,
.dash-week-table tbody td,
.dash-week-table tfoot th {
    padding: 0.72rem 0.9rem;
}

.dash-week-table tbody tr:last-child td {
    border-bottom: 0;
}

.dash-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin-bottom: 0.85rem;
}

.dash-week-table thead th {
    background: #fbf6ec;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: Oswald, "Segoe UI", sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ag-green-dark);
    white-space: nowrap;
    border-bottom: 2px solid var(--ag-orange);
}

.dash-week-table tfoot th {
    background: #f7faf6;
}

.dash-today {
    background: rgba(232, 245, 233, 0.7);
}

.dash-today-tag {
    display: inline-block;
    margin-left: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ag-green);
}

.dash-chart-wrap {
    position: relative;
    height: 340px;
}

@media (max-width: 575.98px) {
    .dash-stat .value {
        font-size: 1.05rem;
    }

    .dash-chart-wrap {
        height: 280px;
    }
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

@media (min-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.1rem;
    }
}

.menu-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 132px;
    padding: 1.1rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.menu-tile:hover,
.menu-tile:focus {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(27, 94, 32, 0.16);
    color: inherit;
}

.menu-tile .icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.7rem;
    color: #fff;
}

.menu-tile h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
}

.menu-tile p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--ag-muted);
}

.tile-pos .icon { background: #ef6c00; }
.tile-stock .icon { background: #2e7d32; }
.tile-intake .icon { background: #1565c0; }
.tile-commodities .icon { background: #6a1b9a; }
.tile-reports .icon { background: #00838f; }
.tile-production .icon { background: #5d4037; }

.tile-soon {
    opacity: 0.92;
    position: relative;
}

.soon-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.68rem;
    background: var(--ag-gold);
    color: #3e2c00;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    font-weight: 700;
}

.btn-ag {
    background: var(--ag-green);
    border-color: var(--ag-green);
    color: #fff;
    font-weight: 600;
    border-radius: 12px;
}

.btn-ag:hover {
    background: var(--ag-green-dark);
    border-color: var(--ag-green-dark);
    color: #fff;
}

.btn-ag:disabled,
.btn-ag.is-blocked {
    opacity: 0.48;
    background: #b7b1a6;
    border-color: #b7b1a6;
    color: #fff;
    pointer-events: none;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-ag-outline {
    background: #fff;
    border: 1.5px solid var(--ag-orange);
    color: var(--ag-orange-deep);
    font-weight: 600;
    border-radius: 12px;
}

.btn-ag-outline:hover {
    background: var(--ag-orange);
    border-color: var(--ag-orange);
    color: #fff;
}

.table tfoot th,
.table tfoot td,
.grid-view tfoot td {
    font-weight: 700;
}

.panel-card .grid-view th,
.panel-card .grid-view th a,
.panel-card .grid-view th a:hover,
.panel-card .grid-view th a:focus,
.panel-card .grid-view th a:visited {
    color: #000;
    font-weight: 700;
    text-decoration: none;
}

.panel-card .grid-view thead th {
    background: #fbf6ec;
    font-size: 0.78rem;
    font-family: Oswald, "Segoe UI", sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 2px solid var(--ag-orange);
}

.stock-batch-search,
.table-live-search {
    max-width: 280px;
    border-radius: 12px;
}

.commodity-table .table tbody td {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    vertical-align: middle;
}

.commodity-inactive {
    opacity: 0.72;
}

.ag-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.ag-pill-raw {
    background: #e8f5e9;
    color: #1b5e20;
}

.ag-pill-feed {
    background: #fff3e0;
    color: #e65100;
}

.ag-pill-on {
    background: #e8f5e9;
    color: #1b5e20;
}

.ag-pill-off {
    background: #eceff1;
    color: #546e7a;
}

.commodity-table .btn-sm {
    padding: 0.2rem 0.45rem;
}

.commodity-form .form-label,
.commodity-form .form-check-label {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-weight: 600;
    color: var(--ag-ink);
    margin-bottom: 0.4rem;
}

.commodity-form-page {
    display: flex;
    justify-content: center;
    width: 100%;
}

.commodity-form-card {
    width: 100%;
    max-width: 760px;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
    padding: clamp(1rem, 3.2vw, 1.7rem);
    box-sizing: border-box;
}

.ag-input-group {
    width: 100%;
    flex-wrap: nowrap;
}

@media (max-width: 575.98px) {
    .commodity-form-card {
        padding: 0.95rem 0.9rem 1.1rem;
        border-radius: 14px;
    }

    .form-card-head {
        margin-bottom: 0.85rem;
        padding-bottom: 0.85rem;
    }

    .form-section {
        padding-top: 0.95rem;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .btn {
        width: 100%;
    }

    .active-card {
        min-height: 0;
    }

    .field-info-tip {
        left: auto;
        right: -0.35rem;
        transform: none;
        width: min(260px, calc(100vw - 2.25rem));
    }
}

.form-card-head {
    margin-bottom: 1.1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(26, 46, 26, 0.08);
}

.form-section {
    padding: 1.15rem 0 0.15rem;
    border-top: 1px solid rgba(26, 46, 26, 0.08);
}

.form-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.9rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ag-muted);
}

.form-section-title .bi {
    color: var(--ag-green-mid);
    font-size: 0.95rem;
}

.commodity-form .form-control,
.commodity-form .form-select {
    border-radius: 10px;
    border-color: #d5dfd3;
    background: #fbfcfb;
}

.commodity-form .form-control:focus,
.commodity-form .form-select:focus {
    border-color: var(--ag-green-mid);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.16);
}

.commodity-form textarea.form-control {
    min-height: 96px;
    resize: vertical;
}

.ag-input-group .form-control {
    min-height: 42px;
}

.ag-input-group .input-group-text {
    background: #f3f6f1;
    border-color: #d5dfd3;
    color: var(--ag-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.ag-input-group .form-control:focus + .input-group-text,
.ag-input-group:focus-within .input-group-text {
    border-color: var(--ag-green-mid);
    background: #e8f5e9;
    color: var(--ag-green);
}

.active-card {
    display: flex;
    align-items: center;
    min-height: 74px;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    background: #f3f6f1;
    border: 1px solid #dce6da;
}

.active-card .form-check {
    margin: 0;
    min-height: 0;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.15rem;
    padding-top: 1.05rem;
    border-top: 1px solid rgba(26, 46, 26, 0.08);
}

.field-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ag-muted);
    cursor: help;
    line-height: 1;
    vertical-align: middle;
}

.field-info:hover,
.field-info:focus {
    color: var(--ag-green);
    outline: none;
}

.field-info-tip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    z-index: 30;
    width: min(280px, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: #1a2e1a;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    transition: opacity 0.12s ease;
}

.field-info:hover .field-info-tip,
.field-info:focus .field-info-tip,
.field-info:focus-visible .field-info-tip {
    visibility: visible;
    opacity: 1;
}

.table-pager-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(26, 46, 26, 0.08);
}

.table-pager-summary,
.grid-view .table-pager-summary {
    color: var(--ag-muted);
    font-size: 0.82rem;
    margin: 0;
}

.table-pager-bar .pagination {
    margin: 0;
}

.table-pager-bar .page-link {
    color: var(--ag-green);
    border-radius: 8px;
    margin: 0 0.12rem;
    min-width: 2rem;
    text-align: center;
}

.table-pager-bar .page-item.active .page-link {
    background: var(--ag-green-mid);
    border-color: var(--ag-green-mid);
    color: #fff;
}

.table-pager-bar .page-item.disabled .page-link {
    color: #9aa89a;
}

.low-stock {
    color: #c62828;
    font-weight: 700;
}

.agremix-blank {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background:
        radial-gradient(circle at 18% 12%, rgba(248, 136, 24, 0.22) 0, transparent 36%),
        radial-gradient(circle at 88% 0%, rgba(16, 152, 0, 0.28) 0, transparent 42%),
        linear-gradient(165deg, #0c6e00 0%, #109800 38%, #f6f3ea 38.1%);
}

.login-card {
    width: min(440px, 100%);
    background: #fff;
    border-radius: 24px;
    padding: 1.85rem 1.55rem 1.6rem;
    box-shadow: 0 24px 60px rgba(12, 110, 0, 0.16);
    border-top: 4px solid var(--ag-orange);
}

.login-brand {
    text-align: center;
    margin-bottom: 1.25rem;
}

.login-logo {
    display: block;
    height: 118px;
    width: auto;
    margin: 0 auto 0.55rem;
}

.login-tag {
    font-family: Oswald, "Segoe UI", sans-serif;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ag-orange);
    font-size: 0.78rem;
    font-weight: 600;
}

.login-meta {
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--ag-muted);
    line-height: 1.4;
}

.login-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--ag-green);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.mfa-card {
    width: min(480px, 100%);
}

#authenticator-setup {
    z-index: 2110;
}

#authenticator-setup .modal-dialog {
    max-height: calc(100vh - 1rem);
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

#authenticator-setup .mfa-qr svg {
    width: 148px;
    height: 148px;
}

body:has(#authenticator-setup.show) .modal-backdrop {
    z-index: 2100;
}

.mfa-option {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    width: 100%;
    text-align: left;
    border: 1px solid #e4e0d4;
    border-radius: 14px;
    padding: 0.85rem 0.9rem;
    background: #fff;
    margin-bottom: 0.65rem;
    color: inherit;
}

.mfa-option i {
    font-size: 1.25rem;
    color: var(--ag-green);
    margin-top: 0.1rem;
}

.mfa-option strong,
.mfa-option small {
    display: block;
}

.mfa-option small {
    color: var(--ag-muted);
    line-height: 1.35;
    margin-top: 0.15rem;
}

.mfa-option:hover:not(:disabled) {
    border-color: var(--ag-green);
}

.mfa-option:disabled {
    opacity: 0.6;
}

.mfa-steps {
    padding-left: 1.15rem;
    margin: 0 0 1rem;
    font-size: 0.92rem;
    color: #243024;
}

.mfa-steps li + li {
    margin-top: 0.45rem;
}

.mfa-qr {
    display: flex;
    justify-content: center;
    margin: 0.4rem 0 0.8rem;
}

.mfa-qr svg {
    width: 196px;
    height: 196px;
}

.mfa-secret {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    letter-spacing: 0.08em;
    text-align: center;
    background: #f6f3ea;
    border-radius: 12px;
    padding: 0.7rem 0.5rem;
    margin-bottom: 1rem;
    word-break: break-word;
}

/* POS */
.pos-body {
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
}

.pos-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.1rem;
    background: #0c3d09;
    color: #fff;
    border-bottom: 3px solid var(--ag-orange);
}

.pos-brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.pos-brand:hover { color: #fff; }

.pos-main {
    padding: 0.75rem;
}

.pos-search {
    position: relative;
    margin-bottom: 1rem;
}

.pos-search .bi-search {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ag-muted);
    pointer-events: none;
}

.pos-search input {
    border-radius: 14px;
    min-height: 52px;
    padding-left: 2.7rem;
    font-size: 1.05rem;
    border: 1px solid #e4ddd0;
    background: #fff;
    box-shadow: 0 8px 24px rgba(28, 28, 24, 0.04);
}

.pos-search input:focus {
    border-color: #c9c0b0;
    box-shadow: 0 0 0 3px rgba(12, 61, 9, 0.08);
}

.pos-products {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    padding-bottom: 8.5rem;
}

@media (min-width: 768px) {
    .pos-layout {
        display: grid;
        grid-template-columns: 1.4fr 0.9fr;
        gap: 0.9rem;
        align-items: start;
    }
    .pos-products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding-bottom: 1rem;
    }
    .pos-cart-wrap {
        position: sticky;
        top: 64px;
    }
}

@media (min-width: 1100px) {
    .pos-products {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.product-card {
    background: #fff;
    border: 1px solid #e7e1d4;
    border-radius: 16px;
    padding: 1rem 1rem 0.9rem;
    text-align: left;
    min-height: 124px;
    box-shadow: 0 10px 28px rgba(28, 28, 24, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.product-card:disabled,
.product-card.is-out {
    opacity: 0.42;
    box-shadow: none;
    cursor: not-allowed;
}

.product-card .name {
    font-weight: 650;
    font-size: 0.98rem;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.product-card .meta {
    font-size: 0.78rem;
    color: var(--ag-muted);
    margin-top: 0.28rem;
}

.product-card .price {
    color: var(--ag-ink);
    font-weight: 650;
    margin-top: auto;
    padding-top: 0.7rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.pos-cart-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e7e1d4;
    box-shadow: 0 -12px 32px rgba(28, 28, 24, 0.06);
    padding: 0.75rem 0.9rem calc(0.75rem + env(safe-area-inset-bottom));
    z-index: 30;
}

@media (min-width: 768px) {
    .pos-cart-bar {
        display: none;
    }
}

.cart-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #efeae1;
}

.cart-line-name {
    font-weight: 650;
    letter-spacing: -0.01em;
}

.cart-line-amt {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pos-cart-wrap .panel-card,
.pos-checkout-wrap .panel-card {
    border: 1px solid #e7e1d4;
    box-shadow: 0 18px 40px rgba(28, 28, 24, 0.06);
}

.pos-cart-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ag-muted);
    margin-bottom: 0.35rem;
}

.pos-cart-title::after,
.pos-checkout-wrap .panel-card::before {
    content: "";
    display: block;
    width: 2.25rem;
    height: 3px;
    margin-top: 0.45rem;
    background: var(--ag-orange);
}

.pos-checkout-wrap .panel-card::before {
    margin-top: 0;
    margin-bottom: 0.85rem;
}

.pos-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 0.9rem;
    padding-top: 0.85rem;
    border-top: 1px solid #efeae1;
}

.pos-total span {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ag-muted);
}

.pos-total-amt {
    font-size: 1.65rem;
    font-weight: 650;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.qty-btns {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.qty-btns button,
.qty-btns input {
    height: 36px;
}

.qty-btns button {
    width: 36px;
    border-radius: 10px;
    border-color: #e4ddd0;
}

.qty-btns input {
    width: 64px;
    min-height: 36px;
    height: 36px;
    text-align: center;
    padding: 0;
    border-radius: 10px;
}

.price-cell {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.price-was {
    font-size: 0.75rem;
    color: var(--ag-muted);
    text-decoration: line-through;
}

.price-now {
    font-weight: 600;
}

.price-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ag-muted);
    line-height: 1;
}

.price-edit-btn:hover,
.price-edit-btn:focus {
    background: var(--ag-green-soft);
    color: var(--ag-green);
}

.price-input {
    width: 6.5rem;
    display: inline-block;
    text-align: right;
}

#invoice-table .has-discount th,
.proforma-doc .has-discount th {
    color: #c62828;
}

.receipt {
    max-width: 380px;
    margin: 1rem auto;
    background: #fff;
    padding: 1.25rem;
    border-radius: 12px;
}

.receipt table {
    width: 100%;
    font-size: 0.9rem;
}

.receipt-page {
    width: min(800px, 100%);
    margin: 1rem auto;
}

.panel-card {
    padding: 1.1rem;
}

.form-control, .form-select {
    min-height: 42px;
    background-color: #fff;
    color: var(--ag-ink);
    color-scheme: light;
}

.form-control:focus,
.form-select:focus {
    background-color: #fff;
    color: var(--ag-ink);
}

.table {
    --bs-table-bg: #fff;
    --bs-table-color: var(--ag-ink);
    --bs-table-border-color: #e7e1d4;
    --bs-table-striped-bg: #faf8f3;
    --bs-table-striped-color: var(--ag-ink);
    --bs-table-hover-bg: #f3f7f2;
    --bs-table-hover-color: var(--ag-ink);
    color: var(--ag-ink);
    background-color: #fff;
}

.table > :not(caption) > * > * {
    background-color: #fff;
    color: var(--ag-ink);
    color-scheme: light;
}

.table thead th,
.dash-week-table thead th,
.panel-card .grid-view thead th {
    background-color: #fbf6ec;
    color: var(--ag-green-dark);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .table,
[data-bs-theme="dark"] .table > :not(caption) > * > * {
    background-color: #fff;
    color: var(--ag-ink);
    --bs-table-bg: #fff;
    --bs-table-color: var(--ag-ink);
    color-scheme: light;
}

[data-bs-theme="dark"] .table thead th {
    background-color: #fbf6ec;
    color: var(--ag-green-dark);
}

.cust-found {
    color: #1b5e20;
    font-weight: 600;
}

.cust-new {
    color: #ef6c00;
}

.pos-invoice-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

.pos-invoice-main {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.pos-checkout-wrap {
    width: 100%;
    max-width: none;
    position: static;
}

@media (min-width: 992px) {
    .pos-invoice-layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .pos-checkout-wrap {
        flex: 0 0 340px;
        width: 340px;
        max-width: 38%;
        position: sticky;
        top: 64px;
    }
}

@media (max-width: 575.98px) {
    .pos-main {
        padding: 0.5rem;
    }

    .proforma-doc {
        padding: 0.85rem 0.7rem 1rem;
    }

    .proforma-head {
        flex-wrap: wrap;
    }

    .letterhead {
        align-items: flex-start;
        gap: 0.55rem;
    }

    .letterhead-logo {
        height: 56px;
        max-width: 72px;
    }

    .letterhead-legal {
        font-size: 0.92rem;
    }

    .enove-credit {
        gap: 0.45rem;
    }

    .enove-credit::before,
    .enove-credit::after {
        width: 1.1rem;
    }

    .enove-kicker {
        letter-spacing: 0.14em;
    }

    .qty-btns input {
        width: 42px;
    }

    .proforma-doc .table-responsive {
        overflow: hidden;
    }

    .proforma-doc .table-responsive.is-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #invoice-table {
        width: max-content;
        min-width: 100%;
        table-layout: auto;
        font-size: 0.78rem;
    }

    #invoice-table th,
    #invoice-table td {
        padding: 0.35rem 0.4rem;
        white-space: nowrap;
    }

    #invoice-table .price-cell {
        flex-wrap: nowrap;
    }

    #invoice-table {
        --line-ctrl: 18px;
    }

    #invoice-table .qty-btns {
        gap: 0.12rem;
    }

    #invoice-table .line-ctrl {
        width: var(--line-ctrl);
        height: var(--line-ctrl);
        min-width: var(--line-ctrl);
        min-height: var(--line-ctrl);
        padding: 0;
        font-size: calc(var(--line-ctrl) * 0.72);
        line-height: 1;
        border-radius: 5px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    #invoice-table .line-remove .bi {
        font-size: calc(var(--line-ctrl) * 0.62);
        line-height: 1;
    }

    #invoice-table .form-control-sm,
    #invoice-table .qty-btns input {
        min-height: var(--line-ctrl);
        height: var(--line-ctrl);
        padding: 0 0.1rem;
        font-size: calc(var(--line-ctrl) * 0.68);
    }

    #invoice-table .qty-btns input {
        width: calc(var(--line-ctrl) * 1.7);
    }
}

.proforma-doc {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem 1.2rem 1.4rem;
    box-shadow: var(--ag-shadow);
}

.proforma-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
    padding-bottom: 0.85rem;
    border-bottom: 2px solid var(--ag-orange);
}

.proforma-brand {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--ag-green);
}

.bank-pay-box {
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--ag-line);
    border-radius: 12px;
    background: #f7fbf6;
}

.bank-pay-box div + div {
    margin-top: 0.15rem;
}

.proforma-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: #fff4e8;
    color: var(--ag-orange-deep);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
}

.pos-checkout-wrap .nav-tabs {
    border-bottom: 1px solid #edf2ea;
}

.pos-checkout-wrap .nav-link {
    color: var(--ag-muted);
    font-weight: 600;
}

.pos-checkout-wrap .nav-link.active {
    color: var(--ag-green);
}

@media print {
    .no-print,
    .d-print-none,
    .pos-topbar,
    .pos-checkout-wrap,
    .proforma-actions,
    .qty-btns,
    .alert {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    .pos-checkout-wrap {
        position: static !important;
    }
    .pos-main {
        padding: 0;
    }
    .pos-invoice-layout {
        display: block !important;
        flex-direction: column !important;
    }
    .receipt-page {
        width: 100%;
        margin: 0;
    }
    .proforma-doc {
        box-shadow: none;
        border-radius: 0;
        padding: 10mm;
        width: 100%;
        zoom: 1;
    }
    .print-qty,
    .print-price {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
        overflow: visible !important;
    }
    .proforma-doc .table-responsive {
        overflow: visible !important;
    }
    #invoice-table {
        width: 100% !important;
        min-width: 0 !important;
    }
    #invoice-table th,
    #invoice-table td {
        white-space: normal;
    }
    #invoice-table th:last-child,
    #invoice-table td:last-child {
        display: none !important;
    }
    #invoice-table input,
    #invoice-table button {
        display: none !important;
    }
    .table-danger {
        --bs-table-bg: transparent;
        --bs-table-accent-bg: transparent;
        background: transparent !important;
        color: inherit !important;
    }
    @page {
        size: A4;
        margin: 0;
    }
    html, body, .pos-body, .pos-main {
        margin: 0 !important;
        padding: 0 !important;
    }
    .letterhead-logo {
        height: 72px;
        max-width: 96px;
    }
    .letterhead-foot {
        color: #555;
    }
    .enove-credit {
        margin-top: 8mm;
        break-inside: avoid;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    .enove-kicker {
        color: #777;
    }
    .enove-word {
        color: #111;
    }
}

.panel-card > .table thead th,
.panel-card .table-responsive > .table thead th {
    background: #fbf6ec;
    font-size: 0.78rem;
    font-family: Oswald, "Segoe UI", sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ag-green-dark);
    border-bottom: 2px solid var(--ag-orange);
    white-space: nowrap;
}

.low-affected-card {
    background:
        linear-gradient(180deg, #fff8f0 0%, #fff 42%);
}

.low-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.7rem;
    height: 1.7rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: #fff4e8;
    color: var(--ag-orange-deep);
    font-weight: 800;
    font-size: 0.82rem;
}

.low-empty {
    text-align: center;
    padding: 1.75rem 1rem;
    color: var(--ag-muted);
}

.low-empty .bi {
    display: block;
    font-size: 1.8rem;
    color: var(--ag-green);
    margin-bottom: 0.45rem;
}

.low-row {
    background: rgba(248, 136, 24, 0.08);
}

.notify-input .form-control {
    border-color: #eadfcb;
}

.notify-input .input-group-text {
    background: #fbf6ec;
    border-color: #eadfcb;
    color: var(--ag-muted);
    font-size: 0.75rem;
}

.product-card:not(:disabled):not(.is-out):hover {
    transform: translateY(-2px);
    border-color: #d9d0c2;
    box-shadow: 0 16px 32px rgba(28, 28, 24, 0.08);
}

.product-card.is-added {
    animation: ag-added 0.48s ease;
}

@keyframes ag-added {
    0% { border-color: var(--ag-green); box-shadow: 0 0 0 0 rgba(16, 152, 0, 0.28); }
    100% { border-color: #e7e1d4; box-shadow: 0 10px 28px rgba(28, 28, 24, 0.05); }
}

.pos-total.is-tick .pos-total-amt {
    animation: ag-tick 0.28s ease;
}

@keyframes ag-tick {
    0% { transform: translateY(3px); opacity: 0.45; }
    100% { transform: none; opacity: 1; }
}

#invoice-table tfoot tr:last-child th {
    font-size: 1.15rem;
    padding-top: 0.85rem;
    letter-spacing: -0.02em;
}

@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-card.is-added,
    .pos-total.is-tick .pos-total-amt {
        animation: none;
        transition: none;
    }
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0.85rem;
    font-size: 0.86rem;
}

.breadcrumb-item a {
    color: var(--ag-green-dark);
    text-decoration: none;
    font-weight: 600;
}

.pos-pending-count {
    background: var(--ag-orange);
    color: #fff;
}

.ag-tour-launch {
    position: fixed;
    inset: auto 0.55rem 0.55rem auto;
    margin: 0;
    z-index: 1040;
    width: 1.15rem;
    height: 1.15rem;
    border: 0;
    border-radius: 999px;
    background: var(--ag-green);
    color: #fff;
    box-shadow: none;
    display: grid;
    place-items: center;
    font-size: 0.62rem;
    line-height: 1;
    padding: 0;
    opacity: 0.22;
}

.ag-tour-launch:hover,
.ag-tour-launch:focus-visible {
    opacity: 0.85;
    background: var(--ag-green-dark);
    color: #fff;
}

.ag-tour-launch:focus-visible {
    outline: 2px solid var(--ag-orange);
    outline-offset: 2px;
}

body.ag-tour-open .ag-tour-launch {
    display: none;
}

body.pos-body .ag-tour-launch {
    bottom: calc(6.25rem + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
    body.pos-body .ag-tour-launch {
        bottom: 0.55rem;
    }
}

@media print {
    .ag-tour-launch {
        display: none !important;
    }
}

.ag-tour[hidden] {
    display: none !important;
}

.ag-tour-blocker {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.ag-tour.is-dim .ag-tour-blocker {
    background: rgba(12, 30, 8, 0.72);
}

.ag-tour-ring {
    position: fixed;
    z-index: 2001;
    border: 2px solid var(--ag-orange);
    border-radius: 14px;
    box-shadow: 0 0 0 9999px rgba(12, 30, 8, 0.72);
    pointer-events: none;
}

.ag-tour-card {
    position: fixed;
    z-index: 2002;
    width: min(380px, calc(100vw - 32px));
    background: #fff;
    color: var(--ag-ink);
    border-radius: 18px;
    border-top: 4px solid var(--ag-orange);
    box-shadow: 0 18px 50px rgba(12, 40, 8, 0.28);
    padding: 1.15rem 1.2rem 1rem;
}

.ag-tour-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ag-orange-deep);
}

.ag-tour-card h2 {
    margin: 0 0 0.45rem;
    font-family: Oswald, "Segoe UI", sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--ag-green-dark);
}

.ag-tour-body {
    margin: 0 0 1rem;
    line-height: 1.45;
}

.ag-tour-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.ag-tour-nav {
    display: flex;
    gap: 0.5rem;
}

.ag-tour-skip {
    background: none;
    border: 0;
    padding: 0.45rem 0.15rem;
    color: var(--ag-muted);
    font-weight: 700;
}

.ag-tour-skip:hover {
    color: var(--ag-ink);
}

@media (prefers-reduced-motion: reduce) {
    .ag-tour-ring {
        transition: none;
    }
}
