/* ====== Layout & Shell ====== */
.pmc-calendar {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    padding: 16px 18px 18px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    max-width: 1100px;
    margin: 0 auto;
}

.pmc-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.pmc-cal-title {
    font-size: 18px;
    font-weight: 600;
}

.pmc-cal-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pmc-cal-nav button {
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 4px 9px;
    cursor: pointer;
    font-size: 13px;
}

.pmc-cal-nav button:hover {
    background: #f3f4f6;
}

.pmc-cal-month-label {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 13px;
}

.pmc-cal-main {
    display: grid;
    grid-template-columns: 2.1fr 1fr;
    gap: 16px;
    margin-top: 10px;
}

/* ====== Filters ====== */
.pmc-cal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.pmc-chip {
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f9fafb;
}

.pmc-chip span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.pmc-chip.pmc-active {
    border-color: rgba(148, 163, 184, 0.7);
    background: #ffffff;
}

.pmc-chip-acls span { background: #38bdf8; }
.pmc-chip-pals span { background: #f97373; }
.pmc-chip-bls  span { background: #22c55e; }
.pmc-chip-tncc span { background: #fbbf24; }

/* ====== Calendar grid ====== */
.pmc-cal-grid {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.pmc-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.pmc-cal-weekday {
    padding: 6px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.pmc-cal-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: #ffffff;
}

.pmc-cal-day {
    min-height: 72px;
    border-bottom: 1px solid #f3f4f6;
    border-right: 1px solid #f3f4f6;
    padding: 4px 5px 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pmc-cal-day:nth-child(7n) {
    border-right: none;
}

.pmc-cal-day-number {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
}

.pmc-cal-day-outside .pmc-cal-day-number {
    color: #d1d5db;
}

.pmc-cal-day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 2px;
}

/* ====== Event badges ====== */
.pmc-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pmc-badge-acls {
    background: #e0f2fe;
    color: #0369a1;
}

.pmc-badge-pals {
    background: #fee2e2;
    color: #b91c1c;
}

.pmc-badge-tncc {
    background: #fef3c7;
    color: #92400e;
}

.pmc-badge-bls {
    background: #dcfce7;
    color: #166534;
}

/* "Stretch" look for multi-day badges */
.pmc-badge-span { width: 100%; }
.pmc-badge-span-start {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.pmc-badge-span-middle { border-radius: 0; }
.pmc-badge-span-end {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* ====== Sidebar (Key dates) ====== */
.pmc-cal-sidebar {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pmc-sidebar-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.pmc-keydate-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 430px;
    overflow: auto;
}

.pmc-keydate-item {
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pmc-keydate-date {
    font-size: 11px;
    color: #6b7280;
}

.pmc-keydate-label {
    font-size: 12px;
    font-weight: 500;
}

.pmc-keydate-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ====== Responsive ====== */
@media (max-width: 900px) {
    .pmc-cal-main { grid-template-columns: 1fr; }
    .pmc-cal-sidebar { max-height: none; }
}

@media (max-width: 600px) {
    .pmc-calendar {
        padding: 12px;
        border-radius: 12px;
    }
    .pmc-cal-header {
        flex-direction: column;
        align-items: flex-start;
    }
}