/* ── View toggle ─────────────────────────────────────────────────── */
.events-view-toggle {
    display: flex;
    gap: 0.5rem;
}
.events-view-btn {
    font-size: 0.875rem;
    color: #6c757d;
    background: none;
    border: 1px solid transparent;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1.5;
}
.events-view-btn:hover {
    color: #333;
    border-color: #ced4da;
}
.events-view-btn.active {
    color: #212529;
    font-weight: 600;
    border-color: #ced4da;
    background: #f8f9fa;
}

/* ── Calendar widget ─────────────────────────────────────────────── */
.events-calendar-widget {
    max-width: 100%;
}
.events-cal-title {
    font-size: 1.1rem;
}

/* Outer border */
.events-cal-grid-wrap {
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-right: none;
}
.events-cal-week {
    /* no positioning needed */
}

/* 7-column grid used by header, span track, and day rows */
.events-cal-head,
.events-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.events-cal-dow {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    text-align: center;
    padding: 0.3rem 0;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
}

.events-cal-day {
    position: relative;
    vertical-align: top;
    padding: 0.35rem 0.25rem 0.5rem;
    min-height: 70px;
    cursor: default;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    overflow: hidden;
}
.events-cal-empty {
    background: #fafafa;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    min-height: 70px;
}

.events-cal-today .events-cal-daynum {
    font-weight: 700;
}
.events-cal-daynum {
    font-size: 0.85rem;
    display: block;
    text-align: right;
    line-height: 1;
    margin-bottom: 0.2rem;
}
.events-cal-event-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 3px;
}
.events-cal-event-chip {
    font-size: 0.68rem;
    line-height: 1.3;
    color: #212529;
    overflow: hidden;
    text-align: left;
    cursor: pointer;
    padding: 1px 0;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}
.events-cal-event-chip::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0d6efd;
    flex-shrink: 0;
}
.events-cal-event-time {
    color: #6c757d;
    flex-shrink: 0;
}
.events-cal-event-name {
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}
.events-cal-more {
    font-size: 0.65rem;
    color: #6c757d;
    text-align: left;
    padding-left: 2px;
}

/* ── Multi-day all-day span chips ────────────────────────────────── */
/* Negative margins cancel the cell's 0.25rem padding so adjacent   */
/* chips in consecutive cells visually connect at the cell border.  */
.events-cal-span-chip {
    display: block;
    font-size: 0.68rem;
    line-height: 1.7;
    background: #0d6efd;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 0;
    margin: 1px -0.25rem;
    padding: 0;
}
.events-cal-span-chip.span-first {
    border-radius: 3px 0 0 3px;
    margin-left: 2px;
    padding-left: 6px;
}
.events-cal-span-chip.span-last {
    border-radius: 0 3px 3px 0;
    margin-right: 2px;
}
.events-cal-span-chip.span-first.span-last {
    border-radius: 3px;
    margin-left: 2px;
    margin-right: 2px;
}
.events-cal-span-link {
    color: #fff;
    text-decoration: none;
}
.events-cal-span-link:hover {
    text-decoration: underline;
}

/* ── Popover body styles ─────────────────────────────────────────── */
.events-cal-has-events {
    cursor: pointer;
}
.ecal-pop-time {
    font-size: 0.78rem;
    color: #0d6efd;
    margin-bottom: 2px;
}
.ecal-pop-loc {
    font-size: 0.75rem;
    color: #6c757d;
}
