/* Rota parser — grid board */

.page-rota {
    --rota-part: #b45309;
    --rota-grid-cols: var(--parser-label-col) 44px repeat(7, minmax(0, 1fr));
}

.rota-sheet {
    overflow-x: auto;
}

.rota-grid {
    display: grid;
    grid-template-columns: var(--rota-grid-cols);
    align-items: stretch;
    min-width: 760px;
}

.rota-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem 0.35rem;
    border-bottom: 1px solid var(--parser-border);
    font-size: clamp(0.625rem, 0.82vw, 0.75rem);
    line-height: 1.25;
    min-width: 0;
    min-height: 2.25rem;
    word-break: break-word;
}

.rota-cell--label {
    font-weight: 600;
    color: var(--parser-text);
    background: var(--parser-sheet-muted);
    border-right: 1px solid var(--parser-border);
}

.rota-cell--meta {
    color: var(--parser-text-muted);
    background: var(--parser-sheet-muted);
    border-right: 1px solid var(--parser-border);
    font-variant-numeric: tabular-nums;
}

/* Colleague counts — unified panel */
.rota-counts {
    background: #f1f5f9;
    border-bottom: 1px solid var(--parser-border);
}

.rota-counts__grid {
    display: grid;
    grid-template-columns: var(--rota-grid-cols);
    grid-template-rows: auto auto;
    min-width: 760px;
}

.rota-counts__title {
    grid-row: 1 / 3;
    grid-column: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.75rem 0.5rem;
    background: #e2e8f0;
    border-right: 1px solid var(--parser-border);
    text-align: center;
}

.rota-counts__title-text {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--parser-text);
    line-height: 1.2;
}

.rota-counts__title-hint {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--parser-text-muted);
    line-height: 1.2;
}

.rota-counts__type {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #fff;
    border-right: 1px solid var(--parser-border);
    border-bottom: 1px solid var(--parser-border);
}

.rota-counts__type--full {
    grid-row: 1;
    grid-column: 2;
    color: var(--parser-accent);
}

.rota-counts__type--part {
    grid-row: 2;
    grid-column: 2;
    color: var(--rota-part);
    border-bottom: none;
}

.rota-counts__cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    background: #fff;
    border-bottom: 1px solid var(--parser-border);
}

.rota-counts__cell--part {
    background: #fafafa;
    border-bottom: none;
}

.rota-counts__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.rota-counts__pill--full {
    background: var(--parser-accent);
    color: #fff;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.25);
}

.rota-counts__pill--part {
    background: var(--rota-part);
    color: #fff;
    box-shadow: 0 1px 2px rgba(180, 83, 9, 0.25);
}

.rota-counts__pill--zero {
    background: #fff;
    color: #94a3b8;
    box-shadow: inset 0 0 0 1.5px #cbd5e1;
}

.rota-counts__pill--zero.rota-counts__pill--full {
    color: #a5b4fc;
}

.rota-counts__pill--zero.rota-counts__pill--part {
    color: #fcd34d;
}

.rota-grid--days {
    background: #1e293b;
}

.rota-grid--days .rota-cell {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

.rota-grid--days .rota-cell--label,
.rota-grid--days .rota-cell--meta {
    background: transparent;
    border-right-color: rgba(255, 255, 255, 0.08);
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rota-grid--days .rota-cell--dayhead {
    background: transparent;
    font-weight: 700;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-direction: column;
}

.rota-day-date {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: #94a3b8;
    text-align: center;
    width: 100%;
}

.rota-grid--employee:nth-child(even) .rota-cell--name,
.rota-grid--employee:nth-child(even) .rota-cell--hours {
    background: #fcfdff;
}

.rota-grid--employee:hover .rota-cell--name,
.rota-grid--employee:hover .rota-cell--hours,
.rota-grid--employee:hover .rota-cell--shift {
    background: #eef2ff;
}

.rota-cell--name {
    font-weight: 500;
    color: var(--parser-text);
}

.rota-cell--hours {
    font-size: 0.625rem;
    font-weight: 600;
}

.rota-cell--shift {
    font-variant-numeric: tabular-nums;
    color: var(--parser-text);
}

.rota-cell--off {
    color: #cbd5e1;
    font-style: italic;
}

@media (max-width: 600px) {
    .rota-grid {
        min-width: 680px;
    }

    .rota-counts__grid {
        min-width: 680px;
    }

    .rota-cell {
        padding: 0.4rem 0.2rem;
        min-height: 2rem;
    }
}
