/* Lifecycle Forecast grid — routines down the side, months across the top.
   Visual language adapted from routine-schedule.css so the two forecasts match. */

.forecast-grid-host {
    overflow-x: auto;
    width: 100%;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #fff;
}

.forecast-grid {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
}

.forecast-grid th,
.forecast-grid td {
    border-bottom: 1px solid #E5E7EB;
    border-right: 1px solid #E5E7EB;
    padding: 0;
}

/* Month header row */
.forecast-grid thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #F9FAFB;
    font: 500 11px var(--mud-typography-default-family, sans-serif);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6B7280;
    padding: 11px 10px 9px;
    white-space: nowrap;
    text-align: center;
}

/* Pin the routine (first) column while month columns scroll horizontally. */
.forecast-grid-routine-head,
.forecast-grid-routine-cell {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #fff;
    min-width: 240px;
    max-width: 280px;
    text-align: left !important;
    font: 500 13.5px var(--mud-typography-default-family, sans-serif);
    color: #111827;
    line-height: 1.3;
    padding: 12px 16px;
    white-space: normal;
    border-right: 1px solid #E5E7EB;
}

.forecast-grid-routine-head {
    z-index: 4;
    background: #F9FAFB;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    font-weight: 500;
    color: #6B7280;
    vertical-align: middle;
}

.forecast-grid tbody tr:hover .forecast-grid-routine-cell {
    background: #F9FAFB;
}

.forecast-grid tbody tr:hover {
    background: #F9FAFB;
}

.forecast-grid-month-head {
    min-width: 84px;
}

.forecast-grid-cell {
    text-align: center;
    vertical-align: middle;
    height: 60px;
    min-width: 84px;
}

.forecast-grid-cell-empty {
    background: #FCFCFD;
}

/* The clickable stacked mini-card inside a populated cell. */
.forecast-cell-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    margin: 5px;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    background: #DBEAFE;
    color: #1E55C4;
    border: 1px solid #B8D5F9;
    transition: transform 120ms ease-out, box-shadow 120ms ease-out, background-color 120ms ease-out;
}

.forecast-cell-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    background: #C9DEFA;
}

.forecast-cell-card-active {
    background: #155DFC;
    color: #fff;
    border-color: #155DFC;
    box-shadow: 0 0 0 2px rgba(21, 93, 252, 0.25);
}

/* Lifecycle/override cells get a dashed purple outline + drift corner marker. */
.forecast-cell-card-override {
    background: rgba(109, 40, 217, 0.10);
    color: #5B21B6;
    border: 1px dashed #6D28D9;
}

.forecast-cell-card-override:hover {
    background: rgba(109, 40, 217, 0.18);
}

.forecast-cell-card-active.forecast-cell-card-override {
    background: #6D28D9;
    color: #fff;
    border-style: solid;
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.25);
}

.forecast-cell-count {
    font: 700 17px var(--mud-typography-default-family, sans-serif);
    line-height: 1.1;
}

.forecast-cell-assets {
    font: 500 9.5px var(--mud-typography-default-family, sans-serif);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0.85;
}

.forecast-cell-override-marker {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 8px 8px 0;
    border-color: transparent #6D28D9 transparent transparent;
}

.forecast-action-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--mud-palette-surface);
}
