/* css/schedule.css */

/* ========== Сетка расписания ========== */
#schedule-week-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--color-white);
}

.schedule-table {
    display: grid;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: var(--color-white);
    table-layout: fixed; /* фиксированная ширина колонок */
}

/* ========== Заголовки дней ========== */
.schedule-day-header {
    padding: 6px 1px;
    text-align: center;
    background: var(--color-white);
    border-bottom: 2px solid #E0E0E0;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    position: sticky;
    top: 0;
    z-index: 2;
    min-width: 0;
    overflow: hidden;
    line-height: 1;
}

.schedule-day-header .day-name {
    font-family: 'Play', sans-serif;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    color: #999;
    line-height: 1;
}

.schedule-day-header .day-date {
    font-family: 'Play', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #1A1A1A;
    line-height: 1;
}

.schedule-day-header .day-month {
    font-family: 'Play', sans-serif;
    font-size: 7px;
    font-weight: 400;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    line-height: 1;
}

.schedule-day-header.today {
    background: #FFF5F5;
}

.schedule-day-header.today .day-date {
    color: var(--color-dynamic-red);
}

/* ========== Ячейки ========== */
.schedule-cell {
    border-bottom: 1px solid #F0F0F0;
    border-right: 1px solid #F0F0F0;
    min-height: 48px;
    cursor: pointer;
    transition: background 0.1s ease;
    position: relative;
    padding: 2px;
    min-width: 0; /* разрешаем сжатие */
    overflow: hidden; /* обрезаем содержимое */
}

.schedule-cell:hover {
    background: #FAFAFA;
}

/* Пустая ячейка — время по центру */
.schedule-cell.empty {
    background: #FAFAFA;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-cell.empty .cell-time {
    font-family: 'Play', 'SF Pro Display', -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #CCC;
}

/* Занятая ячейка */
.schedule-cell.has-invoice {
    background: var(--color-white);
    border-left: 3px solid transparent;
}

.schedule-cell.has-invoice.paid {
    border-left-color: var(--color-ocean-blue);
}

.schedule-cell.has-invoice.unpaid {
    border-left-color: var(--color-dynamic-red);
}

/* Содержимое занятой ячейки */
.schedule-cell .cell-content {
    padding: 2px 2px 2px 3px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    min-width: 0;
}

.schedule-cell .cell-content .cell-car {
    font-family: 'Play', 'SF Pro Display', -apple-system, sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: #1A1A1A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.schedule-cell .cell-content .cell-client {
    font-size: 8px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.schedule-cell .cell-content .cell-sum {
    font-family: 'Play', 'SF Pro Display', -apple-system, sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: #1A1A1A;
    margin-top: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== Режим дня ========== */
#day-invoices-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.day-invoice-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #F0F0F0;
    cursor: pointer;
    transition: background 0.1s ease;
    gap: 8px;
    flex-wrap: wrap;
}

.day-invoice-item:hover {
    background: #FAFAFA;
}

.day-invoice-item:active {
    background: #F0F0F0;
}

.day-invoice-main {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 10px;
    min-width: 0;
}

.day-invoice-time {
    font-family: 'Play', 'SF Pro Display', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #1A1A1A;
    min-width: 40px;
}

.day-invoice-client {
    flex: 1;
    font-size: 14px;
    color: #1A1A1A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-invoice-sum {
    font-family: 'Play', 'SF Pro Display', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1A1A1A;
    white-space: nowrap;
}

.day-invoice-rm {
    width: 100%;
    font-size: 11px;
    color: #888;
    padding-left: 50px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-invoice-sync {
    font-size: 12px;
    opacity: 0.6;
}
