.dashboard-page { display: flex; flex-direction: column; gap: 14px; }

.dashboard-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 2px 0 2px;
}

.dashboard-heading h1 {
    margin: 0;
    color: #0c3046;
    font-size: 1.35rem;
    font-weight: 800;
}

.dashboard-heading p {
    margin: 4px 0 0;
    color: #77858e;
    font-size: .75rem;
}

.dashboard-heading-actions { display: flex; align-items: center; gap: 10px; }

.view-toggle {
    display: inline-flex;
    padding: 3px;
    border: 1px solid #ded5c8;
    background: #eee9e1;
    border-radius: 9px;
}

.view-toggle button {
    padding: 5px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #65737b;
    font-size: .72rem;
    font-weight: 700;
}

.view-toggle button.active {
    background: #fff;
    color: #0e3147;
    box-shadow: 0 1px 2px rgba(0,0,0,.07);
}

.request-testing-button {
    background: #ef8b00;
    color: #102f41;
    font-size: .73rem;
    font-weight: 800;
    border: 0;
}

.request-testing-button:disabled {
    opacity: 1;
    background: #ef8b00;
    color: #17384a;
    cursor: not-allowed;
}

.dashboard-heading-rule {
    height: 1px;
    background: #dfd7cb;
}

.family-tabs {
    display: flex;
    align-items: center;
    gap: 7px;
}

.family-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 5px 11px;
    border: 1px solid #e0d8cd;
    border-radius: 999px;
    color: #829098;
    background: transparent;
    text-decoration: none;
    font-size: .72rem;
    font-weight: 800;
}

.family-tab.active {
    color: #0a3046;
    border-color: #0a4668;
    background: #fff;
}

.family-tab span {
    min-width: 20px;
    padding: 1px 5px;
    border-radius: 999px;
    background: #f2eee7;
    text-align: center;
    font-size: .65rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 12px;
}

.summary-card {
    min-height: 84px;
    padding: 12px 15px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #dfd7cb;
    border-left: 3px solid #0b405b;
}

.summary-card-green { border-left-color: #0b8b5a; }
.summary-card-red { border-left-color: #bd3d33; }
.summary-card-blue { border-left-color: #5b7f94; }

.summary-label {
    color: #45525a;
    font-size: .7rem;
    font-weight: 700;
}

.summary-value {
    margin-top: 2px;
    color: #062f4a;
    font-size: 1.58rem;
    line-height: 1;
    font-weight: 850;
}

.summary-value span { font-size: .68rem; }

.summary-meta {
    margin-top: 6px;
    color: #6d7a82;
    font-size: .66rem;
}

.dashboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.filter-chips {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    background: #eee9df;
    border: 1px solid #dfd7cb;
    border-radius: 9px;
}

.filter-chip {
    padding: 6px 9px;
    border-radius: 7px;
    color: #17384d;
    text-decoration: none;
    font-size: .7rem;
    font-weight: 750;
}

.filter-chip.active {
    background: #fff;
    box-shadow: 0 1px 2px rgba(31,43,50,.08);
}

.disabled-chip {
    color: #637078;
    cursor: default;
}

.dashboard-search { display: flex; align-items: center; gap: 8px; }

.search-box {
    width: 260px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid #ddd4c6;
    border-radius: 8px;
}

.search-box i { color: #99a2a6; }

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    font-size: .72rem;
    color: #14364b;
}

.advanced-filter-panel {
    display: grid;
    grid-template-columns: 1fr 160px 1fr 100px auto;
    align-items: end;
    gap: 10px;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid #dfd7cb;
    background: #fff;
}

.dashboard-caption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: #707d84;
    font-size: .68rem;
}

.caption-actions { display: flex; align-items: center; gap: 10px; }

.lot-table-shell {
    background: #fff;
    border: 1px solid #dfd7cb;
    border-radius: 12px;
    overflow: hidden;
}

.lot-dashboard-table {
    min-width: 1040px;
    font-size: .74rem;
}

.lot-dashboard-table thead th {
    padding: 6px 9px;
    border-color: #426273;
    white-space: nowrap;
}

.lot-dashboard-table thead .table-band-row th {
    background: #003047;
    color: #fff;
    text-align: center;
    border-right: 1px solid #b9cad4;
    font-size: .69rem;
    letter-spacing: .035em;
}

.lot-dashboard-table thead tr:not(.table-band-row) th {
    background: #173f59;
    color: #fff;
    font-size: .67rem;
}

.selection-col { width: 36px; }

.lot-dashboard-table tbody td {
    padding: 6px 9px;
    border-color: #e6ded2;
}

.variety-group-row td {
    padding: 9px 12px !important;
    background: #d7e3ec !important;
    border-top: 2px solid #0b3d59;
}

.variety-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    border: 0;
    background: transparent;
    color: #0c334b;
    text-align: left;
}

.variety-toggle strong { font-size: .88rem; }
.variety-toggle span { color: #75858e; font-size: .68rem; }

.lot-header-row td { background: #f4efe7 !important; }

.lot-open-button {
    border: 0;
    background: transparent;
    padding: 0;
    color: #0b3048;
    text-align: left;
    font-weight: 750;
}

.lot-open-button:hover .lot-number { text-decoration: underline; }

.lot-identity-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.lot-identity-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 6px;
    border: 1px solid #c8d6dc;
    border-radius: 999px;
    background: #edf4f7;
    color: #244f63;
    font-size: .58rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
    vertical-align: middle;
}

.lot-identity-badges .lot-identity-badge {
    margin-left: 0;
}

.lot-secondary {
    margin-left: 9px;
    color: #334f60;
    font-size: .68rem;
}

.lot-year-origin {
    margin-left: 8px;
    color: #7c878c;
    font-size: .66rem;
}

.size-row td { background: #fff; }
.size-row:hover td { background: #fbfaf7; }

.size-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 7px;
    border-radius: 50%;
    background: #0c9768;
    vertical-align: middle;
}

.size-code {
    font-weight: 800;
    color: #10374d;
}

.multi-location-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 5px;
    border: 1px solid #c6d2d9;
    border-radius: 4px;
    color: #4b687a;
    background: #f0f5f8;
    font-size: .58rem;
    font-weight: 700;
}

.source-detail {
    color: #556872;
    font-size: .66rem;
}

.lot-total-row td {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    background: #fbfcfc !important;
    font-weight: 800;
    border-bottom: 2px solid #0b3954;
}

.lot-total-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: #315167;
    font-size: .66rem;
    font-weight: 800;
}

.provenance-badge {
    display: inline-flex;
    align-items: center;
    min-height: 19px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e7ecef;
    color: #45606f;
    font-size: .58rem;
    font-weight: 850;
}

.provenance-crookham { background: #ddf2e8; color: #14704b; }
.provenance-charter { background: #e5eef7; color: #265b83; }
.provenance-other { background: #f8ebcf; color: #90630d; }

.empty-state {
    padding: 50px 20px;
    text-align: center;
    color: #73818a;
}

.dashboard-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    color: #71808a;
    font-size: .72rem;
}

.lot-detail-offcanvas {
    width: min(510px, 100vw) !important;
    border-left: 1px solid #ddd4c6;
}

.lot-detail-offcanvas .offcanvas-header {
    min-height: 72px;
    padding: 13px 18px;
}

.panel-loading,
.panel-error {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 220px;
    padding: 28px;
    text-align: center;
    color: #70808a;
}

.panel-error i {
    color: #bd3d33;
    font-size: 1.65rem;
}

.lot-panel { background: #fff; }

.lot-panel-hero {
    padding: 17px 20px;
    border-bottom: 1px solid #e1d8cc;
}

.lot-panel-lot {
    color: #0b3148;
    font-size: .95rem;
    font-weight: 900;
}

.lot-panel-variety {
    margin-top: 7px;
    color: #17384e;
    font-size: 1.12rem;
    font-weight: 850;
}

.lot-panel-origin {
    margin-top: 2px;
    color: #78858d;
    font-size: .72rem;
}

.lot-panel-section {
    padding: 16px 20px;
    border-bottom: 1px solid #e1d8cc;
}

.lot-panel-status-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-callout {
    display: grid;
    grid-template-columns: 27px 1fr;
    gap: 9px;
    padding: 11px 12px;
    border-radius: 10px;
}

.status-callout i { font-size: .95rem; margin-top: 1px; }

.status-callout strong {
    display: block;
    color: #18465d;
    font-size: .72rem;
}

.status-callout span {
    display: block;
    margin-top: 2px;
    color: #63757f;
    font-size: .69rem;
}

.status-callout-current {
    background: #e6f3ec;
    color: #27805d;
}

.status-callout-note {
    background: #f9edce;
    color: #aa780f;
}

.panel-section-title {
    margin-bottom: 10px;
    color: #697780;
    font-size: .68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.panel-section-eyebrow {
    color: #73838b;
    font-size: .65rem;
    font-weight: 900;
    text-transform: uppercase;
}

.detail-grid {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 7px 12px;
    margin: 0;
    font-size: .73rem;
}

.detail-grid dt {
    color: #75838b;
    font-weight: 500;
}

.detail-grid dd {
    margin: 0;
    color: #15384e;
    font-weight: 750;
}

.size-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.size-pill-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 9px;
    border: 1px solid #ded5c8;
    border-radius: 7px;
    color: #16384d;
    text-decoration: none;
    font-size: .72rem;
    font-weight: 800;
    background: #fff;
}

.size-card-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.size-detail-card {
    overflow: hidden;
    border: 1px solid #ded5c8;
    border-radius: 10px;
}

.size-detail-card header {
    padding: 9px 11px;
    background: #f4efe7;
    color: #16384d;
    font-size: .72rem;
}

.size-metrics {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    border-top: 1px solid #e5ddd2;
    border-bottom: 1px solid #e5ddd2;
}

.size-metrics > div { padding: 9px 11px; }
.size-metrics > div + div { border-left: 1px solid #e5ddd2; }

.size-metrics span {
    display: block;
    color: #74828a;
    font-size: .6rem;
    font-weight: 800;
    text-transform: uppercase;
}

.size-metrics strong {
    display: block;
    margin-top: 2px;
    color: #14374e;
    font-size: .93rem;
}

.size-card-subheading {
    padding: 8px 11px 2px;
    color: #6c7b83;
    font-size: .62rem;
    font-weight: 900;
    text-transform: uppercase;
}

.inventory-location-list { padding: 3px 11px 8px; }

.inventory-location-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
}

.inventory-location-row + .inventory-location-row {
    border-top: 1px solid #eee8df;
}

.inventory-location-name {
    color: #17394e;
    font-size: .7rem;
    font-weight: 750;
}

.inventory-location-code {
    color: #879198;
    font-size: .6rem;
}

.document-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.document-row {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 9px;
    padding: 9px;
    border: 1px solid #ded5c8;
    border-radius: 9px;
    background: #fffdf9;
}

.document-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: #bb352b;
    color: white;
    font-size: .6rem;
    font-weight: 900;
}

.document-name {
    color: #15384f;
    font-size: .69rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.document-meta {
    color: #829098;
    font-size: .6rem;
}

.panel-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px dashed #d8d0c3;
    border-radius: 9px;
    color: #78868e;
    font-size: .7rem;
}

.phase-two-placeholder {
    background: #f7f8f7;
    color: #697780;
    font-size: .7rem;
}

.phase-two-placeholder strong {
    display: block;
    margin: 3px 0;
    color: #314f61;
}

@media (max-width: 1199.98px) {
    .summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .dashboard-toolbar { align-items: stretch; flex-direction: column; }
    .dashboard-search { width: 100%; }
    .search-box { flex: 1; width: auto; }
    .advanced-filter-panel { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 575.98px) {
    .summary-grid { grid-template-columns: 1fr; }
    .dashboard-heading { align-items: flex-start; flex-direction: column; }
    .advanced-filter-panel { grid-template-columns: 1fr; }
    .dashboard-caption { align-items: flex-start; flex-direction: column; }
}

/* =====================================================================
   Dashboard v3 design-alignment additions
   ===================================================================== */
.dashboard-page {
    width: 100%;
}

.dashboard-heading p {
    max-width: 760px;
}

.filter-chip {
    border: 0;
    background: transparent;
    line-height: 1.2;
}

.filter-chip:hover {
    color: #0d3b55;
    background: rgba(255,255,255,.45);
}

.filter-chip.active {
    color: #0b3148;
}

.preview-note,
.quality-preview-indicator {
    color: #9a6a0c;
}

.quality-preview-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
}

.lot-dashboard-table {
    min-width: 1120px;
}

/* Give the identity column the breathing room that exists in the design. */
.lot-dashboard-table th:nth-child(2),
.lot-dashboard-table td:nth-child(2) {
    min-width: 360px;
}

.lot-dashboard-table th:nth-child(3),
.lot-dashboard-table th:nth-child(4),
.lot-dashboard-table th:nth-child(5),
.lot-dashboard-table td:nth-child(3),
.lot-dashboard-table td:nth-child(4),
.lot-dashboard-table td:nth-child(5) {
    min-width: 86px;
}

.lot-dashboard-table th:nth-child(6),
.lot-dashboard-table th:nth-child(7),
.lot-dashboard-table td:nth-child(6),
.lot-dashboard-table td:nth-child(7) {
    min-width: 108px;
}

.lot-dashboard-table th:nth-child(8),
.lot-dashboard-table th:nth-child(9),
.lot-dashboard-table td:nth-child(8),
.lot-dashboard-table td:nth-child(9) {
    min-width: 118px;
}

.inventory-location-inline {
    display: inline-flex;
    align-items: center;
    margin-left: 7px;
    padding: 1px 5px;
    border: 1px solid #c8d4db;
    border-radius: 4px;
    background: #f3f7f9;
    color: #597080;
    font-size: .56rem;
    font-weight: 750;
    vertical-align: middle;
}

.germ-value {
    color: #113c54;
    font-weight: 800;
}

.germ-warning {
    color: #ad6b00;
}

.tested-date {
    color: #516674;
    font-size: .68rem;
    font-weight: 650;
}

.quality-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: .62rem;
    font-weight: 850;
    white-space: nowrap;
}

.quality-meets {
    color: #126a48;
    background: #e3f2e9;
}

.quality-watch {
    color: #a25e00;
    background: #fbedd1;
}

.quality-below {
    color: #aa2f28;
    background: #fae4df;
}

.quality-pending,
.quality-unknown {
    color: #5f7079;
    background: #edf1f3;
}

.status-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 17px;
    margin: 1px 2px;
    padding: 1px 6px;
    border-radius: 5px;
    background: #e4f1eb;
    color: #16714e;
    font-size: .55rem;
    font-weight: 900;
    line-height: 1;
}

.status-flag-spp {
    background: #fae7c8;
    color: #9a5b04;
}

.status-flag-pur {
    background: #f9dfda;
    color: #ad332b;
}

.status-flag-hold {
    background: #f8efc9;
    color: #866200;
}

.status-flag-germ {
    background: #dff1e8;
    color: #126d4b;
}

.size-row.quality-filter-hidden,
.lot-header-row.quality-filter-hidden,
.lot-total-row.quality-filter-hidden,
.variety-group-row.quality-filter-hidden {
    display: none !important;
}

@media (min-width: 1400px) {
    .dashboard-page {
        gap: 15px;
    }

    .lot-dashboard-table {
        font-size: .76rem;
    }
}

/* =====================================================================
   Dashboard v3.1 compact filters, sticky matrix header, location context
   ===================================================================== */
.dashboard-toolbar {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.dashboard-filter-form {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: 7px;
}

.dashboard-inline-search {
    width: 220px;
    flex: 0 1 240px;
    min-width: 180px;
}

.dashboard-filter-select {
    width: auto;
    min-width: 125px;
    height: 34px;
    border-color: #ddd4c6;
    color: #17384d;
    font-size: .69rem;
}

.dashboard-year-select {
    min-width: 88px;
}

.dashboard-location-select {
    min-width: 160px;
    max-width: 220px;
}

.dashboard-rows-select {
    width: 88px;
    height: 34px;
    border-color: #ddd4c6;
    color: #17384d;
    font-size: .69rem;
}

.dashboard-apply-button {
    min-width: 58px;
    height: 34px;
    font-size: .7rem;
    font-weight: 750;
}

.dashboard-clear-link {
    color: #55707f;
    font-size: .66rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-clear-link:hover {
    color: #0d3b55;
    text-decoration: underline;
}

.lot-table-shell {
    overflow: visible;
}

.lot-dashboard-table thead .table-band-row th {
    position: sticky;
    top: var(--topbar-height);
    z-index: 16;
    height: 29px;
}

.lot-dashboard-table thead tr:not(.table-band-row) th {
    position: sticky;
    top: calc(var(--topbar-height) + 29px);
    z-index: 15;
    box-shadow: 0 1px 0 rgba(0, 36, 54, .32);
}

.lot-location {
    margin-left: 9px;
    color: #284b60;
    font-size: .68rem;
    font-weight: 800;
}

.lot-panel-variety span {
    color: #73838c;
    font-size: .82rem;
    font-weight: 650;
}

@media (min-width: 1200px) {
    .lot-table-responsive {
        overflow: visible;
    }
}

@media (max-width: 1399.98px) {
    .dashboard-filter-form {
        flex-basis: 100%;
    }
}

@media (max-width: 1199.98px) {
    .lot-table-responsive {
        overflow-x: auto;
    }

    .dashboard-filter-form {
        flex-wrap: wrap;
    }

    .dashboard-inline-search {
        flex: 1 1 220px;
    }
}

/* Live dashboard filtering: keep controls interactive while results refresh. */
.dashboard-page #dashboardFamilyTabsRegion,
.dashboard-page #dashboardSummaryRegion,
.dashboard-page #dashboardResultsRegion {
    transition: opacity .12s ease;
}

.dashboard-page.dashboard-ajax-loading #dashboardFamilyTabsRegion,
.dashboard-page.dashboard-ajax-loading #dashboardSummaryRegion,
.dashboard-page.dashboard-ajax-loading #dashboardResultsRegion {
    opacity: .48;
}

.dashboard-page.dashboard-ajax-loading #dashboardResultsRegion {
    cursor: progress;
}

/* Lot-level inventory has no true size dimension: render it as one complete lot row. */
.lot-single-line-row td {
    border-bottom: 2px solid #0b3954;
}
