/* Week calendar grid: header row + (time column + 7 day columns) */

.calendar-week {
    overflow: hidden;
}

.calendar-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    grid-template-rows: auto 1fr;
    height: calc(100vh - 250px);
    min-height: 600px;
    overflow: auto;
}

.calendar-corner {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 4;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
}

.calendar-day-header {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #fff;
    text-align: center;
    padding: 8px 4px;
    border-bottom: 1px solid #dee2e6;
    border-right: 1px solid #f0f0f0;
}

.calendar-day-header.today {
    background: #fff8e1;
}

.calendar-times {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    border-right: 1px solid #dee2e6;
    grid-row: 2;
    grid-column: 1;
}

/* 96 slots × 14px = 1344px tall (24h × 4 slots) */
.calendar-time-label {
    height: 14px;
    font-size: 10px;
    color: #888;
    padding-right: 4px;
    text-align: right;
    line-height: 14px;
}

.calendar-time-label.hour-mark {
    border-top: 1px solid #dee2e6;
    color: #555;
    font-weight: 500;
}

.calendar-day-column {
    grid-row: 2;
    position: relative;
    border-right: 1px solid #f0f0f0;
    overflow: hidden;
}

.calendar-day-column.today {
    background: #fffdf3;
}

.calendar-slot {
    height: 14px;
    border-bottom: 1px dashed #f4f4f4;
}

.calendar-slot.hour-mark {
    border-top: 1px solid #dee2e6;
    border-bottom: 1px dashed #f4f4f4;
}

/* Events */
.calendar-event {
    position: absolute;
    left: 2px;
    right: 2px;
    background: #cfe2ff;
    border-left: 4px solid #0d6efd;
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 11px;
    overflow: hidden;
    cursor: pointer;
    z-index: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
    transition: filter .12s;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.calendar-event .evt-meta {
    display: none;
}

.calendar-event.tall .evt-meta {
    display: flex;
}

.calendar-event:hover {
    filter: brightness(.95);
    z-index: 5;
}

.calendar-event.manual {
    background: #d1e7dd;
    border-left-color: #198754;
}

.calendar-event.has-overlap {
    background: #fff3cd;
    border-left-color: #ffc107;
    box-shadow: 0 0 0 1px #ffc107, 0 1px 2px rgba(0,0,0,.08);
}

/* A single occurrence moved or edited away from its recurring series' default slot. */
.calendar-event.occurrence-exception {
    border-left-color: #0dcaf0;
    border-left-style: dashed;
}

/* Meetings whose workplace is on a day off — visually marked as passed.
   Greyed-out background + line-through indicates "no need to track this". */
.calendar-event.on-day-off {
    background: #eef0f3;
    border-left-color: #adb5bd;
    color: #6c757d;
    text-decoration: line-through;
}

.calendar-event.on-day-off .evt-title { color: #6c757d; }

.day-off-marker {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
    justify-content: center;
}

.day-off-marker .badge {
    font-size: 9px;
    padding: 2px 5px;
}

.day-off-workplaces {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
}

/* Informational country-wide marker — doesn't grey out meetings. */
.national-holiday-marker {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
    justify-content: center;
}

.national-holiday-marker .badge {
    font-size: 9px;
    padding: 2px 5px;
}

.evt-title {
    font-weight: 600;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.evt-title .badge.evt-workplace {
    font-size: 9px;
    padding: 1px 4px;
    margin-right: 2px;
    vertical-align: 1px;
}

.evt-meta {
    color: #555;
    font-size: 10px;
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
    flex-wrap: wrap;
}

.evt-meta .badge {
    font-size: 9px;
    padding: 1px 4px;
}

.text-pre-wrap {
    white-space: pre-wrap;
    word-break: break-word;
}

.strikethrough {
    text-decoration: line-through;
}

/* Phones: keep the 7 day columns readable. The grid already scrolls inside
   .calendar-week, so a sensible per-column min-width turns the week view
   into a clean horizontal scroll instead of crushing 7 days into ~45px each.
   Lives here (not app.css) because calendar.css loads last and would
   otherwise win on the base .calendar-grid rule. */
@media (max-width: 767.98px) {
    .calendar-grid {
        grid-template-columns: 44px repeat(7, minmax(92px, 1fr));
        height: calc(100vh - 200px);
        min-height: 0;
    }
}
