.shift-assignment-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: #f7f8fc;
}

.card {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.08);
}

.header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    align-items: center;
}

.title-area {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    justify-content: center;
}

.eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2563eb;
}

.title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
}

.month-row {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 36px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.toggle-buttons {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.month-row .title,
.month-row div {
    font-size: 1rem;
    font-weight: 700;
}

.month-row .rz-button {
    border-radius: 8px;
    background: #eef2ff;
    color: #1f2937;
}

.week-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.5rem;
    border-radius: 12px;
    background: #eef2ff;
    min-height: 36px;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-actions .rz-button {
    border-radius: 8px;
    background: #eef2ff;
    color: #1f2937;
}

.auto-plan-result {
    padding: 1rem;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.result-title {
    font-weight: 700;
    font-size: 1rem;
}

.result-sub {
    color: #475569;
    font-size: 0.9rem;
}

.plan-detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.shift-grid {
    padding: 0.25rem;
    border-radius: 0;
}

.grid-scroll {
    overflow-x: auto;
}

.shift-grid .jans-table {
    min-width: 0;
    color: #0f172a;
}

.shift-grid .jans-table-row {
    align-items: stretch;
}

.shift-grid .jans-table-cell {
    border-radius: 0;
    padding: 0.35rem 0.25rem;
    min-height: 2.2rem;
}

.shift-grid .jans-table-header .jans-table-cell {
    position: sticky;
    top: 0;
    background: #f8fafc;
    backdrop-filter: blur(4px);
    z-index: 2;
    font-weight: 700;
    text-transform: none;
}

.shift-grid[data-mode="week"] .day-col {
    display: none;
}

.assignment-legend {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #1f2937;
    font-size: 0.9rem;
    white-space: nowrap;
}

.legend-swatch {
    width: 16px;
    height: 12px;
    border-radius: 4px;
    display: inline-flex;
    border: 1px solid #e5e7eb;
}

.today-swatch {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.02));
    border-color: #cbd5f5;
}

.selection-swatch {
    background: #dbeafe;
    border-color: #2563eb;
}

.weekend-swatch {
    background: #f8fafc;
    border-color: #e5e7eb;
}

.holiday-swatch {
    background: #fde68a;
    border-color: #f59e0b;
}

.closed-swatch {
    background: #0f172a;
    border-color: #0f172a;
}

.shift-grid[data-mode="week"][data-week="0"] .week-0,
.shift-grid[data-mode="week"][data-week="1"] .week-1,
.shift-grid[data-mode="week"][data-week="2"] .week-2,
.shift-grid[data-mode="week"][data-week="3"] .week-3,
.shift-grid[data-mode="week"][data-week="4"] .week-4,
.shift-grid[data-mode="week"][data-week="5"] .week-5,
.shift-grid[data-mode="week"][data-week="6"] .week-6 {
    display: flex;
}

.employee-col {
    flex: 0 0 140px;
    min-width: 120px;
    background: #f8fafc;
    font-weight: 600;
    color: #0f172a;
}

.day-col {
    cursor: default;
    min-width: 0;
    flex: 1 1 0;
}

.day-col.hovered-day {
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #93c5fd;
}

.day-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
}

.day-number {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.day-name {
    font-size: 0.75rem;
    color: #475569;
}

.day-month {
    display: none;
}

.day-col.weekend {
    background: #f8fafc;
    color: #1f2937;
}

.day-col.today {
    outline: 1px solid #cbd5f5;
    outline-offset: -1px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.02));
}

.day-col.holiday {
    background: #fffbeb;
    color: #92400e;
}

.day-col.closed-day {
    background: #0f172a;
    color: #e2e8f0;
}

.shift-assignment-table .jans-table-header-cell {
    padding: 0.4rem 0.5rem;
    text-transform: none;
    letter-spacing: 0;
    cursor: default;
}

.shift-assignment-table .jans-table-cell {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.shift-assignment-table .jans-table-row .day-col {
    padding: 0;
}

.shift-cell {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 1.6rem;
    align-items: center;
    justify-content: center;
    font-family: "Segoe UI", "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

.shift-fill {
    width: 100%;
    height: 100%;
    min-height: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
}

.shift-initial {
    font-weight: 800;
}

.shift-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.35rem;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
    width: auto;
    color: #ffffff;
}

.shift-pill .pill-label {
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    font-family: "Segoe UI", "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

.selected-cell {
    outline: 3px solid #2563eb;
    outline-offset: -3px;
}


.closed-slot {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.employee-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auto-plan-badge {
    margin-right: 0.5rem;
}

.auto-plan-badge:last-child {
    margin-right: 0;
}

.auto-plan-badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.auto-plan-status {
    background: #e0f2fe;
    color: #0369a1;
}

@media (max-width: 1200px) {
    .header {
        grid-template-columns: 1fr;
    }

    .header-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 1080px) {
    .employee-col {
        position: sticky;
        left: 0;
        z-index: 3;
    }

    .month-row {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    .month-row .title {
        width: 100%;
        text-align: center;
        font-size: 1.1rem;
    }
}

@media (max-width: 720px) {
    .shift-assignment-page {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .title {
        font-size: 1.2rem;
    }

    .action-buttons {
        width: 100%;
    }
}
