/* ========================================
   CALENDAR PAGE STYLES
   ======================================== */

.calendar-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .calendar-container {
        grid-template-columns: 1fr;
    }
}

.calendar-main {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 1rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 12px -2px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.calendar-nav-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
}

.calendar-nav-buttons {
    display: flex;
    gap: 0.5rem;
}

.calendar-nav-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--foreground);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 0.75rem;
    overflow: hidden;
}

.calendar-header-cell {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground);
    background: rgba(255, 255, 255, 0.8);
}

.calendar-cell {
    min-height: 80px;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background 0.15s ease;
}

.calendar-cell:hover {
    background: rgba(255, 255, 255, 1);
}

.calendar-cell.other-month {
    background: rgba(0, 0, 0, 0.02);
}

.calendar-cell.other-month .calendar-day {
    color: var(--muted-foreground);
    opacity: 0.5;
}

.calendar-cell.today {
    background: rgba(0, 0, 0, 0.03);
}

.calendar-cell.today .calendar-day {
    background: #000000;
    color: #ffffff;
}

.calendar-cell.selected {
    background: rgba(0, 0, 0, 0.05);
}

.calendar-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--foreground);
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-event-dot {
    height: 4px;
    border-radius: 2px;
    font-size: 0;
}

.calendar-event-dot.shift {
    background: #3b82f6;
}

.calendar-event-dot.deadline {
    background: #ef4444;
}

.calendar-event-dot.meeting {
    background: #8b5cf6;
}

.calendar-event-dot.holiday {
    background: #10b981;
}

/* ── New event types ──────────────────────────────────────────────────────── */

.calendar-event-dot.late {
    background: #F59E0B;
}

.calendar-event-dot.overdue {
    background: #EF4444;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */

.calendar-sidebar {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 1rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 12px -2px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.calendar-sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.calendar-event-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ── Event items (sidebar) ────────────────────────────────────────────────── */

.calendar-event-item {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0.75rem;
    border-left: 3px solid transparent;
}

.calendar-event-item--shift {
    background: #EFF6FF;
    border-left-color: #3b82f6;
}

.calendar-event-item--late {
    background: #FFFBEB;
    border-left-color: #F59E0B;
    color: #92400E;
}

.calendar-event-item--deadline {
    background: rgba(0, 0, 0, 0.02);
    border-left-color: #ef4444;
}

.calendar-event-item--overdue {
    background: #FEF2F2;
    border-left-color: #EF4444;
    color: #991B1B;
}

.calendar-event-item--holiday {
    background: #ECFDF5;
    border-left-color: #10B981;
}

.calendar-event-item--meeting {
    background: #F5F3FF;
    border-left-color: #8b5cf6;
}

.calendar-event-title {
    display: block;
    font-size: 13px;
    font-weight: 500;
}

.calendar-event-details {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    margin-top: 2px;
}

/* Legacy sub-elements kept for compatibility */
.calendar-event-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-foreground);
    white-space: nowrap;
}

.calendar-event-info h4 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 0.125rem;
}

.calendar-event-info p {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin: 0;
}

/* ── Loading state ────────────────────────────────────────────────────────── */

.calendar-loading {
    margin-bottom: 1.5rem;
}

.calendar-loading__skel {
    height: 300px;
    border-radius: 10px;
}

/* ── Empty / error states ─────────────────────────────────────────────────── */

.cal-no-events {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.cal-error-banner {
    background: #FEF2F2;
    border: 1px solid #EF4444;
    color: #991B1B;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ── Mobile responsive ────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .calendar-container {
        grid-template-columns: 1fr;
    }

    .calendar-sidebar {
        border-top: 1px solid #E5E7EB;
        max-height: 240px;
        overflow-y: auto;
    }

    .calendar-grid {
        font-size: 13px;
    }

    .calendar-cell {
        min-height: 52px;
        padding: 4px;
    }
}

@media (max-width: 480px) {
    .calendar-cell {
        min-height: 40px;
        padding: 2px;
        font-size: 12px;
    }

    .calendar-nav-title {
        font-size: 1rem;
    }
}
