html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

body {
    margin-bottom: 70px;
    background-color: #f4f6f9;
    color: #212529;
}

.brand-mark {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 6px;
    background: #ffffff;
    color: #0d6efd;
    font-weight: 700;
    font-size: .8rem;
    margin-right: .25rem;
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 50px;
    background-color: #fff;
    font-size: .85rem;
}

.page-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: 1rem;
}

.page-title h1 {
    font-size: 1.5rem;
    margin: 0;
}

.page-title .subtitle {
    color: #6c757d;
    font-size: .9rem;
}

.stat-card {
    border: none;
    border-left: 4px solid #0d6efd;
    border-radius: .5rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
    height: 100%;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
}

.stat-card.warn { border-left-color: #fd7e14; }
.stat-card.good { border-left-color: #198754; }
.stat-card.bad { border-left-color: #dc3545; }
.stat-card.info { border-left-color: #0dcaf0; }

.card {
    border-radius: .5rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

/* ---------------- timetable grid ---------------- */

.timetable-scroll {
    overflow-x: auto;
}

table.timetable {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 900px;
    background: #fff;
}

table.timetable th,
table.timetable td {
    border: 1px solid #dee2e6;
    vertical-align: top;
    padding: .25rem;
    font-size: .8rem;
}

table.timetable thead th {
    background: #f8f9fa;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 2;
}

table.timetable th.period-col {
    background: #f8f9fa;
    width: 110px;
    white-space: nowrap;
}

table.timetable tr.break-row td,
table.timetable tr.break-row th {
    background: #f1f3f5;
    color: #6c757d;
    text-align: center;
    font-style: italic;
}

.lesson-card {
    border-radius: .35rem;
    padding: .25rem .35rem;
    margin-bottom: .2rem;
    background: #e7f1ff;
    border: 1px solid #b6d4fe;
    cursor: pointer;
    line-height: 1.25;
}

.lesson-card:hover {
    background: #d0e3ff;
}

.lesson-card.pinned {
    background: #fff3cd;
    border-color: #ffe69c;
}

.lesson-card.selected {
    outline: 2px solid #0d6efd;
}

.lesson-card .subject {
    font-weight: 600;
}

.lesson-card .meta {
    font-size: .72rem;
    color: #495057;
}

.slot-target {
    min-height: 38px;
}

.slot-target.drop-ready {
    background: #e9f7ef;
    outline: 2px dashed #198754;
}

.conflict-list li {
    font-size: .85rem;
}

.table-sm td, .table-sm th {
    padding: .35rem .5rem;
}

.sortable-header a {
    text-decoration: none;
    color: inherit;
}

.filter-bar {
    background: #fff;
    border-radius: .5rem;
    padding: .75rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
    margin-bottom: 1rem;
}

.badge-soft-primary { background: #e7f1ff; color: #0a58ca; }
.badge-soft-success { background: #e6f4ea; color: #146c43; }
.badge-soft-warning { background: #fff4e5; color: #b26a00; }
.badge-soft-danger { background: #fde8e8; color: #b02a37; }
.badge-soft-secondary { background: #eef0f2; color: #495057; }

.progress-thin { height: 8px; }

.nowrap { white-space: nowrap; }

.report-body table {
    width: 100%;
}

.small-muted {
    font-size: .8rem;
    color: #6c757d;
}

.availability-cell {
    text-align: center;
    font-size: .72rem;
    cursor: pointer;
}

.availability-cell.free { background: #e6f4ea; }
.availability-cell.lesson { background: #e7f1ff; }
.availability-cell.booked { background: #fde8e8; }
.availability-cell.closed { background: #eef0f2; color: #adb5bd; }
