/* Isolated home-dashboard component layouts. Loaded after site.css so the
   legacy stylesheet's duplicated dashboard declarations cannot override them. */
.dashboard-stat-row {
    display: grid;
    gap: 0;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.35fr) minmax(0, 1.1fr);
    padding: 0;
}

.dashboard-stat-row .dashboard-stat-cell {
    align-items: center;
    display: grid;
    gap: .28rem;
    grid-template-columns: auto minmax(0, 1fr);
    min-width: 0;
    padding: .5rem .8rem;
}

.dashboard-stat-row .dashboard-stat-cell + .dashboard-stat-cell { border-left: 1px solid rgba(215, 209, 197, .9); }
.dashboard-stat-row .dashboard-stat-cell b { font-size: 1rem; line-height: 1; }
.dashboard-stat-row .dashboard-stat-cell small { color: var(--muted); font: inherit; line-height: 1.15; overflow-wrap: anywhere; }
.dashboard-stat-row:not(:has(> :nth-child(3))) { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.dashboard-crop-snapshot { display: grid; gap: .45rem; }

.dashboard-crop-snapshot-summary {
    align-items: center;
    display: grid;
    gap: .45rem;
    grid-template-columns: 5.35rem minmax(0, 1fr);
}

.dashboard-crop-snapshot-art {
    align-items: center;
    display: flex;
    gap: .25rem;
    min-width: 0;
    overflow: visible;
    grid-row: auto;
    padding: 0;
}

.dashboard-crop-snapshot-art .module-crop-command-visual {
    flex: 0 0 2.55rem;
    height: 2.55rem;
    margin: 0;
    overflow: visible;
    width: 2.55rem;
}

.dashboard-crop-snapshot-art .crop-visual { height: 2.4rem; margin: 0; width: 2.4rem; }
.dashboard-crop-snapshot-content { display: grid; gap: .3rem; min-width: 0; }
.dashboard-crop-snapshot-content .module-crop-command-read { align-items: baseline; display: flex; flex-wrap: wrap; gap: .15rem .28rem; min-width: 0; }
.dashboard-crop-snapshot-content .module-crop-command-read span { overflow-wrap: normal; }
.dashboard-crop-snapshot-content .module-crop-command-state { align-items: baseline; display: flex; flex-wrap: wrap; gap: .12rem .45rem; grid-column: auto; min-width: 0; overflow-wrap: normal; padding: 0; word-break: normal; }
.dashboard-crop-snapshot-content .module-crop-command-state b { flex: 0 0 100%; overflow-wrap: normal; word-break: normal; }
.dashboard-crop-snapshot-content .module-crop-command-state span { overflow-wrap: normal; white-space: nowrap; word-break: normal; }
.dashboard-crop-snapshot > .module-crop-command-priority { margin: 0; min-width: 0; white-space: normal; }

.dashboard-layout-header {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: .5rem;
    justify-content: space-between;
    margin-bottom: .35rem;
    width: 100%;
}

.dashboard-layout-header h3 { flex: 1 1 auto; margin: 0; }
.dashboard-layout-header .layout-open-action { flex: 0 0 auto; margin: 0; white-space: nowrap; }
.dashboard-layout-preview .layout-thumbnail-link {
    aspect-ratio: 900 / 420;
    height: auto;
    margin-bottom: .45rem;
}
.dashboard-layout-preview .farm-layout-thumb { transform: none; }
.dashboard-stat-row--crops { grid-template-columns: minmax(0, .75fr) minmax(0, 1.1fr) minmax(0, 1.45fr); }
.dashboard-stat-row--crops .dashboard-stat-cell:last-child small { font-size: .66rem; white-space: nowrap; }

@media (max-width: 720px) {
    .dashboard-stat-row .dashboard-stat-cell { gap: .22rem; padding-inline: .72rem; }
    .dashboard-stat-row .dashboard-stat-cell b { font-size: .92rem; }
    .dashboard-stat-row .dashboard-stat-cell small { font-size: .66rem; }
    .dashboard-crop-snapshot-summary { grid-template-columns: 5rem minmax(0, 1fr); }
    .dashboard-crop-snapshot-art .module-crop-command-visual { flex-basis: 2.35rem; height: 2.35rem; width: 2.35rem; }
    .dashboard-crop-snapshot-art .crop-visual { height: 2.2rem; width: 2.2rem; }
}

@media (max-width: 390px) {
    .dashboard-stat-row .dashboard-stat-cell { padding-inline: .66rem; }
    .dashboard-stat-row .dashboard-stat-cell small { font-size: .62rem; }
    .dashboard-crop-snapshot { gap: .35rem; }
    .dashboard-crop-snapshot-summary { grid-template-columns: 4.75rem minmax(0, 1fr); }
    .dashboard-crop-snapshot-art { gap: .18rem; }
    .dashboard-crop-snapshot-art .module-crop-command-visual { flex-basis: 2.25rem; height: 2.25rem; width: 2.25rem; }
    .dashboard-crop-snapshot-art .crop-visual { height: 2.08rem; width: 2.08rem; }
}
