/* ===== Time grid as a heat map =====

   Own file since 2026-08-19, because the heat map now also stands in the report — and the
   frozen file embeds only tokens.css and report.css. The rules used to live in portal.css,
   where the sent file could not reach them: the grid arrived there unstyled.

   One source, two consumers. Copying the rules into report.css would have been the shorter
   way and the wrong one — within half a year the portal and the file would draw the same
   day differently, exactly what rendering both from the same components prevents. */

.hmgrid {
    display: grid;
    gap: 3px;
    align-items: center;
}

.hmgrid .hc {
    height: 28px;
    border-radius: 5px;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    background: var(--fill);
    cursor: pointer;
    transition: transform .08s;
    border: 0;
    color: var(--ink);
    font-family: inherit;
}

.hmgrid.wide .hc {
    height: 32px;
    border-radius: 7px;
    font-size: 11.5px;
}

.hmgrid .hc:hover {
    transform: scale(1.12);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(15, 25, 35, .22);
}

.hmgrid .hc.sel {
    outline: 2px solid var(--ink);
    outline-offset: 1px;
    z-index: 3;
}

.hmgrid .hc.fut {
    background: transparent;
    border: 1px dashed var(--stroke-2);
    cursor: default;
}

.hmgrid .hc.fut:hover {
    transform: none;
    box-shadow: none;
}

.hmgrid .hc.we {
    background: var(--fill);
    opacity: .5;
    cursor: default;
}

/* Gap on a working day — highlighted with a dashed border. */
.hmgrid .hc.gap {
    background: transparent;
    border: 1.5px dashed var(--amber);
    color: var(--amber);
}

.hmgrid .hc.abs {
    background: var(--blue-soft);
    color: var(--blue);
    cursor: default;
}

.hkw {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--ink-3);
    text-align: center;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--stroke);
    margin-bottom: 3px;
}

.hmgrid .hh {
    text-align: center;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--ink-2);
    line-height: 1.2;
}

.hmgrid .hh span {
    display: block;
    font-size: 8.5px;
    font-weight: 500;
    color: var(--ink-3);
}

.hmgrid .hh.we {
    color: var(--ink-3);
}

.hmgrid .hh.today,
.hmgrid .hh.today span {
    color: var(--accent);
    font-weight: 700;
}

.hname {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
}

.avatar.sm {
    width: 24px;
    height: 24px;
    font-size: 10px;
    border-radius: 8px;
}

.hsum {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
    padding-top: 4px;
    border-top: 1px solid var(--stroke);
}

/* Legend below the toggle — only this component uses it. */
.leg {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--ink-2);
}

.leg span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.leg em {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    font-style: normal;
    flex: none;
}

/* ===== Static rendering (frozen file, print) =====

   The file is rendered through HtmlRenderer and has no circuit: a clickable field would be
   a dead button there. The component therefore renders fields as plain elements in this
   mode — these rules take back what the interactive version promises by its cursor and its
   hover. */
.hmgrid.static .hc {
    cursor: default;
}

.hmgrid.static .hc:hover {
    transform: none;
    box-shadow: none;
}

/* In the report the grid stands inside a section and needs its own air; in the portal it
   sits in a card that already brings padding. */
.report .time-grid {
    margin-top: 14px;
}

.report .hmgrid .hc {
    height: 24px;
    font-size: 9.5px;
}

@media print {
    /* 21 columns on A4: fields get flatter instead of the page getting wider. */
    .report .hmgrid .hc {
        height: 18px;
        border-radius: 3px;
    }

    .report .time-grid {
        break-inside: avoid;
    }
}
