.wo-calendar-page {
    width: 100%;
    min-height: calc(100vh - 62px);
    padding: 18px;
    color: #10213b;
    background: #edf4fc;
}

.wo-calendar-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}

.wo-calendar-toolbar h1 {
    margin: 0 0 4px;
    color: #102a56;
    font-size: 28px;
}

.wo-calendar-toolbar p {
    margin: 0;
    color: #58708f;
}

.wo-calendar-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.calendar-button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 8px 12px;
    color: #1d4ed8;
    background: #fff;
    border: 1px solid #93b4df;
    border-radius: 9px;
    font-weight: 700;
}

.calendar-button:hover {
    color: #fff;
    background: #1d4ed8;
    text-decoration: none;
}

.calendar-month {
    min-width: 165px;
    color: #102a56;
    font-size: 20px;
    font-weight: 800;
    text-align: center;
}

.calendar-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid #cbdaf0;
    border-radius: 10px;
    color: #405a78;
    font-size: 13px;
}

.calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.not-started { background: #94a3b8; }
.legend-dot.in-progress { background: #2563eb; }
.legend-dot.complete { background: #16a34a; }
.legend-dot.overdue { background: #dc2626; }

.calendar-scroll {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(40, 76, 120, .12);
}

.work-order-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(145px, 1fr));
    min-width: 1050px;
    background: #cbdaf0;
    gap: 1px;
    border: 1px solid #b6c9e2;
}

.calendar-weekday {
    padding: 10px;
    color: #fff;
    background: #173b70;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.calendar-day {
    min-height: 150px;
    padding: 8px;
    background: #fff;
}

.calendar-day.other-month {
    background: #f1f5f9;
}

.calendar-day.today {
    box-shadow: inset 0 0 0 3px #2563eb;
}

.calendar-day-number {
    margin-bottom: 7px;
    color: #405a78;
    font-size: 14px;
    font-weight: 800;
}

.calendar-day.today .calendar-day-number {
    color: #1d4ed8;
}

.calendar-order {
    margin-bottom: 7px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-left: 5px solid #94a3b8;
    border-radius: 8px;
}

.calendar-order.in-progress {
    background: #eff6ff;
    border-color: #93c5fd;
    border-left-color: #2563eb;
}

.calendar-order.complete {
    background: #ecfdf3;
    border-color: #86efac;
    border-left-color: #16a34a;
}

.calendar-order.overdue {
    background: #fef2f2;
    border-color: #fca5a5;
    border-left-color: #dc2626;
}


.calendar-order.material-blocked {
    background: #fef2f2;
    border: 2px solid #dc2626;
    border-left-width: 6px;
}

.calendar-order.material-blocked .calendar-progress span {
    background: linear-gradient(90deg, #ef4444, #b91c1c);
}

.calendar-order-id {
    color: #102a56;
    font-size: 14px;
    font-weight: 900;
}

.calendar-order-name {
    margin: 2px 0 6px;
    overflow: hidden;
    color: #405a78;
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-progress {
    height: 9px;
    overflow: hidden;
    background: #dbe5f1;
    border-radius: 999px;
}

.calendar-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: inherit;
}

.calendar-order.complete .calendar-progress span {
    background: linear-gradient(90deg, #22c55e, #15803d);
}

.calendar-order.overdue .calendar-progress span {
    background: linear-gradient(90deg, #ef4444, #b91c1c);
}

.calendar-progress-text {
    margin-top: 5px;
    color: #52657d;
    font-size: 10px;
    line-height: 1.25;
}

@media (max-width: 900px) {
    .wo-calendar-page {
        padding: 12px;
    }

    .wo-calendar-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .wo-calendar-controls {
        justify-content: flex-start;
    }

    .calendar-month {
        order: -1;
        width: 100%;
        text-align: left;
    }
}
