.calendar-page-header,
.phase23i-calendar-toolbar,
.phase23i-filter-card,
.phase23i-legend-card,
.phase23i-calendar-card,
.phase23i-list-layout {
    width: 100%;
    max-width: none;
}

.phase23i-calendar-header {
    align-items: flex-end;
    gap: 18px;
}

.phase23i-calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 14px 16px;
}

.phase23i-view-tabs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border: 1px solid #dbe4f0;
    background: #f8fafc;
    border-radius: 999px;
}

.phase23i-view-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 14px;
    border-radius: 999px;
    color: #334155;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.phase23i-view-tab:hover,
.phase23i-view-tab.active {
    background: #0f172a;
    color: #ffffff;
}

.phase23i-calendar-kpis {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.phase23i-calendar-kpis span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    border-radius: 999px;
    padding: 5px 11px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 700;
    font-size: .82rem;
}

.phase23i-filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) minmax(190px, .9fr) minmax(240px, 1.2fr) minmax(210px, .9fr) auto;
    gap: 14px;
    align-items: end;
}

.phase23i-filter-grid .field label {
    display: block;
    margin-bottom: 6px;
    color: #334155;
    font-weight: 800;
    font-size: .84rem;
}

.phase23i-filter-grid input,
.phase23i-filter-grid select {
    width: 100%;
    min-height: 42px;
}

.phase23i-filter-actions .actions-row {
    white-space: nowrap;
}

.calendar-status-legend,
.calendar-activity-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.calendar-activity-legend {
    margin-top: 10px;
}

.legend-pill,
.activity-color-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .82rem;
    font-weight: 800;
    border: 1px solid #dbe4f0;
    background: #f8fafc;
    white-space: nowrap;
}

.activity-color-pill::before,
.legend-pill::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 7px;
    background: var(--event-color, #64748b);
    flex: 0 0 auto;
}

.legend-pill.status-scheduled::before { background: #2563eb; }
.legend-pill.status-done::before { background: #16a34a; }
.legend-pill.status-to_reschedule::before { background: #dc2626; }
.legend-pill.status-cancelled::before { background: #94a3b8; }
.legend-pill.has-conflict::before { background: #f97316; }

.phase23i-calendar-scroll {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 3px;
}

.phase23i-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(170px, 1fr));
    gap: 1px;
    background: #dbe4f0;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    overflow: hidden;
    min-width: 1180px;
}

.phase23i-month-grid .calendar-head {
    background: #f1f5f9;
    color: #334155;
    padding: 10px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .78rem;
}

.phase23i-month-grid .calendar-cell {
    min-height: 175px;
    background: #ffffff;
    padding: 8px;
    min-width: 0;
}

.phase23i-month-grid .calendar-muted {
    background: #f8fafc;
    color: #94a3b8;
}

.phase23i-month-grid .calendar-today {
    box-shadow: inset 0 0 0 2px #2563eb;
}

.calendar-date-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.calendar-date {
    font-weight: 900;
    color: #0f172a;
}

.day-count {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: .75rem;
    font-weight: 900;
}

.calendar-events-stack,
.phase23i-day-events,
.phase23i-side-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.phase23i-list-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
    gap: 18px;
    align-items: start;
}

.phase23i-period-list-card,
.phase23i-side-list-card {
    width: 100%;
    max-width: none;
}

.phase23i-day-group {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #ffffff;
}

.phase23i-day-group.is-today {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb33;
}

.phase23i-day-heading {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: #f8fafc;
    color: #1e293b;
}

.phase23i-day-events {
    padding: 10px;
}

.phase23i-event-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
    border-radius: 12px;
    padding: 8px 10px;
    border: 1px solid #dbe4f0;
    border-left: 6px solid var(--event-color, #2563eb);
    background: #ffffff;
    color: #0f172a;
    min-width: 0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}

.phase23i-event-card.compact {
    padding: 7px 8px;
    border-radius: 10px;
}

.phase23i-event-card .event-main-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.phase23i-event-card strong,
.phase23i-event-card span,
.phase23i-event-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.phase23i-event-card strong {
    font-size: .9rem;
    color: #0f172a;
}

.phase23i-event-card span,
.phase23i-event-card small {
    font-size: .78rem;
    color: #475569;
}

.phase23i-event-card .event-time {
    color: #1e293b;
    font-weight: 900;
}

.phase23i-event-card .event-notes {
    white-space: normal;
    line-height: 1.35;
}

.phase23i-event-card.status-done {
    opacity: .82;
}

.phase23i-event-card.status-cancelled {
    opacity: .55;
    text-decoration: line-through;
}

.phase23i-event-card.has-conflict {
    outline: 2px solid #f97316;
    outline-offset: 1px;
}

.event-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: .74rem;
    font-weight: 900;
}

.event-inline-actions a {
    color: #2563eb;
    text-decoration: none;
}

.event-inline-actions a.danger {
    color: #dc2626;
}

.phase23i-side-list {
    max-height: 780px;
    overflow: auto;
    padding-right: 4px;
}

@media (max-width: 1320px) {
    .phase23i-list-layout {
        grid-template-columns: 1fr;
    }
    .phase23i-side-list {
        max-height: none;
    }
}

@media (max-width: 1040px) {
    .phase23i-filter-grid {
        grid-template-columns: 1fr 1fr;
    }
    .phase23i-filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .phase23i-filter-grid,
    .phase23i-calendar-toolbar {
        grid-template-columns: 1fr;
    }
    .phase23i-view-tabs {
        width: 100%;
        justify-content: center;
        overflow-x: auto;
    }
    .phase23i-calendar-kpis {
        justify-content: flex-start;
    }
}
