/* Routine Grid Styles — loaded via FilamentAsset to avoid Tailwind compilation issues */

.routine-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.routine-table thead tr {
    background-color: #f9fafb;
}

.dark .routine-table thead tr {
    background-color: #1f2937;
}

.routine-header-cell {
    padding: 0.75rem;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.dark .routine-header-cell {
    color: #e5e7eb;
    border-bottom-color: #374151;
}

.routine-header-cell--day {
    text-align: center;
    border-left: 1px solid #e5e7eb;
    min-width: 10rem;
}

.dark .routine-header-cell--day {
    border-left-color: #374151;
}

.routine-row {
    border-bottom: 1px solid #e5e7eb;
}

.dark .routine-row {
    border-bottom-color: #374151;
}

.routine-row:hover {
    background-color: #f9fafb;
}

.dark .routine-row:hover {
    background-color: rgba(31, 41, 55, 0.5);
}

.slot-label-cell {
    padding: 0.75rem;
    color: #4b5563;
    background-color: #f9fafb;
    border-right: 1px solid #e5e7eb;
    vertical-align: top;
}

.dark .slot-label-cell {
    color: #d1d5db;
    background-color: #1f2937;
    border-right-color: #374151;
}

.slot-label-name {
    font-weight: 500;
    font-size: 0.75rem;
}

.slot-label-time {
    font-size: 0.75rem;
    color: #9ca3af;
}

.slot-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.slot-type-badge--theory {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.slot-type-badge--lab {
    background-color: #fef3c7;
    color: #b45309;
}

.routine-cell {
    padding: 0.5rem;
    border-left: 1px solid #e5e7eb;
    vertical-align: top;
}

.dark .routine-cell {
    border-left-color: #374151;
}

.routine-cell--assigned-theory {
    border-radius: 0.5rem;
    padding: 0.5rem;
    text-align: center;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
}

.dark .routine-cell--assigned-theory {
    background-color: rgba(29, 78, 216, 0.2);
    border-color: #1d4ed8;
}

.routine-cell--assigned-lab {
    border-radius: 0.5rem;
    padding: 0.5rem;
    text-align: center;
    background-color: #fffbeb;
    border: 1px solid #fde68a;
}

.dark .routine-cell--assigned-lab {
    background-color: rgba(180, 83, 9, 0.2);
    border-color: #b45309;
}

.assigned-course-code {
    font-weight: 700;
    font-size: 0.75rem;
    color: #1f2937;
}

.dark .assigned-course-code {
    color: #e5e7eb;
}

.assigned-course-name {
    font-size: 0.75rem;
    color: #4b5563;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark .assigned-course-name {
    color: #9ca3af;
}

.assigned-teacher {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
}

.dark .assigned-teacher {
    color: #9ca3af;
}

.slot-remove-btn {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: #ef4444;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.slot-remove-btn:hover {
    color: #b91c1c;
}

.dark .slot-remove-btn {
    color: #f87171;
}

.dark .slot-remove-btn:hover {
    color: #fca5a5;
}

.slot-empty {
    font-size: 0.75rem;
    text-align: center;
    color: #9ca3af;
    padding: 0.5rem;
    font-style: italic;
}

.dark .slot-empty {
    color: #6b7280;
}

.slot-select {
    width: 100%;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: #374151;
    padding: 0.375rem 0.375rem;
    outline: none;
}

.slot-select:focus {
    box-shadow: 0 0 0 1px #f59e0b;
    border-color: #f59e0b;
}

.routine-break-cell {
    background-color: #f3f4f6;
    text-align: center;
    color: #9ca3af;
    font-size: 0.75em;
    vertical-align: middle;
}

.dark .routine-break-cell {
    background-color: rgba(31, 41, 55, 0.5);
    color: #6b7280;
}

.routine-break-header {
    background-color: #6b7280;
    min-width: 80px;
}

.dark .slot-select {
    border-color: #4b5563;
    background-color: #374151;
    color: #e5e7eb;
}

/* ── Mobile responsive ── */

.routine-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.slot-label-cell {
    position: sticky;
    left: 0;
    z-index: 1;
}

.routine-header-cell:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: #f9fafb;
}

.dark .routine-header-cell:first-child {
    background-color: #1f2937;
}

@media (max-width: 768px) {
    .routine-table {
        font-size: 0.75rem;
    }

    .routine-header-cell {
        padding: 0.5rem;
    }

    .routine-header-cell--day {
        min-width: 8rem;
    }

    .routine-cell {
        padding: 0.375rem;
    }

    .slot-label-cell {
        padding: 0.5rem;
    }

    .routine-cell--assigned-theory,
    .routine-cell--assigned-lab {
        padding: 0.375rem;
    }

    .assigned-course-code {
        font-size: 0.675rem;
    }

    .assigned-course-name {
        font-size: 0.675rem;
        max-width: 6rem;
    }

    .assigned-teacher {
        font-size: 0.675rem;
    }

    .slot-remove-btn {
        font-size: 0.675rem;
    }
}
