/* Base wrapper and card */
.stm-timetable-wrapper {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 12px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.stm-timetable-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 18px 20px 20px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

/* School cards strip (SM-style) */
.stm-school-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.stm-school-card {
    flex: 0 0 220px;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    padding: 14px 16px;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    color: #0f172a;
}

.stm-school-card-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}

.stm-school-card-meta {
    font-size: 12px;
    color: #475569;
}

.stm-school-card-line + .stm-school-card-line {
    margin-top: 2px;
}

.stm-school-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
}

.stm-school-card--active {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1d4ed8;
}

.stm-school-card--active .stm-school-card-meta {
    color: #e5edff;
}

/* Filters */
.stm-timetable-filters {
    margin: 6px 0 16px;
}

.stm-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.stm-filter-group {
    display: flex;
    flex-direction: column;
    min-width: 140px;
}

.stm-filter-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    margin-bottom: 3px;
}

.stm-filter-group select,
.stm-filter-group input[type="text"],
.stm-filter-group input[type="number"] {
    border-radius: 999px;
    border: 1px solid #cbd5f5;
    padding: 6px 11px;
    font-size: 13px;
}

.stm-view-toggle {
    display: inline-flex;
    border-radius: 999px;
    padding: 2px;
    background: #e0ecff;
}

.stm-view-toggle label {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    color: #1d4ed8;
}

.stm-view-toggle input[type="radio"] {
    display: none;
}

.stm-view-toggle input[type="radio"]:checked + span {
    background: #1d4ed8;
    color: #ffffff;
    border-radius: 999px;
    padding: 2px 8px;
}

.stm-filter-submit button {
    border-radius: 999px;
    border: none;
    padding: 7px 16px;
    font-size: 13px;
    background: #1d4ed8;
    color: #ffffff;
    cursor: pointer;
}

/* Header + table */

.stm-timetable-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0 8px;
}

.stm-timetable-header-bar h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.stm-timetable-legend {
    display: inline-flex;
    gap: 8px;
    font-size: 11px;
    color: #64748b;
}

.stm-timetable-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
}

.stm-timetable-table-wrapper {
    overflow-x: auto;
}

.stm-timetable-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.stm-timetable-table thead th {
    background: #e0ecff;
    color: #1e293b;
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid #cbd5f5;
}

.stm-timetable-table tbody th.stm-timetable-day {
    background: #f1f5f9;
    font-weight: 600;
    text-align: left;
    padding: 6px 8px;
    white-space: nowrap;
}

.stm-timetable-table tbody td {
    min-width: 120px;
    border-bottom: 1px solid #e2e8f0;
    border-left: 1px solid #e2e8f0;
    padding: 5px 6px;
    vertical-align: top;
}

.stm-timetable-table tbody td.stm-timetable-slot:hover {
    background: #f1f5f9;
}

/* Slot contents */
.stm-slot-subject {
    font-weight: 700;
    margin-bottom: 2px;
}

.stm-slot-teacher,
.stm-slot-class,
.stm-slot-room,
.stm-slot-time {
    font-size: 11px;
    color: #4b5563;
}

.stm-slot-room {
    font-style: italic;
}

.stm-slot-time {
    margin-top: 2px;
}

/* Empty cell */
.stm-slot-empty {
    text-align: center;
    color: #cbd5f5;
    font-size: 11px;
}

/* Error message */
.stm-timetable-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 12px;
    padding: 10px 12px;
    margin: 10px 0;
}
