/* Scheduler Styles */
.scheduler-container {
    width: 95%;
    max-width: 1200px;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    height: 90vh;
}

.scheduler-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.scheduler-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scheduler-header-buttons {
    display: flex;
    gap: 5px;
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.3rem;
    font-weight: bold;
}

.btn-today {
    padding: 4px 12px;
    border: 1px solid var(--primary-color);
    border-radius: 15px;
    background: white;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
}

.btn-today:hover {
    background: var(--primary-color);
    color: white;
}

.scheduler-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.settlement-display {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
}

.settlement-item {
    cursor: pointer;
    padding: 4px 10px;
    background: #e8f5e9;
    border-radius: 8px;
    color: #2e7d32;
}

.nav-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

.scheduler-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: auto 1fr;
    gap: 1px;
    background: #eee;
    border: 1px solid #ddd;
    overflow: hidden;
}

.day-header {
    background: #f8f9fa;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
}

.day-header.sun {
    color: #e03131;
}

.day-header.sat {
    color: #2f9e44;
}

.day-column {
    background: white;
    display: flex;
    flex-direction: column;
    padding: 5px;
    overflow-y: auto;
    position: relative;
}

.date-area {
    flex-shrink: 0;
}

.date-label {
    text-align: center;
    font-weight: bold;
    padding: 5px;
    border-radius: 10px;
}

.today .date-label {
    background: var(--primary-color);
    color: white;
}

.holiday-label {
    font-size: 0.8rem;
    color: #e03131;
    text-align: center;
    min-height: 1.2em;
    line-height: 1.2em;
    margin: 4px 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tasks */
.task-item {
    background: #f1f3f5;
    margin-bottom: 4px;
    padding: 4px 5px;
    border-radius: 5px;
    font-size: 0.8rem;
}

.task-item.done {
    background: #e6fcf5;
}

.task-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}

.task-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-item.done .task-name {
    text-decoration: line-through;
    color: #888;
}

.task-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.btn-micro {
    width: 20px;
    height: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #666;
}

.btn-micro:hover {
    background: #eee;
}

.qty-val {
    min-width: 16px;
    text-align: center;
    font-weight: bold;
    font-size: 0.8rem;
}

/* ============================================================
   Mobile Responsive Scheduler
   ============================================================ */
@media (max-width: 768px) {
    .scheduler-container {
        width: 100%;
        height: 100dvh;
        /* Use dynamic viewport height for mobile */
        border-radius: 0;
        padding: 5px;
    }

    .scheduler-header-top {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }

    .scheduler-header-buttons {
        width: 100%;
        justify-content: flex-end;
        order: -1;
        /* Move buttons to top */
    }

    .month-nav {
        width: 100%;
        justify-content: space-between;
        font-size: 1.1rem;
    }

    .child-tabs.scheduler-tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
        width: 100%;
        justify-content: flex-start;
    }

    .tab-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    .scheduler-summary-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        font-size: 0.8rem;
    }

    .scheduler-grid {
        /* On very small screens, 7 columns might be too tight. 
           We keep it but reduce padding/font-size */
        font-size: 0.75rem;
    }

    .day-header {
        padding: 5px 2px;
        font-size: 0.75rem;
    }

    .day-column {
        padding: 1px;
    }

    .date-label {
        font-size: 0.75rem;
        padding: 2px;
        border-radius: 5px;
    }

    .holiday-label {
        font-size: 0.65rem;
        margin: 2px 0 2px;
    }

    .task-item {
        padding: 2px;
        font-size: 0.7rem;
        margin-bottom: 2px;
        border-radius: 3px;
    }

    .task-qty-ctrl {
        gap: 1px;
    }

    .btn-micro {
        width: 14px;
        height: 14px;
        font-size: 0.5rem;
    }

    .qty-val {
        min-width: 10px;
        font-size: 0.65rem;
    }
}