.select2-container {
    box-sizing: border-box;
    display: inline-block;
    margin: 0;
    position: relative;
    vertical-align: middle
}

.modal-sidebar .filter__select,
.modal-sidebar .filter-item,
.modal-sidebar .filter-item label {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.modal-sidebar .filter__select {
    width: 100%;
}

.select2-container .select2-selection--single {
    box-sizing: border-box;
    cursor: pointer;
    display: block;
    height: 28px;
    user-select: none;
    -webkit-user-select: none
}

.select2-container .select2-selection--single .select2-selection__rendered {
    display: block;
    padding-left: 8px;
    padding-right: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.select2-container .select2-selection--single .select2-selection__clear {
    background-color: #fff0;
    border: none;
    font-size: 1em
}

.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
    padding-right: 8px;
    padding-left: 20px
}

.select2-container .select2-selection--multiple {
    box-sizing: border-box;
    cursor: pointer;
    display: block;
    min-height: 32px;
    user-select: none;
    -webkit-user-select: none
}

.select2-container .select2-selection--multiple .select2-selection__rendered {
    display: inline;
    list-style: none;
    padding: 0
}

.select2-container .select2-selection--multiple .select2-selection__clear {
    background-color: #fff0;
    border: none;
    font-size: 1em
}

.select2-container .select2-search--inline .select2-search__field {
    box-sizing: border-box;
    border: none;
    font-size: 100%;
    margin-top: 5px;
    margin-left: 5px;
    padding: 0;
    max-width: 100%;
    resize: none;
    height: 18px;
    vertical-align: bottom;
    font-family: sans-serif;
    overflow: hidden;
    word-break: keep-all
}

.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
    -webkit-appearance: none
}

.select2-dropdown {
    background-color: #fff;
    border: 1px solid #aaa;
    border-radius: 4px;
    box-sizing: border-box;
    display: block;
    position: absolute;
    left: -100000px;
    width: 100%;
    z-index: 1051
}

.select2-results {
    display: block
}

.select2-results__options {
    list-style: none;
    margin: 0;
    padding: 0
}

.select2-results__option {
    padding: 6px;
    user-select: none;
    -webkit-user-select: none
}

.select2-results__option--selectable {
    cursor: pointer
}

.select2-container--open .select2-dropdown {
    left: 0
}

.select2-container--open .select2-dropdown--above {
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0
}

.select2-container--open .select2-dropdown--below {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0
}

.select2-search--dropdown {
    display: block;
    padding: 4px
}

.select2-search--dropdown .select2-search__field {
    padding: 4px;
    width: 100%;
    box-sizing: border-box
}

.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
    -webkit-appearance: none
}

.select2-search--dropdown.select2-search--hide {
    display: none
}

.select2-close-mask {
    border: 0;
    margin: 0;
    padding: 0;
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    min-height: 100%;
    min-width: 100%;
    height: auto;
    width: auto;
    opacity: 0;
    z-index: 99;
    background-color: #fff;
    filter: alpha(opacity=0)
}

.select2-hidden-accessible {
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    -webkit-clip-path: inset(50%) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    width: 1px !important;
    white-space: nowrap !important
}

.select2-container--default .select2-selection--single {
    background-color: #fff;
    border: 1px solid #aaa;
    border-radius: 4px
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #444;
    line-height: 28px
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    cursor: pointer;
    float: right;
    font-weight: 700;
    height: 26px;
    margin-right: 20px;
    padding-right: 0
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #999
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 26px;
    position: absolute;
    top: 1px;
    right: 1px;
    width: 20px
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #888 #fff0 #fff0;
    border-style: solid;
    border-width: 5px 4px 0;
    height: 0;
    left: 50%;
    margin-left: -4px;
    margin-top: -2px;
    position: absolute;
    top: 50%;
    width: 0
}

.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
    float: left
}

.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
    left: 1px;
    right: auto
}

.select2-container--default.select2-container--disabled .select2-selection--single {
    background-color: #eee;
    cursor: default
}

.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
    display: none
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: #fff0 #fff0 #888;
    border-width: 0 4px 5px
}

.select2-container--default .select2-selection--multiple {
    background-color: #fff;
    border: 1px solid #aaa;
    border-radius: 4px;
    cursor: text;
    padding-bottom: 5px;
    padding-right: 5px;
    position: relative
}

.select2-container--default .select2-selection--multiple.select2-selection--clearable {
    padding-right: 25px
}

.select2-container--default .select2-selection--multiple .select2-selection__clear {
    cursor: pointer;
    font-weight: 700;
    height: 20px;
    margin-right: 10px;
    margin-top: 5px;
    position: absolute;
    right: 0;
    padding: 1px
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #e4e4e4;
    border: 1px solid #aaa;
    border-radius: 4px;
    box-sizing: border-box;
    display: inline-block;
    margin-left: 5px;
    margin-top: 5px;
    padding: 0;
    padding-left: 20px;
    position: relative;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__display {
    cursor: default;
    padding-left: 2px;
    padding-right: 5px
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    background-color: #fff0;
    border: none;
    border-right: 1px solid #aaa;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    color: #999;
    cursor: pointer;
    font-size: 1em;
    font-weight: 700;
    padding: 0 4px;
    position: absolute;
    left: 0;
    top: 0
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:focus {
    background-color: #f1f1f1;
    color: #333;
    outline: none
}

.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
    margin-left: 5px;
    margin-right: auto
}

.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__display {
    padding-left: 5px;
    padding-right: 2px
}

.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
    border-left: 1px solid #aaa;
    border-right: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px
}

.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__clear {
    float: left;
    margin-left: 10px;
    margin-right: auto
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border: solid #000 1px;
    outline: 0
}

.select2-container--default.select2-container--disabled .select2-selection--multiple {
    background-color: #eee;
    cursor: default
}

.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
    display: none
}

.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,
.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
    border-top-left-radius: 0;
    border-top-right-radius: 0
}

.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,
.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #aaa
}

.select2-container--default .select2-search--inline .select2-search__field {
    background: #fff0;
    border: none;
    outline: 0;
    box-shadow: none;
    -webkit-appearance: textfield
}

.select2-container--default .select2-results>.select2-results__options {
    max-height: 200px;
    overflow-y: auto
}

.select2-container--default .select2-results__option .select2-results__option {
    padding-left: 1em
}

.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
    padding-left: 0
}

.select2-container--default .select2-results__option .select2-results__option .select2-results__option {
    margin-left: -1em;
    padding-left: 2em
}

.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
    margin-left: -2em;
    padding-left: 3em
}

.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
    margin-left: -3em;
    padding-left: 4em
}

.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
    margin-left: -4em;
    padding-left: 5em
}

.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
    margin-left: -5em;
    padding-left: 6em
}

.select2-container--default .select2-results__option--group {
    padding: 0
}

.select2-container--default .select2-results__option--disabled {
    color: #999
}

.select2-container--default .select2-results__option--selected {
    background-color: #ddd
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #5897fb;
    color: #fff
}

.select2-container--default .select2-results__group {
    cursor: default;
    display: block;
    padding: 6px
}

.select2-container--classic .select2-selection--single {
    background-color: #f7f7f7;
    border: 1px solid #aaa;
    border-radius: 4px;
    outline: 0;
    background-image: -webkit-linear-gradient(top, #fff 50%, #eee 100%);
    background-image: -o-linear-gradient(top, #fff 50%, #eee 100%);
    background-image: linear-gradient(to bottom, #fff 50%, #eee 100%);
    background-repeat: repeat-x;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)
}

.select2-container--classic .select2-selection--single:focus {
    border: 1px solid #5897fb
}

.select2-container--classic .select2-selection--single .select2-selection__rendered {
    color: #444;
    line-height: 28px
}

.select2-container--classic .select2-selection--single .select2-selection__clear {
    cursor: pointer;
    float: right;
    font-weight: 700;
    height: 26px;
    margin-right: 20px
}

.select2-container--classic .select2-selection--single .select2-selection__placeholder {
    color: #999
}

.select2-container--classic .select2-selection--single .select2-selection__arrow {
    background-color: #ddd;
    border: none;
    border-left: 1px solid #aaa;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    height: 26px;
    position: absolute;
    top: 1px;
    right: 1px;
    width: 20px;
    background-image: -webkit-linear-gradient(top, #eee 50%, #ccc 100%);
    background-image: -o-linear-gradient(top, #eee 50%, #ccc 100%);
    background-image: linear-gradient(to bottom, #eee 50%, #ccc 100%);
    background-repeat: repeat-x;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)
}

.select2-container--classic .select2-selection--single .select2-selection__arrow b {
    border-color: #888 #fff0 #fff0;
    border-style: solid;
    border-width: 5px 4px 0;
    height: 0;
    left: 50%;
    margin-left: -4px;
    margin-top: -2px;
    position: absolute;
    top: 50%;
    width: 0
}

.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
    float: left
}

.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
    border: none;
    border-right: 1px solid #aaa;
    border-radius: 0;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    left: 1px;
    right: auto
}

.select2-container--classic.select2-container--open .select2-selection--single {
    border: 1px solid #5897fb
}

.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
    background: #fff0;
    border: none
}

.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: #fff0 #fff0 #888;
    border-width: 0 4px 5px
}

.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    background-image: -webkit-linear-gradient(top, #fff 0%, #eee 50%);
    background-image: -o-linear-gradient(top, #fff 0%, #eee 50%);
    background-image: linear-gradient(to bottom, #fff 0%, #eee 50%);
    background-repeat: repeat-x;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)
}

.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background-image: -webkit-linear-gradient(top, #eee 50%, #fff 100%);
    background-image: -o-linear-gradient(top, #eee 50%, #fff 100%);
    background-image: linear-gradient(to bottom, #eee 50%, #fff 100%);
    background-repeat: repeat-x;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)
}

.select2-container--classic .select2-selection--multiple {
    background-color: #fff;
    border: 1px solid #aaa;
    border-radius: 4px;
    cursor: text;
    outline: 0;
    padding-bottom: 5px;
    padding-right: 5px
}

.select2-container--classic .select2-selection--multiple:focus {
    border: 1px solid #5897fb
}

.select2-container--classic .select2-selection--multiple .select2-selection__clear {
    display: none
}

.select2-container--classic .select2-selection--multiple .select2-selection__choice {
    background-color: #e4e4e4;
    border: 1px solid #aaa;
    border-radius: 4px;
    display: inline-block;
    margin-left: 5px;
    margin-top: 5px;
    padding: 0
}

.select2-container--classic .select2-selection--multiple .select2-selection__choice__display {
    cursor: default;
    padding-left: 2px;
    padding-right: 5px
}

.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
    background-color: #fff0;
    border: none;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    color: #888;
    cursor: pointer;
    font-size: 1em;
    font-weight: 700;
    padding: 0 4px
}

.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #555;
    outline: none
}

.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
    margin-left: 5px;
    margin-right: auto
}

.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__display {
    padding-left: 5px;
    padding-right: 2px
}

.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px
}

.select2-container--classic.select2-container--open .select2-selection--multiple {
    border: 1px solid #5897fb
}

.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0
}

.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0
}

.select2-container--classic .select2-search--dropdown .select2-search__field {
    border: 1px solid #aaa;
    outline: 0
}

.select2-container--classic .select2-search--inline .select2-search__field {
    outline: 0;
    box-shadow: none
}

.select2-container--classic .select2-dropdown {
    background-color: #fff;
    border: 1px solid #fff0
}

.select2-container--classic .select2-dropdown--above {
    border-bottom: none
}

.select2-container--classic .select2-dropdown--below {
    border-top: none
}

.select2-container--classic .select2-results>.select2-results__options {
    max-height: 200px;
    overflow-y: auto
}

.select2-container--classic .select2-results__option--group {
    padding: 0
}

.select2-container--classic .select2-results__option--disabled {
    color: grey
}

.select2-container--classic .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #3875d7;
    color: #fff
}

.select2-container--classic .select2-results__group {
    cursor: default;
    display: block;
    padding: 6px
}

.select2-container--classic.select2-container--open .select2-dropdown {
    border-color: #5897fb
}

:root {
    --primary-blue: #004a99;
    --bg-light: #f4f7f6;
    --border-color: #dee2e6;
    --text-main: #333;
    --text-muted: #666;
    --slot-height: 50px;
    --header-height: 70px
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

html,
body {
    position: relative;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100%
}

html {
    position: relative
}

.main-header {
    background: #fff;
    height: var(--header-height);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgb(0 0 0 / .1);
    display: flex;
    align-items: center
}

.header-container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px
}

.header-logo img {
    height: 45px;
    cursor: pointer;
    width: auto;
    display: block
}

.header-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0;
    line-height: 1.2
}

.header-subtitle {
    font-size: .85rem;
    color: #666;
    display: block
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: left
}

.header-datetime {
    padding: 6px 15px;
    border-radius: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2d2c2c;
    font-size: .8rem;
    background: #fff;
    border: 1px solid var(--primary-blue);
    margin-left: 10px
}

.header-right {
    display: flex;
    align-items: center;
    gap: 5px
}

.btn-header {
    background: #fff;
    border: 1px solid #fcc;
    color: #333;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all .2s
}

.btn-header:hover {
    background-color: #fff5f5
}

.btn-mess {
    display: flex;
    align-items: center;
    border: 1px solid gray;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
    transition: all .3s ease;
    height: 35px;
    width: 35px;
    justify-content: center;
    align-items: center;
    color: var(--primary-blue)
}

.btn-mess:hover {
    box-shadow: 0 4px 8px rgb(0 66 153 / .2)
}

.btn-theme {
    box-shadow: 0 4px 8px rgb(0 66 153 / .2)
}

.icon-heart {
    width: 16px;
    height: 16px;
    fill: #ff4d4d
}

.icon-sun {
    width: 18px;
    height: 18px;
    stroke: #ff4d4d;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

.header-spacer {
    height: calc(var(--header-height) + 20px);
    width: 100%
}

.ctn {
    width: 95%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    padding-bottom: 30px
}

.section-box {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgb(0 0 0 / .02);
    animation: fadeIn .3s ease-in-out
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase
}

.data-import-section {
    text-align: center;
    padding: 1rem 1.5rem
}

.data-status {
    margin-bottom: 8px;
    font-size: .95rem
}

.data-status__badge {
    display: inline-block;
    background: #f1f3f5;
    padding: 4px 15px;
    border-radius: 20px;
    font-weight: 700;
    color: var(--primary-blue);
    border: 1px solid var(--border-color)
}

.data-warning {
    color: #dc3545;
    font-size: .85rem;
    margin-bottom: 12px;
    font-style: italic
}

.data-warning a {
    color: var(--primary-blue);
    text-decoration: underline;
    font-weight: 700
}

.import-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px
}

.upload-area {
    border: 2px dashed #007bff;
    border-radius: 8px;
    padding: 15px 20px;
    background-color: #f8fbff;
    color: #555;
    font-size: .95rem;
    cursor: pointer;
    transition: all .3s;
    margin-bottom: 12px
}

.upload-area:hover {
    background-color: #eef5ff;
    border-color: #0056b3
}

.model-switch {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px
}

.model-btn {
    padding: 10px 25px;
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid var(--primary-blue);
    background: #fff;
    color: var(--primary-blue);
    border-radius: 30px;
    cursor: pointer;
    transition: all .3s ease;
    display: flex;
    align-items: center;
    gap: 8px
}

.model-btn.active {
    background: var(--primary-blue);
    color: #fff;
    box-shadow: 0 4px 10px rgb(0 74 153 / .3)
}

.model-btn:hover:not(.active) {
    background: #e7f3ff
}

.btn-sync {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    background-color: #adb5bd;
    transition: .3s
}

.btn-sync.active {
    background-color: var(--primary-blue);
    cursor: pointer
}

.btn-sync.active:hover {
    background-color: #003a7a
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    cursor: pointer;
    border: 3px solid rgb(19 18 18 / .05);
    border-radius: 16px;
    background-color: #fff;
    font-weight: 500;
    transition: .2s
}

.btn-outline:hover {
    background: #e9ecef
}

.btn-outline svg {
    width: 18px;
    height: 18px;
    color: #888
}

.btn-primary {
    padding: .6rem 1rem;
    cursor: pointer;
    border: 1px solid var(--primary-blue);
    border-radius: 4px;
    background: var(--primary-blue);
    color: #fff;
    font-weight: 700;
    transition: .2s;
    height: 38px
}

.btn-primary:hover {
    background: #003a7a
}

.btn-delete {
    background-color: #fff;
    border: 1px solid #fcc;
    color: #dc3545;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto
}

.btn-delete:hover {
    background-color: #dc3545;
    color: #fff;
    border-color: #dc3545
}

.generate-btn-wrapper {
    margin-top: 15px;
    text-align: right
}

.btn-generate {
    background-color: #198754;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 2px 4px rgb(25 135 84 / .2)
}

.btn-generate:hover {
    background-color: #157347;
    box-shadow: 0 4px 6px rgb(25 135 84 / .3);
    transform: translateY(-1px)
}

.filter__acction {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-end;
    overflow: visible
}

.filter__group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: .5rem
}

.filter__group:has(#comBoxNhomTuDong) {
    min-width: 150px !important
}

.filter__label {
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-muted)
}

.filter__select {
    padding: .6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    outline: none
}

.select2-container .select2-selection--single {
    height: 34px !important;
    font-size: .85rem !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    display: flex;
    align-items: center;
    opacity: 1 !important;
    background-color: #fff !important
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 32px !important
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 32px !important
}

.select2-results__option {
    font-size: .85rem !important
}

.select2-container--default .select2-selection--clear {
    margin-right: 10px;
    font-size: 2rem
}

.select2-selection__clear {
    display: flex;
    align-items: center;
    padding: 1rem
}

.select2-container--default .select2-selection--multiple {
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    min-height: 38px !important;
    padding: 2px 5px
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #e7f3ff;
    border: 1px solid #b3d7ff;
    color: var(--primary-blue);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: .8rem;
    margin-top: 5px
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--primary-blue);
    margin-right: 5px
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #dc3545
}

.select2-selection__rendered[title="-- Chọn môn học --"],
.select2-selection__rendered[title="-- Bất kỳ giảng viên nào --"],
.select2-selection__rendered[title="-- Bất kỳ --"] {
    color: #302f2f !important
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #302f2f !important
}

.select2-results__option:contains("-- Bất kỳ") {
    color: #302f2f !important
}

#comboxTenGvTuDong,
#comBoxNhomTuDong {
    cursor: pointer
}

#comBoxNhomTuDong {
    min-width: 150px !important
}

#comBoxNhomTuDong:focus {
    z-index: 150
}

.table-wrapper {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow-x: auto
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 900px
}

th,
td {
    border: 1px solid var(--border-color);
    padding: 10px;
    text-align: center
}

th {
    background: #f8f9fa;
    font-size: .8rem;
    color: var(--text-muted);
    text-transform: uppercase
}

.text-left {
    text-align: left !important;
    padding-left: 15px !important
}

.timetable-area {
    display: flex;
    flex-direction: column
}

.tabs-container {
    display: flex;
    width: 100%;
    overflow-x: auto;
    align-items: flex-end;
    gap: 10px;
    border-bottom: 3px solid var(--primary-blue);
    margin-bottom: -1px;
    position: relative;
    z-index: 2
}

.tab-item {
    background-color: #e9ecef;
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all .2s
}

.tab-item--active {
    background-color: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue)
}

.close-tab {
    font-size: 1.2rem;
    line-height: .5;
    opacity: .6;
    border-radius: 50%;
    padding: 2px
}

.close-tab:hover {
    opacity: 1;
    color: #fcc;
    background-color: rgb(255 255 255 / .2)
}

.tab-add {
    background: #fff0;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-blue);
    cursor: pointer;
    padding: 5px 15px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s
}

.tab-add:hover {
    background-color: #e7f3ff
}

.timetable-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 0 8px 8px 8px;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1
}

.timetable-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem
}

.timetable-section__title {
    font-size: 1.1rem;
    font-weight: 700
}

.timetable-section__badge {
    background: #f1f3f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: .75rem;
    margin-left: 5px;
    border: 1px solid #e9ecef
}

.timetable-section__actions {
    display: flex;
    justify-content: space-between !important
}

.timetable-section__actions button {
    height: 32px;
    width: 30px;
}

.week-selector {
    width: 50%;
    color: #333
}

.modal-body .week-selector {
    width: 100% !important;
}


.action-btn {
    padding: 6px 10px;
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: .2s
}

.action-btn:hover {
    background: #f8f9fa
}

.timetable__period {
    font-weight: 700;
    background: #f8f9fa;
    width: 60px
}

.timetable__time {
    font-size: .75rem;
    color: var(--text-muted);
    width: 110px
}

.timetable-container td {
    height: var(--slot-height);
    padding: 0;
    position: relative
}

.class-block {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 5px;
    right: 5px;
    background-color: var(--bg-color, #f0f7ff);
    border-left: 4px solid var(--main-color, #0d6efd);
    border-radius: 6px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 1px 3px rgb(0 0 0 / .05);
    overflow: hidden;
    z-index: 10
}

.class-block__name {
    color: #004a99;
    font-weight: 700;
    font-size: .75rem;
    margin-bottom: 4px;
    line-height: 1.2
}

.class-block__info {
    font-size: .7rem;
    color: #555;
    line-height: 1.3
}

.blue {
    --main-color: #007bff;
    --bg-color: #f0f7ff
}

.red {
    --main-color: #dc3545;
    --bg-color: #fff5f5
}

.green {
    --main-color: #28a745;
    --bg-color: #f6fff8
}

.purple {
    --main-color: #6f42c1;
    --bg-color: #f8f5ff
}

.orange {
    --main-color: #fd7e14;
    --bg-color: #fffaf5
}

.yellow {
    --main-color: #ffc107;
    --bg-color: #fffdf5
}

.teal {
    --main-color: #20c997;
    --bg-color: #f5fffc
}

.pink {
    --main-color: #e83e8c;
    --bg-color: #fff5f9
}

.indigo {
    --main-color: #6610f2;
    --bg-color: #f7f5ff
}

.brown {
    --main-color: #795548;
    --bg-color: #faf7f6
}

.slate {
    --main-color: #708090;
    --bg-color: #f8f9fa
}

.timetable-section__datetime {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 6px 16px;
    border-radius: 8px;
    font-family: 'Segoe UI', sans-serif;
    color: #555
}

.datetime-range {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .85rem;
    font-weight: 500
}

.datetime-range svg {
    width: 14px;
    height: 14px;
    stroke: #888;
    margin-right: 2px
}

.datetime-separator {
    color: #ccc;
    font-weight: 300
}

.week-badge {
    margin-left: 15px;
    font-weight: 700;
    font-size: .85rem;
    color: var(--primary-blue);
    position: relative;
    padding-left: 15px
}

.week-badge::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #ccc
}

.total-row {
    background-color: #f8f9fa
}

.fw-bold {
    font-weight: 700
}

.sec-auto__result {
    margin-top: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #e7f3ff 0%, #fff 100%);
    border-left: 5px solid var(--primary-blue);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgb(0 0 0 / .05);
    color: #444;
    font-size: .85rem;
    line-height: 1.6;
    display: none;
    animation: slideIn .4s ease-out
}

.sec-auto__result span {
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: underline
}

.sec-auto__result button {
    margin-left: 10px;
    padding: 6px 12px;
    background-color: var(--primary-blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    transition: all .3s ease;
    box-shadow: 0 4px 6px rgb(0 74 153 / .2);
    display: inline-flex;
    align-items: center
}

.sec-auto__result button:hover {
    background-color: #003a7a;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgb(0 74 153 / .3)
}

.sec-auto__no-result {
    display: none;
    margin-top: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fff0f0 0%, #fff 100%);
    border-left: 5px solid #dc3545;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgb(0 0 0 / .05);
    color: #444;
    font-size: .85rem;
    line-height: 1.6;
    animation: slideIn .4s ease-out forwards
}

#sec-auto,
#sec-manual {
    font-size: .9rem
}

#sec-auto .section-title,
#sec-manual .section-title {
    font-size: .95rem
}

#sec-auto table th,
#sec-auto table td,
#sec-manual table th,
#sec-manual table td {
    font-size: .85rem
}

#sec-auto .btn-primary,
#sec-auto .btn-outline,
#sec-auto .btn-generate,
#sec-manual .btn-primary,
#sec-manual .btn-outline {
    font-size: .85rem;
    padding: 8px 14px;
    height: auto
}

#sec-auto .btn-outline {
    height: 38px
}

.nhomTo__table td {
    font-size: 14px
}

#nhomTo__Ctn td,
#nhomTo__Ctn__clone {
    font-size: .85rem
}

.calc-dots {
    display: flex;
    justify-content: center;
    gap: 6px
}

.calc-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: dot-jump 1.4s infinite ease-in-out both
}

.calc-dots .dot:nth-child(1) {
    animation-delay: -.32s
}

.calc-dots .dot:nth-child(2) {
    animation-delay: -.16s
}

@keyframes dot-jump {

    0%,
    80%,
    100% {
        transform: scale(0)
    }

    40% {
        transform: scale(1)
    }
}

.loading-dots:after {
    content: '.';
    animation: text-dots 1.5s steps(5, end) infinite
}

@keyframes text-dots {

    0%,
    20% {
        content: '.'
    }

    40% {
        content: '..'
    }

    60% {
        content: '...'
    }

    80%,
    100% {
        content: ''
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgb(0 0 0 / .6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn .2s ease-out
}

.modal-container {
    background: #fff;
    width: 95%;
    max-width: 1400px;
    height: 98vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgb(0 0 0 / .2);
    display: flex;
    flex-direction: column;
    overflow: hidden
}

.modal-header {
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--primary-blue);
    margin: 0;
    display: flex;
    justify-content: center;
    width: 100%
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
    transition: .2s
}

.btn-close-modal:hover {
    color: #dc3545
}

.modal-body {
    display: flex;
    flex: 1;
    overflow-y: auto
}

.modal-sidebar {
    box-sizing: border-box;
    display: flex;
    flex: 0 0 280px;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
    width: 280px;
    background: #fafafa;
    border-right: 1px solid var(--border-color);
    padding: 20px;
    padding-top: 10px
}

.filter-panel {
    box-sizing: border-box;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.filter-shortcuts {
    box-sizing: border-box;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 10px;
    height: auto;
    max-height: 200px;
    min-width: 0;
    overflow: hidden;
}

.filter-spacer {
    flex: 1 1 auto;
    min-height: 12px;
}

.filter-bottom {
    box-sizing: border-box;
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    min-height: 0;
    max-height: 78%;
    min-width: 0;
    padding-top: 12px;
}

.filter-shortcut {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.filter-shortcut .preview-filter-btn {
    display: flex !important;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 35px;
    margin: 0 !important;
}

.filter-shortcut .busy-filter-summary,
.filter-shortcut .preference-filter-summary {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0;
    max-height: 58px;
    min-height: 0;
    overflow: hidden;
    padding: 4px 6px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #f8fbff;
}

.filter-options {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    min-width: 0;
    min-height: 0;
    padding-top: 2px;
    padding-right: 2px;
}

.filter-apply-btn {
    box-sizing: border-box;
    flex: 0 0 auto;
    margin-top: 6px !important;
    margin-bottom: 0;
    max-width: 100%;
}

.sidebar-title {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #333;
    text-transform: uppercase
}

.filter-item {
    margin-bottom: 10px
}

.filter-item label {
    display: block;
    font-size: .85rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 6px
}

.modal-sidebar .filter__select {
    height: 32px !important;
    padding: 2px 8px !important;
    font-size: .85rem !important
}

.modal-sidebar .filter-item {
    margin-bottom: 8px
}

.modal-content-main {
    flex: 1;
    min-height: 0;
    padding: 20px;
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative
}

.preview-controls {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: flex-end;
    margin-right: 10px;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
    min-width: 100%;
    padding-top: 4px;
    padding-bottom: 6px
}

.preview-toggle-btn {
    height: 35px;
    padding: 0 14px;
    border: 1px solid var(--primary-blue);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-blue);
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    transition: .2s;
    width: 120px
}

.preview-toggle-btn:hover {
    background: var(--primary-blue);
    color: #fff
}

.preview-counter {
    width: 70px;
    font-size: 1rem;
    background: #e7f3ff;
    padding: 8px 25px;
    border-radius: 30px;
    color: var(--primary-blue);
    border: 1px solid #b3d7ff;
    display: flex;
    justify-content: center;
    text-align: center;
    cursor: pointer
}

.btn-nav {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid var(--primary-blue);
    background: #fff;
    color: var(--primary-blue);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: .2s
}

.btn-nav:hover:not(:disabled) {
    background: var(--primary-blue);
    color: #fff
}

.btn-nav:disabled {
    border-color: #ccc;
    color: #ccc;
    cursor: not-allowed
}

.preview-grid-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px
}

.preview-actions {
    margin-top: 15px;
    text-align: right;
    border-top: 1px solid var(--border-color);
    padding-top: 15px
}

.checkbox-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 5px;
    margin-top: 5px
}

.hidden-cb {
    display: none
}

.cb-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 40px;
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: .3rem;
    font-weight: 500;
    color: var(--text-muted);
    background-color: #fff;
    cursor: pointer;
    user-select: none;
    transition: all .2s ease-in-out;
    text-align: center
}

.cb-label:hover {
    background-color: #f0f7ff;
    border-color: #b3d7ff
}

.hidden-cb:checked+.cb-label {
    background-color: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
    box-shadow: 0 2px 4px rgb(0 74 153 / .2)
}

.checkbox-pill-group .cb-label {
    width: 45px;
    height: 30px;
    padding: 0 !important;
    font-size: 12px !important;
    font-weight: 700;
    line-height: 30px
}

.preview-grid-wrapper .timetable__cell,
.preview-grid-wrapper .timetable__period,
.preview-grid-wrapper .timetable__time {
    height: 35px !important
}

.preview-grid-wrapper .class-block {
    top: 2px !important;
    bottom: 2px !important;
    padding: 2px !important;
    justify-content: center;
    align-items: center;
    gap: 3px !important;
    display: flex
}

.preview-grid-wrapper .class-block__name {
    font-size: 11px !important;
    line-height: 1.1 !important;
    margin-bottom: 2px !important;
    display: block
}

.preview-grid-wrapper .class-block__info {
    font-size: 10px !important;
    line-height: 1 !important;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.preview-grid-wrapper .class-block__info:last-child,
.preview-grid-wrapper .class-block__info:nth-last-child(2),
.preview-grid-wrapper .class-block__info:nth-last-child(4) {
    display: none
}

#modal-preview-tkb .nhomTo__table td {
    font-size: 14px
}

.mess-modal {
    max-width: 400px !important;
    height: 90%
}

.btn-close-mess {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666
}

.btn-close-mess:hover {
    color: red
}

.modal-body.gop_y {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow-y: auto
}

#toast-container {
    position: fixed;
    top: 20px;
    z-index: 9999
}

.toast {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    padding: 12px 20px;
    min-width: 350px;
    box-shadow: 0 10px 25px rgb(0 0 0 / .1);
    margin-bottom: 10px;
    border-left: 5px solid #0056b3;
    animation: slideIn .4s ease-out, fadeOut .5s linear 3s forwards;
    pointer-events: auto
}

.toast-content {
    margin-left: 3px
}

.toast-title {
    font-weight: 700;
    font-size: 14px;
    color: #333;
    display: block
}

.toast-message {
    font-size: 13px;
    color: #666
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
        visibility: hidden
    }
}

.toast-success {
    border-left-color: #28a745
}

.toast-error {
    border-left-color: #dc3545
}

.toast-warning {
    border-left-color: #ffc107
}

.main-footer {
    width: 100%;
    background-color: #fff;
    padding: 20px 0 10px;
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: 'Segoe UI', Arial, sans-serif
}

.main-footer .ctn {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px
}

.footer-top {
    display: flex;
    justify-content: center;
    text-align: center;
    width: 100%
}

.footer-about {
    max-width: 600px;
    margin: 0 auto
}

.footer-logo-text {
    color: var(--primary-blue);
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 5px;
    text-transform: uppercase
}

.footer-desc {
    line-height: 1.4;
    font-size: .85rem;
    color: #666;
    margin: 0
}

.footer-divider {
    border: 0;
    border-top: 1px solid #dee2e6;
    width: 100%;
    max-width: 800px;
    margin: 5px auto
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    font-size: .8rem;
    color: #777
}

.footer-left {
    font-weight: 500
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 10px
}

.footer-copyright {
    font-weight: 500
}

.footer-badges {
    display: flex;
    align-items: center;
    gap: 10px
}

.badge-icon {
    color: #555;
    display: flex;
    align-items: center;
    transition: all .2s ease
}

.badge-icon:hover {
    color: var(--primary-blue);
    transform: translateY(-2px)
}

.badge-version {
    background-color: #e7f3ff;
    color: var(--primary-blue);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: .7rem;
    font-weight: 700;
    border: 1px solid #b3d7ff
}

.space_mobile {
    display: none
}

@media (max-width:1024px) {
    .modal-body {
        flex-direction: column;
        overflow-y: auto
    }

    .modal-sidebar {
        box-sizing: border-box;
        width: 100%;
        height: calc(100dvh - 100px);
        max-height: calc(100dvh - 100px);
        flex: 0 0 auto;
        overflow: hidden;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 15px
    }

    .modal-content-main {
        flex: none;
        min-height: 500px
    }
}

@media (max-width:1000px) {
    #modal-preview-tkb {
        display: flex;
        flex-direction: column;
        padding: 10px 0;
        justify-content: center
    }

    .modal-header {
        z-index: 1000
    }
}

@media (max-width:768px) {
    .class-block__name {
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important
    }

    .preview-toggle-btn {
        display: none !important
    }

    table#ds-nhom-to .tenMon {
        width: 5% !important
    }

    .fw-bold.tongTc {
        text-align: left;
        padding-left: 15px !important
    }

    .space_mobile {
        display: table-cell
    }

    .space_pc {
        display: none !important
    }

    #tkb .class-block .class-block__info:nth-child(2) {
        display: none !important
    }

    #tkb .class-block .class-block__info:nth-last-child(2) {
        display: block !important
    }

    .ctn {
        width: 100% !important;
        padding: 10px !important;
        box-sizing: border-box !important
    }

    .section-box,
    .timetable-section {
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        padding: 1rem
    }

    .hide-on-mobile {
        display: none !important
    }

    .header-subtitle,
    .header-datetime,
    .header-center {
        display: none !important
    }

    .header-title {
        font-size: 1.1rem
    }

    .header-left {
        gap: 10px
    }

    .btn-header {
        padding: 6px 10px;
        font-size: .8rem
    }

    .main-footer {
        padding: 15px 0 10px
    }

    .footer-logo-text {
        font-size: 1rem
    }

    .footer-desc {
        font-size: .8rem;
        padding: 0 10px
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center
    }

    .footer-right {
        flex-direction: column;
        gap: 12px
    }

    .filter__acction {
        flex-direction: column;
        align-items: stretch
    }

    .filter__group {
        width: 100% !important;
        min-width: 0 !important
    }

    .filter__acction .btn-primary,
    .filter__acction .btn-outline {
        width: 100%;
        margin-top: 7px
    }

    select,
    .week-selector {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important
    }

    .timetable-section__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px
    }

    .timetable-section__datetime {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap
    }

    .timetable-section__actions {
        width: 100% !important;
        justify-content: flex-start !important;
        margin-top: 10px
    }

    .table-wrapper {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin-bottom: 10px
    }

    table {
        min-width: 500px !important
    }

    table th,
    table td {
        padding: 4px !important;
        font-size: .75rem !important;
        word-wrap: break-word
    }

    #bangLuaChonXlTuDong td:nth-child(1),
    #sec-auto table th:nth-child(1),
    .nhomTo__table td:nth-child(1),
    .section-box:last-of-type table th:nth-child(1) {
        display: none !important
    }

    .nhomTo__table .space_tongTc,
    #body-ds-nhom-to .space_tongTc {
        display: none
    }

    #sec-auto table,
    .section-box:last-of-type table {
        min-width: 100% !important;
        table-layout: auto !important;
        width: 100% !important
    }

    #sec-auto table th:nth-child(2),
    .section-box:last-of-type table th:nth-child(2) {
        width: 55% !important
    }

    #sec-auto table th:nth-child(3),
    .section-box:last-of-type table th:nth-child(3) {
        width: 30% !important
    }

    #sec-auto table th:nth-child(4),
    .section-box:last-of-type table th:nth-child(4) {
        width: 15% !important
    }

    #tkb,
    #ds-nhom-to {
        min-width: 850px !important;
        table-layout: fixed !important
    }

    #tkb tr,
    #tkb td {
        height: 45px !important
    }

    #tkb th {
        font-size: .65rem !important;
        padding: 2px !important
    }

    .timetable-container td {
        height: 45px !important
    }

    .class-block {
        padding: 1px 2px !important;
        border-left-width: 2px !important;
        justify-content: flex-start !important;
        gap: 5px;
        padding-top: 10px !important
    }

    .class-block__name {
        font-size: .75rem;
        margin-bottom: 2px !important;
        line-height: 1.1 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden
    }

    .class-block__info {
        font-size: .7rem !important;
        line-height: 1 !important;
        white-space: normal !important
    }

    .modal-sidebar {
        width: 100% !important
    }

    .tabs-container .tab-add {
        padding: 6px;
        font-size: .8rem !important;
        font-weight: 600
    }

    .tabs-container .tab-item,
    .tabs-container .tab-item span {
        padding: 6px;
        font-size: .8rem !important
    }

    #nhomTo__Ctn tr td:nth-child(1),
    #nhomTo__Ctn__clone tr td:nth-child(1) {
        display: none
    }

    .preview-grid-wrapper .class-block {
        justify-content: center !important;
        gap: 5px !important
    }

    .preview-grid-wrapper .class-block__name {
        font-size: .6rem !important;
        line-height: 1.1 !important;
        margin-bottom: 1px !important;
        display: -webkit-box;
        line-clamp: 3;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden
    }

    .preview-grid-wrapper .class-block__info {
        font-size: .6rem !important;
        line-height: 1.1 !important
    }

    .tongTc {
        height: 35px
    }
}

@media (max-width:480px) {
    #body-ds-nhom-to .tenMon {
        text-align: center !important
    }

    .model-switch {
        flex-direction: column;
        gap: 10px
    }

    .model-btn {
        width: 100%;
        justify-content: center
    }

    .tabs-container {
        overflow-x: auto;
        padding-bottom: 2px
    }

    .tab-item {
        white-space: nowrap
    }

    .modal-header h2 {
        font-size: 1rem
    }

    .upload-area {
        padding: 10px
    }

    .preview-controls {
        flex-wrap: wrap;
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-left: auto;
        margin-right: auto
    }

    .preview-controls button {
        height: 40px
    }

    .preview-counter {
        display: flex;
        align-items: center;
        width: 100%;
        text-align: center;
        width: 50px
    }

    .tabs-container .tab-add {
        padding: 6px;
        font-size: .8rem !important;
        font-weight: 600
    }

    .tabs-container .tab-item,
    tabs-container .tab-item span {
        font-size: .8rem !important;
        height: 30px !important
    }

    .tabs-container .tab-item {
        gap: 0
    }

    .tabs-container {
        height: 40px
    }
}

@media (max-width:400px) {

    #sec-auto table th:nth-child(4),
    .section-box:last-of-type table th:nth-child(4) {
        width: 20% !important
    }
}

@media (max-width:380px) {
    .header-title {
        width: 100px
    }
}

.main-footer {
    width: 100%;
    background-color: #fff;
    padding: 20px 0 10px;
    margin-top: 30px;
    border-top: 1px solid #adb5bd;
    color: #333;
    font-family: 'Segoe UI', Arial, sans-serif
}

.main-footer .ctn {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px
}

.footer-top {
    display: flex;
    justify-content: center;
    text-align: center;
    width: 100%
}

.footer-about {
    max-width: 600px;
    margin: 0 auto
}

.footer-logo-text {
    color: var(--primary-blue);
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 5px;
    text-transform: uppercase
}

.footer-desc {
    line-height: 1.5;
    font-size: .9rem;
    color: #444;
    margin: 0
}

.footer-divider {
    border: 0;
    border-top: 1px solid #ced4da;
    width: 100%;
    max-width: 800px;
    margin: 10px auto
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    font-size: .85rem;
    color: #222
}

.footer-left {
    font-weight: 600
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 12px
}

.footer-copyright {
    font-weight: 600;
    color: #004a99
}

.footer-badges {
    display: flex;
    align-items: center;
    gap: 10px
}

.badge-icon {
    color: #000;
    display: flex;
    align-items: center;
    transition: all .2s ease
}

.badge-icon:hover {
    color: #004a99;
    transform: translateY(-2px)
}

.badge-version {
    background-color: #e7f3ff;
    color: #036;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: .75rem;
    font-weight: 700;
    border: 1px solid #b3d7ff
}

.timetable-area {
    min-height: 500px
}

.btn-primary {
    height: 32px
}

#btn-apply-filter {
    height: 40px
}

#modal-preview-tkb .btn-upload-tkb,
#modal-preview-tkb .btn-download-tkb {
    display: none !important
}

.btn-upload-tkb,
.btn-download-tkb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin-right: 8px;
    background: #fff;
    border: 1.5px solid #004a99;
    border-radius: 6px;
    cursor: pointer;
    transition: all .25s ease;
    color: #004a99
}

.btn-upload-tkb:hover,
.btn-download-tkb:hover {
    background: #004a99;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgb(0 74 153 / .2)
}

.btn-upload-tkb:active,
.btn-download-tkb:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgb(0 74 153 / .15)
}

.btn-upload-tkb svg,
.btn-download-tkb svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5
}

.btn-lock-tkb,
.btn-add-tkb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin-right: 8px;
    background: #fff;
    border: 1.5px solid #004a99;
    border-radius: 6px;
    cursor: pointer;
    transition: all .25s ease;
    color: #004a99
}

.btn-lock-tkb:active,
.btn-add-tkb:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgb(0 74 153 / .15)
}

.btn-lock-tkb.locked {
    background: #004a99;
    color: #fff;
    border-color: #004a99;
    box-shadow: 0 4px 12px rgb(0 74 153 / .3)
}

.btn-add-tkb:hover {
    background: #004a99;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgb(0 74 153 / .2)
}

.btn-add-tkb svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5
}

.quick-add-panel {
    position: relative;
    margin-top: 12px;
    padding: 14px 16px 12px;
    border: 1px solid #dfe7f1;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 28px rgb(15 23 42 / .08);
    transition: all .2s ease
}

.quick-add-panel.hidden {
    display: none
}

.quick-add-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px
}

.quick-add-panel__header h3 {
    margin: 0;
    color: var(--primary-blue);
    font-size: 1rem
}

.quick-add-panel__close {
    border: none;
    background: #fff0;
    color: #475569;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer
}

.quick-add-form {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.quick-add-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px
}

.quick-add-field {
    display: flex;
    flex-direction: column;
    gap: 6px
}

@media (max-width:640px) {

    .quick-add-grid,
    .quick-add-combined-wrap {
        grid-template-columns: 1fr
    }

    .quick-add-field,
    .quick-add-combined-item {
        min-width: 0
    }

    .quick-add-time-wrap {
        flex-wrap: wrap
    }

    .quick-add-time-period {
        max-width: none;
        flex: 1 1 100%
    }
}

.quick-add-field--combined {
    grid-column: 1 / -1
}

.quick-add-combined-wrap {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%
}

.quick-add-combined-item {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.quick-add-field label {
    font-size: .76rem;
    font-weight: 700;
    color: #475569
}

.quick-add-field input,
.quick-add-field select {
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid #dfe7f1;
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    font-size: .9rem
}

.quick-add-time-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 0 4px;
    border-radius: 8px
}

.quick-add-time-part {
    min-width: 0;
    flex: 1;
    border: none;
    background: #fff0;
    color: #0f172a;
    font-size: .9rem;
    min-height: 36px;
    padding: 8px 6px
}

.quick-add-time-colon {
    color: #64748b;
    font-weight: 700
}

.quick-add-time-period {
    max-width: 68px;
    flex: 0 0 68px
}

.quick-add-field input:focus,
.quick-add-field select:focus {
    outline: 2px solid rgb(0 74 153 / .12);
    border-color: #004a99
}

.quick-add-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px
}

.quick-add-cancel,
.quick-add-save {
    min-width: 110px;
    height: 36px
}

#modal-preview-tkb .btn-lock-tkb {
    display: none !important
}

.modal-body.gop_y {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto !important;
    max-height: 100%
}

.mess-modal {
    max-width: 500px !important;
    height: 100vh !important;
    max-height: 95vh;
    border-radius: 15px !important;
    overflow-y: auto !important
}

.modal-body.gop_y {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px !important;
    padding-top: 0px !important;
    gap: 20px
}

.modal-body.gop_y ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left
}

.modal-body.gop_y li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 15px
}

.modal-body.gop_y ul {
    list-style: none;
    padding-left: 0
}

.modal-body.gop_y li {
    position: relative;
    padding-left: 24px
}

.modal-body.gop_y p {
    font-size: .95rem;
    line-height: 1.6;
    color: #444;
    margin: 0
}

#img-mess {
    width: 250px;
    margin-top: 10px;
    transition: transform .3s ease;
    border: 2px solid #f0f0f0
}

#img-mess:hover {
    transform: scale(1.05)
}

#drop-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(37 99 235 / .15);
    border: 4px dashed var(--primary-blue);
    z-index: 9999;
    pointer-events: none;
    align-items: center;
    justify-content: center
}

.drop-message {
    display: flex;
    gap: 5px
}

.overlay-block {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    cursor: wait
}

body.dark-mode {
    --primary-blue: #5b9dff;
    --bg-light: #18191a;
    --border-color: #3a3b3c;
    --text-main: #e4e6eb;
    --text-muted: #b0b3b8;
    background-color: var(--bg-light);
    color: var(--text-main)
}

body.dark-mode .main-header,
body.dark-mode .main-footer,
body.dark-mode .section-box,
body.dark-mode .timetable-section,
body.dark-mode .table-wrapper {
    background-color: #242526;
    border-color: var(--border-color)
}

body.dark-mode .header-title,
body.dark-mode .footer-logo-text {
    color: var(--primary-blue)
}

body.dark-mode .header-subtitle,
body.dark-mode .footer-desc {
    color: var(--text-muted)
}

body.dark-mode .footer-left,
body.dark-mode .footer-copyright,
body.dark-mode .badge-icon {
    color: #f3f4f6 !important
}

body.dark-mode .badge-icon:hover {
    color: var(--primary-blue) !important
}

body.dark-mode .header-datetime {
    background: #3a3b3c;
    color: var(--text-main);
    border-color: var(--border-color)
}

body.dark-mode table th,
body.dark-mode table td {
    border-color: var(--border-color)
}

body.dark-mode th,
body.dark-mode .timetable__period,
body.dark-mode .total-row,
body.dark-mode .timetable-section__datetime {
    background-color: #1a1a1a;
    color: var(--text-main)
}

body.dark-mode .btn-header,
body.dark-mode .action-btn,
body.dark-mode .btn-outline,
body.dark-mode .upload-area,
body.dark-mode .cb-label {
    background-color: #3a3b3c;
    color: var(--text-main);
    border-color: #555
}

body.dark-mode .preview-controls {
    background: #242526;
    border-color: var(--border-color)
}

body.dark-mode .preview-toggle-btn {
    background: #2d2e30;
    color: var(--primary-blue);
    border-color: var(--primary-blue)
}

body.dark-mode .preview-toggle-btn:hover {
    background: var(--primary-blue);
    color: #fff
}

body.dark-mode .preview-counter {
    background: #2d2e30;
    color: var(--primary-blue);
    border-color: var(--border-color)
}

body.dark-mode .btn-nav {
    background: #2d2e30;
    color: var(--primary-blue);
    border-color: #555
}

body.dark-mode .btn-nav:hover:not(:disabled) {
    background: var(--primary-blue);
    color: #fff
}

body.dark-mode .btn-nav:disabled {
    border-color: #444;
    color: #666;
    cursor: not-allowed
}

body.dark-mode .preview-grid-wrapper {
    background-color: #1f1f1f;
    border-color: var(--border-color)
}

body.dark-mode .preview-grid-wrapper::-webkit-scrollbar {
    width: 10px;
    height: 10px;
    background: #1f1f1f
}

body.dark-mode .preview-grid-wrapper::-webkit-scrollbar-track {
    background: #1f1f1f;
    border-radius: 8px
}

body.dark-mode .preview-grid-wrapper::-webkit-scrollbar-thumb {
    background: rgb(255 255 255 / .35);
    border-radius: 8px;
    border: 2px solid #1f1f1f
}

body.dark-mode .preview-grid-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgb(255 255 255 / .5)
}

body.dark-mode .btn-header:hover,
body.dark-mode .action-btn:hover,
body.dark-mode .btn-outline:hover,
body.dark-mode .cb-label:hover,
body.dark-mode .btn-lock-tkb:hover {
    background-color: #1f5278;
    border-color: #5b9dff;
    color: #fff
}

body.dark-mode .btn-header:active,
body.dark-mode .action-btn:active,
body.dark-mode .btn-outline:active,
body.dark-mode .cb-label:active,
body.dark-mode .btn-lock-tkb:active {
    background-color: #16456b;
    border-color: #3a7dd8;
    color: #fff
}

body.dark-mode .btn-lock-tkb {
    background-color: #2d2e30;
    color: #5b9dff;
    border-color: #444
}

body.dark-mode .btn-lock-tkb.locked {
    background-color: #0056d2 !important;
    color: #fff;
    border-color: #0056d2;
    box-shadow: 0 4px 12px rgb(0 86 210 / .35)
}



body.dark-mode .model-btn {
    background-color: #242526;
    color: var(--primary-blue)
}

body.dark-mode .model-btn.active {
    background-color: var(--primary-blue);
    color: #fff
}

body.dark-mode .select2-container .select2-selection--single,
body.dark-mode .select2-container--default .select2-selection--multiple,
body.dark-mode .select2-dropdown,
body.dark-mode .select2-search__field,
body.dark-mode .filter__select {
    background-color: #3a3b3c !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important
}

body.dark-mode .select2-container--default .select2-selection--single .select2-selection__rendered,
body.dark-mode .select2-results__option {
    color: var(--text-main) !important
}

body.dark-mode .select2-results__option--selected,
body.dark-mode .select2-results__option[aria-selected="true"] {
    background-color: #4a4b4c !important
}

body.dark-mode .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--primary-blue) !important;
    color: #fff !important
}

body.dark-mode .select2-container--default .select2-selection--single .select2-selection__placeholder,
body.dark-mode .select2-selection__rendered[title^="--"] {
    color: var(--text-muted) !important
}

body.dark-mode .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #1e3a5f;
    border-color: var(--primary-blue);
    color: #e4e6eb
}

body.dark-mode .modal-container,
body.dark-mode .modal-header,
body.dark-mode .modal-content-main,
body.dark-mode .modal-sidebar {
    background-color: #242526;
    border-color: var(--border-color)
}

body.dark-mode .modal-header h2 {
    color: var(--primary-blue)
}

body.dark-mode .btn-close-modal,
body.dark-mode .btn-close-mess {
    color: #e4e6eb
}

body.dark-mode .tab-item {
    background-color: #1a1a1a;
    border-color: var(--border-color);
    color: var(--text-muted)
}

body.dark-mode .tab-item--active {
    background-color: var(--primary-blue);
    color: #fff
}

body.dark-mode .tab-add {
    color: var(--primary-blue)
}

body.dark-mode .tab-add:hover {
    background-color: #3a3b3c;
    color: var(--primary-blue)
}

body.dark-mode .class-block {
    box-shadow: none
}

body.dark-mode .class-block__info {
    color: #d1d5db
}

body.dark-mode .class-block__name {
    color: #fff;
    text-shadow: 0 1px 2px rgb(0 0 0 / .5)
}

body.dark-mode .blue {
    --bg-color: rgba(13, 110, 253, 0.2);
    --main-color: #6ea8fe
}

body.dark-mode .red {
    --bg-color: rgba(220, 53, 69, 0.2);
    --main-color: #ea868f
}

body.dark-mode .green {
    --bg-color: rgba(40, 167, 69, 0.2);
    --main-color: #75b798
}

body.dark-mode .purple {
    --bg-color: rgba(111, 66, 193, 0.2);
    --main-color: #b294ba
}

body.dark-mode .orange {
    --bg-color: rgba(253, 126, 20, 0.2);
    --main-color: #feb272
}

body.dark-mode .yellow {
    --bg-color: rgba(255, 193, 7, 0.2);
    --main-color: #ffda6a
}

body.dark-mode .teal {
    --bg-color: rgba(32, 201, 151, 0.2);
    --main-color: #79dfc1
}

body.dark-mode .pink {
    --bg-color: rgba(232, 62, 140, 0.2);
    --main-color: #f1aeb5
}

body.dark-mode .toast {
    background-color: #242526;
    color: var(--text-main);
    box-shadow: 0 4px 15px rgb(0 0 0 / .4)
}

body.dark-mode .toast-title {
    color: #e5e7eb
}

body.dark-mode .toast-message {
    color: #d1d5db
}

body.dark-mode .toast-success {
    border-left-color: #10b981
}

body.dark-mode .toast-success .toast-title {
    color: #6ee7b7
}

body.dark-mode .toast-success .toast-message {
    color: #a7f3d0
}

body.dark-mode .toast-error {
    border-left-color: #ef4444
}

body.dark-mode .toast-error .toast-title {
    color: #fca5a5
}

body.dark-mode .toast-error .toast-message {
    color: #fecaca
}

body.dark-mode .toast-warning {
    border-left-color: #f59e0b
}

body.dark-mode .toast-warning .toast-title {
    color: #fcd34d
}

body.dark-mode .toast-warning .toast-message {
    color: #fde68a
}

body.dark-mode .sec-auto__result {
    background: #1e293b;
    color: var(--text-main);
    border-color: var(--primary-blue)
}

body.dark-mode .sec-auto__no-result {
    background: #2d1a1a;
    color: var(--text-main);
    border-color: #ea868f
}

body.dark-mode .data-status__badge,
body.dark-mode .week-badge {
    background: #3a3b3c;
    border-color: #555
}

body.dark-mode .select2-container--default .select2-selection--single,
body.dark-mode .select2-container .select2-selection--single {
    background-color: #2d2e30 !important;
    border-color: #444 !important
}

body.dark-mode .select2-container--default .select2-selection--single .select2-selection__rendered,
body.dark-mode .select2-selection__rendered[title],
body.dark-mode .select2-selection__rendered[title*="--"] {
    color: #e4e6eb !important
}

body.dark-mode .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #a0a0a0 !important
}

body.dark-mode .select2-dropdown {
    background-color: #2d2e30 !important;
    border-color: #444 !important
}

body.dark-mode .select2-results__option {
    color: #e4e6eb !important
}

body.dark-mode .btn-lock-tkb,
body.dark-mode .btn-add-tkb,
body.dark-mode .btn-upload-tkb,
body.dark-mode .btn-download-tkb {
    background-color: #2d2e30 !important;
    color: #5b9dff !important;
    border-color: #555 !important
}

body.dark-mode .btn-lock-tkb:hover,
body.dark-mode .btn-add-tkb:hover,
body.dark-mode .btn-upload-tkb:hover,
body.dark-mode .btn-download-tkb:hover,
body.dark-mode .btn-mess:hover,
body.dark-mode .btn-theme:hover {
    color: #ffffff !important
}

body.dark-mode .quick-add-panel {
    background: #242526 !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 12px 28px rgb(0 0 0 / .35) !important
}

body.dark-mode .quick-add-panel__header h3,
body.dark-mode .quick-add-panel__close,
body.dark-mode .quick-add-field label {
    color: #e4e6eb !important
}

body.dark-mode .quick-add-field input,
body.dark-mode .quick-add-field select,
body.dark-mode .quick-add-time-part {
    background: #2d2e30 !important;
    color: #e4e6eb !important;
    border-color: #555 !important
}

body.dark-mode .quick-add-time-colon,
body.dark-mode .quick-add-field input::placeholder {
    color: #b0b3b8 !important
}

body.dark-mode .quick-add-cancel,
body.dark-mode .quick-add-save {
    color: #e4e6eb !important;
    border-color: #555 !important
}

body.dark-mode select.week-selector,
body.dark-mode .timetable-section__actions select {
    background-color: #2d2e30 !important;
    color: #e4e6eb !important;
    border-color: #444 !important
}

body.dark-mode .header-datetime {
    background-color: #2d2e30 !important;
    color: #e4e6eb !important;
    border-color: #5b9dff !important
}

body.dark-mode .timetable-section__badge {
    background-color: #3a3b3c !important;
    color: #e4e6eb !important;
    border-color: #555 !important
}

body.dark-mode .timetable-section__datetime {
    background-color: #2d2e30 !important;
    color: #e4e6eb !important
}

body.dark-mode .timetable-section__datetime svg {
    stroke: #b0b3b8 !important
}

body.dark-mode .week-badge {
    color: #5b9dff !important
}

body.dark-mode #modal-mess .mess-modal,
body.dark-mode #modal-mess .modal-container {
    background-color: #242526 !important;
    color: #e4e6eb !important;
    border: 1px solid #3a3b3c !important
}

body.dark-mode #modal-mess .modal-header {
    background-color: #1c1d1e !important;
    border-bottom: 1px solid #3a3b3c !important
}

body.dark-mode #modal-mess .modal-header h2 {
    color: #5b9dff !important
}

body.dark-mode #modal-mess .btn-close-mess {
    color: #ffffff !important
}

body.dark-mode .modal-body.gop_y p,
body.dark-mode .modal-body.gop_y li {
    color: #e4e6eb !important
}

body.dark-mode .modal-body.gop_y b {
    color: #ffffff !important
}

body.dark-mode .modal-body.gop_y span[style*="color"] {
    color: #6ea8fe !important
}

body.dark-mode .modal-body.gop_y b[style*="color"],
body.dark-mode .modal-body.gop_y p[style*="color"] {
    color: #ff6b6b !important
}

body.dark-mode #img-mess {
    border: 2px solid #3a3b3c !important
}

@media (max-width:380px) {
    .mess-hoc_ki {
        display: block
    }
}

table.tkb-timeline {
    table-layout: fixed !important;
    border-collapse: collapse
}

table.tkb-timeline th {
    position: sticky;
    top: 0;
    z-index: 10
}

table.tkb-timeline .time-col {
    width: 60px;
    text-align: center;
    font-size: .75rem;
    color: #64748b;
    vertical-align: top;
    border-right: 1px solid var(--border-color, #e0e0e0);
    border-bottom: 1px solid #fff0;
    padding-top: 4px
}

table.tkb-timeline .empty-cell {
    border-right: 1px solid var(--border-color, #e0e0e0);
    border-bottom: 1px dashed #fff0;
    height: 5px !important;
    padding: 0
}

table.tkb-timeline tr.half-hour td.empty-cell {
    border-bottom: 1px dashed var(--border-color, #e2e8f0)
}

table.tkb-timeline tr.hour-end td {
    border-bottom: 1px solid var(--border-color, #e2e8f0)
}

table.tkb-timeline .event-cell {
    padding: 2px !important;
    vertical-align: top;
    border-right: 1px solid var(--border-color, #e0e0e0);
    height: 1px
}

table.tkb-timeline .event-cell .class-block {
    height: 100% !important;
    width: 100%;
    margin: 0 !important;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start
}

table.tkb-timeline .event-cell .class-block.custom-act {
    background-color: #f1f5f9;
    color: #334155;
    border-left: 3px solid #64748b;
    justify-content: center;
    align-items: center
}

.dark-mode table.tkb-timeline .event-cell .class-block.custom-act {
    background-color: #334155;
    color: #cbd5e1;
    border-left-color: #94a3b8
}

table#tkb.tkb-timeline {
    table-layout: fixed !important;
    border-collapse: collapse !important;
    width: 100% !important
}

table#tkb.tkb-timeline tr {
    height: 5px !important
}

table#tkb.tkb-timeline td.empty-cell {
    height: 5px !important;
    padding: 0 !important;
    border-right: 1px solid var(--border-color, #e0e0e0) !important;
    border-bottom: 1px dashed transparent !important
}

table#tkb.tkb-timeline tr.half-hour td.empty-cell {
    border-bottom: 1px dashed var(--border-color, #e2e8f0) !important
}

table#tkb.tkb-timeline tr.hour-end td {
    border-bottom: 1px solid var(--border-color, #e0e0e0) !important
}

table#tkb.tkb-timeline td.time-col {
    width: 60px !important;
    text-align: center !important;
    font-size: 0.75rem !important;
    color: #64748b !important;
    vertical-align: top !important;
    border-right: 1px solid var(--border-color, #e0e0e0) !important;
    border-bottom: 1px solid transparent !important;
    padding-top: 4px !important
}

table#tkb.tkb-timeline td.event-cell {
    padding: 2px !important;
    vertical-align: top !important;
    border-right: 1px solid var(--border-color, #e0e0e0) !important;
    height: 1px !important
}

table#tkb.tkb-timeline td.event-cell .class-block {
    height: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important
}

table#tkb.tkb-timeline td.event-cell .class-block.custom-act {
    background-color: #f1f5f9;
    border-left: 4px solid #64748b;
    align-items: center;
    text-align: center
}

table#tkb.tkb-timeline {
    width: 100%;
    min-width: 900px;
    table-layout: fixed !important;
    border-collapse: collapse !important
}

table#tkb.tkb-timeline td {
    border-top: none !important;
    border-bottom: none !important
}

table#tkb.tkb-timeline th {
    background: #f8fafc;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
    border-right: 1px solid var(--border-color, #e2e8f0) !important;
    text-align: center;
    font-size: .85rem;
    color: #475569
}

table#tkb.tkb-timeline .time-col {
    width: 60px;
    text-align: center;
    font-size: .75rem;
    color: #64748b;
    vertical-align: top;
    border-right: 1px solid var(--border-color, #e2e8f0) !important;
    border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
    padding-top: 4px
}

table#tkb.tkb-timeline .empty-cell {
    border-right: 1px solid var(--border-color, #e2e8f0) !important;
    height: 5px !important;
    padding: 0 !important
}

table#tkb.tkb-timeline tr.half-hour td.empty-cell {
    border-bottom: 1px dashed var(--border-color, #e2e8f0) !important
}

table#tkb.tkb-timeline tr.hour-end td.empty-cell {
    border-bottom: 1px solid var(--border-color, #e2e8f0) !important
}

table#tkb.tkb-timeline .event-cell {
    padding: 2px !important;
    vertical-align: top;
    border-right: 1px solid var(--border-color, #e2e8f0) !important;
    height: 1px !important
}

table#tkb.tkb-timeline .event-cell .class-block {
    height: 100% !important;
    width: 100%;
    margin: 0 !important;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left
}

table#tkb.tkb-timeline .event-cell .class-block.custom-act {
    background-color: #f1f5f9;
    color: #334155;
    border-left: 3px solid #64748b;
    align-items: center;
    text-align: center
}

.dark-mode table#tkb.tkb-timeline .event-cell .class-block.custom-act {
    background-color: #334155;
    color: #cbd5e1;
    border-left-color: #94a3b8
}

#tkb.table-normal .class-block__info.tiet {
    display: none !important;
}

@media (max-width:768px) {
    .week-selector {
        flex: 1;
    }

    #tkb.table-normal .class-block__info.gv {
        display: none !important
    }

    #tkb.table-normal .class-block__info.tiet {
        display: table-cell !important;
    }

    #tkb.table-normal th:nth-child(2) {
        width: 50px !important;
        max-width: 50px !important;
        min-width: 50px !important;
    }

    #tkb.table-normal th:nth-child(1) {
        width: 28px !important;
        max-width: 28px !important;
        min-width: 28px !important
    }

    #tkb.table-normal .timetable__time {
        font-size: 0.55rem !important
    }

    .preview-grid-wrapper th:nth-child(1),
    .preview-grid-wrapper .timetable__period {
        width: 30px !important;
        max-width: 30px !important;
        min-width: 30px !important;
        font-size: 0.65rem !important
    }

    .preview-grid-wrapper th:nth-child(2),
    .preview-grid-wrapper .timetable__time {
        width: 35px !important;
        max-width: 35px !important;
        min-width: 35px !important;
        font-size: 0.55rem !important
    }
}

.preview-grid-wrapper table,
#tkb__phu_preview {
    min-width: 850px !important;
    width: 100% !important;
    table-layout: fixed !important
}

.wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgb(0 0 0 / .05);
    padding: 20px;
    overflow-x: auto
}

table.tkb-timeline {
    width: 100%;
    min-width: 900px;
    table-layout: fixed !important;
    border-collapse: collapse !important
}

table.tkb-timeline td {
    border-top: none !important;
    border-bottom: none !important
}

table.tkb-timeline th.time-header {
    width: 60px !important
}

table.tkb-timeline th.day-header {
    width: calc((100% - 60px) / 7) !important
}

table.tkb-timeline th {
    background: #f8fafc;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    text-align: center;
    font-size: .85rem;
    color: #475569
}

table.tkb-timeline .time-col {
    width: 60px;
    text-align: center;
    font-size: .75rem;
    color: #64748b;
    vertical-align: top;
    border-right: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding-top: 4px
}

table.tkb-timeline .empty-cell {
    border-right: 1px solid #e2e8f0 !important;
    height: 5px !important;
    padding: 0 !important
}

table.tkb-timeline tr.half-hour td.empty-cell {
    border-bottom: 1px dashed #e2e8f0 !important
}

table.tkb-timeline tr.hour-end td.empty-cell {
    border-bottom: 1px solid #e2e8f0 !important
}

table.tkb-timeline td.event-cell {
    padding: 2px 3px !important;
    vertical-align: top;
    border-right: 1px solid #e2e8f0 !important;
    height: 1px;
    box-sizing: border-box
}

table.tkb-timeline td.event-cell .class-block {
    height: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center
}

table.tkb-timeline td.event-cell .class-block.custom-act {
    background-color: #f1f5f9;
    border-left: 4px solid #64748b
}

table.tkb-timeline td.event-cell {
    padding: 2px 4px !important;
    vertical-align: top;
    height: 1px !important;
    border-right: 1px solid var(--border-color, #e2e8f0) !important;
    position: relative
}

table.tkb-timeline .class-block {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    height: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 6px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 3px rgb(0 0 0 / .05) !important;
    z-index: 10 !important
}

table.tkb-timeline .class-block__name {
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    margin-bottom: 4px !important
}

table.tkb-timeline .class-block__info {
    font-size: 0.7rem !important;
    line-height: 1.3 !important
}

table.tkb-timeline th:nth-child(2),
table.tkb-timeline th.day-header {
    width: auto !important;
    min-width: 95px !important;
    max-width: none !important
}

table.tkb-timeline th.time-header,
table.tkb-timeline td.time-col {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important
}

@media (max-width:768px) {

    #bangLuaChonXlTuDong td:nth-child(1),
    #sec-auto table th:nth-child(1),
    #nhomTo__Ctn table th:nth-child(1),
    #nhomTo__Ctn table td:nth-child(1),
    #nhomTo__Ctn__preview table th:nth-child(1),
    #nhomTo__Ctn__preview table td:nth-child(1) {
        display: none !important
    }

    #sec-auto table th:nth-child(2),
    #nhomTo__Ctn table th:nth-child(2),
    #nhomTo__Ctn__preview table th:nth-child(2) {
        width: 55% !important
    }

    #sec-auto table th:nth-child(3),
    #nhomTo__Ctn table th:nth-child(3),
    #nhomTo__Ctn__preview table th:nth-child(3) {
        width: 30% !important
    }

    #sec-auto table th:nth-child(4),
    #nhomTo__Ctn table th:nth-child(4),
    #nhomTo__Ctn__preview table th:nth-child(4) {
        width: 15% !important
    }

    #lichKhac__Ctn table th:nth-child(1),
    #lichKhac__Ctn table td:nth-child(1),
    .nhomTo__table#tbody_lichKhac_main td:nth-child(1) {
        display: table-cell !important;
        width: 35% !important;
        text-align: left !important
    }

    #lichKhac__Ctn table th:nth-child(2),
    #lichKhac__Ctn table td:nth-child(2) {
        width: 15% !important
    }

    #lichKhac__Ctn table th:nth-child(3),
    #lichKhac__Ctn table td:nth-child(3) {
        width: 35% !important
    }

    #lichKhac__Ctn table th:nth-child(4),
    #lichKhac__Ctn table td:nth-child(4) {
        width: 15% !important
    }
}

#nhomTo__Ctn table th:nth-child(3),
#nhomTo__Ctn table td:nth-child(3) {
    width: 10% !important
}

@media (max-width:768px) {

    #nhomTo__Ctn table,
    #nhomTo__Ctn__preview table {
        min-width: 100% !important;
        width: 100% !important;
        table-layout: fixed !important
    }

    #nhomTo__Ctn table th:nth-child(1),
    #nhomTo__Ctn table td:nth-child(1),
    #nhomTo__Ctn__preview table th:nth-child(1),
    #nhomTo__Ctn__preview table td:nth-child(1) {
        display: none !important
    }

    #nhomTo__Ctn table th:nth-child(2),
    #nhomTo__Ctn table td:nth-child(2),
    #nhomTo__Ctn__preview table th:nth-child(2),
    #nhomTo__Ctn__preview table td:nth-child(2) {
        width: 46% !important
    }

    #nhomTo__Ctn table th:nth-child(3),
    #nhomTo__Ctn table td:nth-child(3),
    #nhomTo__Ctn__preview table th:nth-child(3),
    #nhomTo__Ctn__preview table td:nth-child(3) {
        width: 14% !important
    }

    #nhomTo__Ctn table th:nth-child(4),
    #nhomTo__Ctn table td:nth-child(4),
    #nhomTo__Ctn__preview table th:nth-child(4),
    #nhomTo__Ctn__preview table td:nth-child(4) {
        width: 18% !important;
        white-space: nowrap !important
    }

    #nhomTo__Ctn table th:nth-child(5),
    #nhomTo__Ctn table td:nth-child(5),
    #nhomTo__Ctn__preview table th:nth-child(5),
    #nhomTo__Ctn__preview table td:nth-child(5) {
        width: 10% !important
    }

    #nhomTo__Ctn table th:nth-child(6),
    #nhomTo__Ctn table td:nth-child(6),
    #nhomTo__Ctn__preview table th:nth-child(6),
    #nhomTo__Ctn__preview table td:nth-child(6) {
        width: 12% !important
    }

    #nhomTo__Ctn table th,
    #nhomTo__Ctn table td,
    #nhomTo__Ctn__preview table th,
    #nhomTo__Ctn__preview table td {
        padding: 6px 3px !important;
        font-size: 0.75rem !important
    }
}

body.dark-mode table.tkb-timeline th,
body.dark-mode table.tkb-timeline td.time-col {
    background-color: #1a1a1a !important;
    color: #e4e6eb !important;
    border-color: #3a3b3c !important
}

#tbody_lichKhac_main td {
    text-align: center !important
}

.no-copy {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none
}

.cyan {
    --main-color: #0dcaf0;
    --bg-color: #f0fbfc
}

.emerald {
    --main-color: #10b981;
    --bg-color: #ecfdf5
}

.rose {
    --main-color: #f43f5e;
    --bg-color: #fff1f2
}

.amber {
    --main-color: #f59e0b;
    --bg-color: #fffbeb
}

body.dark-mode .cyan {
    --bg-color: rgba(13, 202, 240, 0.2);
    --main-color: #6edff6
}

body.dark-mode .indigo {
    --bg-color: rgba(102, 16, 242, 0.2);
    --main-color: #a370f7
}

body.dark-mode .brown {
    --bg-color: rgba(121, 85, 72, 0.2);
    --main-color: #a08479
}

body.dark-mode .slate {
    --bg-color: rgba(112, 128, 144, 0.2);
    --main-color: #94a3b8
}

body.dark-mode .emerald {
    --bg-color: rgba(16, 185, 129, 0.2);
    --main-color: #34d399
}

body.dark-mode .rose {
    --bg-color: rgba(244, 63, 94, 0.2);
    --main-color: #fb7185
}

body.dark-mode .amber {
    --bg-color: rgba(245, 158, 11, 0.2);
    --main-color: #fbbf24
}

.violet {
    --main-color: #8b5cf6;
    --bg-color: #f5f3ff
}

.lime {
    --main-color: #65a30d;
    --bg-color: #f7fee7
}

.fuchsia {
    --main-color: #c026d3;
    --bg-color: #fdf4ff
}

.sky {
    --main-color: #0284c7;
    --bg-color: #f0f9ff
}

.mint {
    --main-color: #0d9488;
    --bg-color: #f0fdfa
}

.coral {
    --main-color: #ea580c;
    --bg-color: #fff7ed
}

.crimson {
    --main-color: #e11d48;
    --bg-color: #fff1f2
}

.zinc {
    --main-color: #52525b;
    --bg-color: #f4f4f5
}

.gold {
    --main-color: #ca8a04;
    --bg-color: #fefce8
}

.plum {
    --main-color: #9333ea;
    --bg-color: #faf5ff
}

body.dark-mode .violet {
    --bg-color: rgba(139, 92, 246, 0.22);
    --main-color: #a78bfa
}

body.dark-mode .lime {
    --bg-color: rgba(132, 204, 22, 0.22);
    --main-color: #a3e635
}

body.dark-mode .fuchsia {
    --bg-color: rgba(217, 70, 239, 0.22);
    --main-color: #e879f9
}

body.dark-mode .sky {
    --bg-color: rgba(14, 165, 233, 0.22);
    --main-color: #38bdf8
}

body.dark-mode .mint {
    --bg-color: rgba(20, 184, 166, 0.22);
    --main-color: #2dd4bf
}

body.dark-mode .coral {
    --bg-color: rgba(249, 115, 22, 0.22);
    --main-color: #fb923c
}

body.dark-mode .crimson {
    --bg-color: rgba(225, 29, 72, 0.22);
    --main-color: #fb7185
}

body.dark-mode .zinc {
    --bg-color: rgba(113, 113, 122, 0.25);
    --main-color: #a1a1aa
}

body.dark-mode .gold {
    --bg-color: rgba(234, 179, 8, 0.22);
    --main-color: #fde047
}

body.dark-mode .plum {
    --bg-color: rgba(168, 85, 247, 0.22);
    --main-color: #c084fc
}


/* =========================================
   CSS KHUNG CHAT / COMMENT
========================================= */
.comment-modal-container {
    max-width: 600px;
    height: 99vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    position: fixed;
    top: 0;
    right: 10px;
}

/* Nút mở comment trong bảng */
.btn-open-chat {
    background: #eff6ff;
    color: var(--primary-blue, #004a99);
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-open-chat:hover {
    background: var(--primary-blue, #004a99);
    color: white;
}

/* Vùng hiển thị tin nhắn */
.comment-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
}

/* Nút tải thêm */
.btn-load-more {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: center;
    padding: 10px;
    width: 100%;
    margin-bottom: 10px;
}

.btn-load-more:hover {
    text-decoration: underline;
    color: var(--primary-blue, #004a99);
}

/* Khung tin nhắn */
.comment-messages-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-bubble-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* Avatar người dùng */
.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Bong bóng chat */
.chat-bubble {
    background: white;
    padding: 10px 14px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    max-width: 85%;
}

.chat-author {
    font-weight: 600;
    font-size: 0.8rem;
    color: #475569;
    margin-bottom: 3px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.chat-time {
    font-weight: normal;
    font-size: 0.7rem;
    color: #94a3b8;
}

.chat-text {
    font-size: 0.95rem;
    color: #1e293b;
    line-height: 1.4;
    word-break: break-word;
}

/* Tin nhắn của chính mình (Nằm bên phải, màu xanh) */
.chat-bubble-container.is-mine {
    flex-direction: row-reverse;
}

.chat-bubble-container.is-mine .chat-bubble {
    background: #dbeafe;
    /* Xanh nhạt */
    border-radius: 16px;
    border-bottom-right-radius: 4px;
}

.chat-bubble-container.is-mine .chat-author {
    color: var(--primary-blue, #004a99);
}

/* Khu vực Footer (Nhập liệu) */
.comment-footer {
    padding: 12px 15px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.comment-input-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#comment-input {
    font-size: 14px !important;
    line-height: 1.4 !important;
    font-family: inherit !important;
    padding: 6px 4px !important;
    caret-color: #004a99;
    box-sizing: border-box;
    border: none;
    outline: none;
    width: 100%;
    resize: none;

    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;

    min-height: 24px;
    max-height: 120px;
    overflow-y: auto;
}

.comment-footer {
    margin-bottom: 10px;
}

#comment-input::placeholder {
    font-size: 15px;
    color: #94a3b8;
    line-height: 1.5;
}

.username-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    width: fit-content;
}

.username-wrapper input {
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    outline: none;
    width: 150px;
}

.chat-action-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-action-wrapper textarea {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    max-height: 100px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.chat-action-wrapper textarea:focus {
    border-color: var(--primary-blue, #004a99);
}

#btn-send-comment {
    background: var(--primary-blue, #004a99);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.1s, background 0.2s;
}

#btn-send-comment:hover {
    background: #003875;
    transform: scale(1.05);
}

/* Bao bọc ô nhập liệu và nút gửi */
.chat-action-wrapper {
    display: flex;
    gap: 10px;
    width: 100%;
    align-items: center;

}

/* KHUNG GỘP CHUNG TÊN & NỘI DUNG */
.chat-input-box {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 10px 14px;
    background: #f8fafc;
    /* Nền hơi xám nhẹ */
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* Khoảng cách giữa Tên và Chữ */
    transition: border-color 0.2s, background 0.2s;
}

/* Hiệu ứng khi bấm vào khung nhập liệu */
.chat-input-box:focus-within {
    border-color: var(--primary-blue, #004a99);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.1);
}

/* Phần nhập Tên người dùng */
.chat-input-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-blue, #004a99);
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 4px;
}

.chat-input-header input {
    border: none;
    background: transparent;
    outline: none;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-blue, #004a99);
    width: 100%;
}

.chat-input-header input::placeholder {
    color: #94a3b8;
    font-weight: normal;
}

/* Phần nhập nội dung (Textarea) */
.chat-input-box textarea {
    border: none !important;
    background: transparent;
    outline: none;
    resize: none;
    width: 100%;
    max-height: 100px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #1e293b;
    padding: 0 !important;
}

/* Nút Gửi */
#btn-send-comment {
    background: var(--primary-blue, #004a99);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.1s, background 0.2s;
    margin-bottom: 2px;
    /* Canh cho vừa vặn với đáy của textarea */
}

#btn-send-comment:hover {
    background: #003875;
    transform: scale(1.05);
}


/* Header chứa Tên và Nút chức năng */
.chat-input-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Đẩy nút qua phải */
    color: var(--primary-blue, #004a99);
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 4px;
}

.chat-input-header input {
    border: none;
    background: transparent;
    outline: none;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-blue, #004a99);
    width: 100%;
    transition: all 0.2s;
    padding: 2px 4px;
}

.chat-input-header input::placeholder {
    color: #94a3b8;
    font-weight: normal;
}

/* Khi bị khóa (Readonly) -> Nhìn như văn bản bình thường */
.chat-input-header input[readonly] {
    cursor: default;
}

/* Khi đang chỉnh sửa (Bỏ readonly) -> Hiện khung viền mờ */
.chat-input-header input:not([readonly]) {
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 0 2px #dbeafe;
    /* Xanh nhạt bao quanh */
}

/* CSS cho Nút Edit & Save */
.btn-user-action {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-user-action:hover {
    background: #e2e8f0;
    color: var(--primary-blue, #004a99);
}



.class-block__name {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Đảm bảo dấu ... hiển thị */
    word-break: break-word;
}




/* Nút nổi Floating Action Button */
#btn-floating-chat-header {
    position: fixed;
    bottom: 25px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary-blue, #004a99);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 74, 153, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: transform 0.2s ease, background 0.2s ease;
}

.floating-chat-btn:hover {
    cursor: pointer;
    background: #003875;
}

/* Header chia 2 Tab */
.chat-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.chat-tab-group {
    display: flex;
    gap: 4px;
    background: #e2e8f0;
    padding: 4px;
    border-radius: 8px;
}

.chat-tab-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-tab-btn.active {
    background: #ffffff;
    color: var(--primary-blue, #004a99);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* KHỐI ĐIỀU HƯỚNG TAB TRÊN ĐẦU KHUNG CHAT */
.comment-nav-wrapper {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

/* Hàng 1: Tab Lớn (Cộng đồng / Admin) */
.main-tabs-row {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
}

.main-tab-item {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    text-align: center;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.main-tab-item.active {
    color: var(--primary-blue, #004a99);
    border-bottom: 2px solid var(--primary-blue, #004a99);
    background: #ffffff;
}

/* Hàng 2: Lọc theo Nhóm tổ (Pill Tabs) */
.sub-filter-row {
    display: flex;
    gap: 8px;
    padding: 8px 15px;
    overflow-x: auto;
    background: #f1f5f9;
}

.sub-tab-pill {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.sub-tab-pill.active {
    background: var(--primary-blue, #004a99);
    color: #ffffff;
    border-color: var(--primary-blue, #004a99);
}

/* Hiệu ứng mượt mà cho tin nhắn */
.chat-bubble-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 12px;
}

#user-current-avatar,
.chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: contain;
}


#avatar-list-container img {
    object-fit: contain;

}



.chat-bubble {
    background: #ffffff;
    padding: 10px 14px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    max-width: 82%;
}

.chat-author {
    font-weight: 600;
    font-size: 0.8rem;
    color: #475569;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.chat-bubble-container.is-admin .chat-author-name {
    color: #e11d48;
    font-weight: 700;
}

.chat-time {
    font-weight: normal;
    font-size: 0.7rem;
    color: #94a3b8;
}

.chat-text {
    font-size: 0.9rem;
    color: #1e293b;
    line-height: 1.45;
    word-break: break-word;
}

/* Tin nhắn của mình (Bên phải) */
.chat-bubble-container.is-mine {
    flex-direction: row-reverse;
}

.chat-bubble-container.is-mine .chat-bubble {
    background: #e0f2fe;
    /* Màu xanh nước biển nhạt */
    border-radius: 16px;
    border-bottom-right-radius: 4px;
}

.chat-bubble-container.is-admin .chat-bubble {
    background: #ffffff;
    border: 1px solid #ffffff;
    border-left: 3px solid #72b8e5;
    border-radius: 16px;
    box-shadow: 0 3px 10px rgba(37, 99, 145, 0.1);
}

.chat-bubble-container:not(.is-admin):not(.is-mine) .chat-bubble {
    background: #ffffff;
    border: 1px solid #ffffff;
}

.chat-bubble-container.is-admin.is-mine .chat-bubble {
    background: #e0f2fe;
    border-bottom-right-radius: 5px;
    border-left: 1px solid #d2eaf8;
    border-right: 3px solid #72b8e5;
}

.chat-bubble-container.is-admin:not(.is-mine) .chat-bubble {
    border-bottom-left-radius: 5px;
}

.chat-bubble-container.is-mine .chat-author {
    color: var(--primary-blue, #004a99);
}


#btn-floating-chat {
    position: static !important;
    width: 35px !important;
    height: 35px !important;
    border-radius: 8px !important;
    border: 1px solid gray !important;
    background: transparent !important;
    color: var(--primary-blue) !important;
    box-shadow: none !important;
    padding: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
}


#btn-floating-chat svg {
    width: 18px !important;
    height: 18px !important;
}

@media (max-width:768px) {
    #btn-floating-chat-header {
        display: none;
    }
#btn-floating-chat svg {
    width: 18px !important;
    height: 18px !important;
}

    .header-right {
        gap: 8px !important;
    }
}



/* =========================================
   STYLE CHO NÚT THÙNG RÁC VÀ BẢNG NHÓM TỔ
========================================= */

/* Nút xóa thùng rác trên Desktop */
.btn-delete-row {
    background-color: #fff;
    border: 1px solid #fee2e2;
    color: #ef4444;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0 auto;
}

.btn-delete-row .icon-trash {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.btn-delete-row:hover {
    background-color: #dc2525;
    border-color: #dc2525;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(220, 37, 37, 0.25);
}

.btn-delete-row:hover .icon-trash {
    transform: scale(1.1);
}

.btn-delete-row:active {
    transform: scale(0.95);
}

/* Định dạng màu số lượng */
.text-danger {
    color: #dc2626 !important;
}

.text-warning {
    color: #d97706 !important;
}

/* =========================================
   RESPONSIVE TRÊN MOBILE (<= 768px)
========================================= */

#nhomTo__Ctn .col-delete {
    width: 5% !important;
}

@media (max-width: 768px) {
    #nhomTo__Ctn .col-delete {
        width: 10% !important;
    }

    /* Ẩn cột mã môn nếu màn hình quá hẹp */
    .nhomTo__table-rowdata .col-mamon,
    .nhomTo__table th.col-mamon {
        display: none !important;
    }

    /* Thu nhỏ nút thùng rác cho vừa ngón tay chạm */
    .btn-delete-row {
        width: 28px;
        height: 28px;
    }

    .btn-delete-row .icon-trash {
        width: 14px;
        height: 14px;
    }

    /* Canh chỉnh khoảng cách các ô trên mobile */
    .nhomTo__table-rowdata td {
        padding: 6px 4px !important;
        font-size: 0.8rem !important;
    }

    .nhomTo__table-rowdata .col-tenmon {
        font-size: 0.8rem !important;
        word-break: break-word;
    }

    .comment-footer {
        margin-bottom: 70px;
    }

    .attention_number {
        display: block;
    }
}

/* =========================================
   DARK MODE CHO NÚT THÙNG RÁC
========================================= */
body.dark-mode .btn-delete-row {
    background-color: #2d2e30;
    border-color: #4b2323;
    color: #f87171;
}

body.dark-mode .btn-delete-row:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}



/* Màu vàng cho số lượng quan tâm */
.vote-tag {
    color: green;
    font-weight: 700;
    font-size: 0.85em;
    margin-left: 3px;
    display: inline-block;
}

/* Nhãn tín chỉ đi kèm */
.tc-badge {
    color: green;
    font-size: 0.8em;
    margin-left: 4px;
}

/* Chế độ Dark Mode */
body.dark-mode .vote-tag {
    color: #facc15;
}

body.dark-mode .tc-badge {
    color: #94a3b8;
}


html.dark-mode,
.dark-mode * {
    scrollbar-color: #4a4b4d #18191a;
    scrollbar-width: thin;
}


html.dark-mode ::-webkit-scrollbar,
.dark-mode::-webkit-scrollbar,
body.dark-mode::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background-color: #18191a;
}


html.dark-mode ::-webkit-scrollbar-track,
.dark-mode::-webkit-scrollbar-track,
body.dark-mode::-webkit-scrollbar-track {
    background-color: #18191a;
}


html.dark-mode ::-webkit-scrollbar-thumb,
.dark-mode::-webkit-scrollbar-thumb,
body.dark-mode::-webkit-scrollbar-thumb {
    background-color: #4a4b4d;
    border-radius: 6px;
    border: 2px solid #18191a;
}

/* Khi rê chuột vào con trượt */
html.dark-mode ::-webkit-scrollbar-thumb:hover,
.dark-mode::-webkit-scrollbar-thumb:hover,
body.dark-mode::-webkit-scrollbar-thumb:hover {
    background-color: #6a6b6d;
}

html.dark-mode ::-webkit-scrollbar-corner,
.dark-mode::-webkit-scrollbar-corner,
body.dark-mode::-webkit-scrollbar-corner {
    background-color: #18191a;
}


.preview-filter-btn {
    display: none;
    height: 35px;
    padding: 0 14px;
    border: 1px solid var(--primary-blue);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.preview-filter-btn:hover {
    background: var(--primary-blue);
    color: #fff;
}

@media (max-width: 1024px) {
    .preview-filter-btn {
        display: inline-flex;
    }

    .modal-sidebar {
        display: none;
        width: 100% !important;
        flex: 0 0 auto;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color);
        background: #fdfdfd;
        padding: 15px;
        animation: slideDownFilter 0.25s ease-out;
    }


    .modal-sidebar.is-open {
        display: flex !important;
        flex-direction: column;
    }
}

@keyframes slideDownFilter {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


body.dark-mode .preview-filter-btn {
    background: #2d2e30;
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

body.dark-mode .preview-filter-btn:hover {
    background: var(--primary-blue);
    color: #fff;
}

body.dark-mode .modal-sidebar {
    background-color: #242526;
    border-color: var(--border-color) !important;
}














/* ưeqfqfq */

/* =========================================
   STYLE BỘ LỌC TKB DẠNG LƯỚI MATRIX
========================================= */
.matrix-grid-wrapper {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 5px;
}

.filter-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    user-select: none;
}

.filter-matrix-table th,
.filter-matrix-table td {
    border: 1px solid var(--border-color);
    text-align: center;
    padding: 6px 2px;
    height: 28px;
    cursor: pointer;
    transition: all 0.15s ease;
}

/* Tiêu đề Thứ và Tiết */
.matrix-day-header, .matrix-period-header {
    background-color: #f1f5f9;
    font-weight: 700;
    color: var(--primary-blue);
}

.matrix-day-header:hover, .matrix-period-header:hover {
    background-color: #e2e8f0;
}

.matrix-corner {
    background-color: #e2e8f0;
    color: #dc3545;
    font-weight: bold;
    font-size: 0.7rem;
}

/* Ô Trạng thái Né Tiết */
.matrix-cell {
    background-color: #ffffff;
}

.matrix-cell:hover {
    background-color: #e7f3ff;
}

/* Khi Ô được CHỌN NÉ (Active) */
.matrix-cell.selected-block {
    background-color: #ff4d4d !important;
    color: white !important;
    font-weight: bold;
    position: relative;
}

.matrix-cell.selected-block::after {
    content: "✕";
    font-size: 0.8rem;
}

/* Style khi ở Chế độ Dark Mode */
body.dark-mode .matrix-grid-wrapper {
    background: #242526;
}

body.dark-mode .filter-matrix-table th,
body.dark-mode .filter-matrix-table td {
    border-color: #3a3b3c;
}

body.dark-mode .matrix-day-header,
body.dark-mode .matrix-period-header {
    background-color: #2d2e30;
    color: #5b9dff;
}

body.dark-mode .matrix-cell {
    background-color: #1a1a1a;
}

body.dark-mode .matrix-cell.selected-block {
    background-color: #dc2626 !important;
}
/* =========================================
   STYLE MODAL BỘ LỌC LƯỚI NÉ TIẾT
========================================= */
.matrix-modal-container {
    width: min(96vw, 1080px);
    max-width: none !important;
    height: min(94vh, 900px) !important;
    height: min(94dvh, 900px) !important;
    max-height: 94vh !important;
    max-height: 94dvh !important;
    display: flex;
    flex-direction: column;
}

.matrix-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}

.matrix-instruction {
    flex: 0 0 auto;
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-main);
    background-color: #f1f5f9;
    padding: 7px 10px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
    line-height: 1.35;
}

.matrix-table-wrapper {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.matrix-grid-table {
    width: 100% !important;
    height: auto;
    min-width: 0 !important;
    border-collapse: collapse;
    table-layout: fixed;
}

.matrix-grid-table th,
.matrix-grid-table td {
    border: 1px solid var(--border-color);
    text-align: center;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1;
    user-select: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.matrix-grid-table th:first-child {
    width: 76px;
}

.matrix-grid-table thead tr {
    height: clamp(28px, calc((94dvh - 180px) / 14), 38px);
}

.matrix-grid-table tbody tr {
    height: clamp(28px, calc((94dvh - 180px) / 14), 38px);
}

/* Header Tiêu đề */
.matrix-head-day, .matrix-head-period {
    background-color: #f8f9fa;
    font-weight: 700;
    color: var(--primary-blue);
    cursor: pointer;
}

.matrix-head-day:hover, .matrix-head-period:hover {
    background-color: #e2e8f0;
}

.matrix-btn-reset {
    background-color: #fee2e2;
    color: #dc2626;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.75rem;
}

/* Các Ô Tiết trong Bảng */
.matrix-cell-slot {
    background-color: #ffffff;
    cursor: pointer;
    min-width: 0;
}

.matrix-cell-slot:hover {
    background-color: #e0f2fe;
}

/* TRẠNG THÁI Ô ĐƯỢC CHỌN NÉ (TÔ ĐỎ) */
.matrix-cell-slot.is-blocked {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    font-weight: 700;
    position: relative;
}

.matrix-cell-slot.is-blocked::after {
    content: none;
}

/* Footer Modal */
.matrix-modal-footer {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: #f8f9fa;
}

/* DARK MODE SUPPORT */
body.dark-mode .matrix-instruction {
    background-color: #2d2e30;
    color: #e4e6eb;
}

body.dark-mode .matrix-head-day,
body.dark-mode .matrix-head-period {
    background-color: #1a1a1a;
    color: #5b9dff;
}

body.dark-mode .matrix-cell-slot {
    background-color: #242526;
}

body.dark-mode .matrix-cell-slot.is-blocked {
    background-color: #dc2626 !important;
    color: #ffffff !important;
}

body.dark-mode .matrix-modal-footer {
    background-color: #1c1d1e;
    border-color: var(--border-color);
}

.matrix-head-day,
.matrix-head-period,
.matrix-btn-reset button {
    width: 100%;
    border: 0;
    padding: 2px 3px;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: 1;
    cursor: pointer;
}

.matrix-head-day[aria-pressed="true"],
.matrix-head-period[aria-pressed="true"] {
    background-color: #dbeafe;
    border-radius: 4px;
}

#availability-matrix thead th.has-selected-day {
    background-color: #fee2e2 !important;
}

#availability-matrix thead th.has-selected-day .matrix-head-day {
    background-color: transparent !important;
    color: #b91c1c !important;
}

.matrix-head-period span,
.matrix-head-period small {
    display: block;
}

.matrix-head-period small {
    font-size: 0.68rem;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
}

.matrix-cell-slot:focus-visible,
.matrix-head-day:focus-visible,
.matrix-head-period:focus-visible,
.matrix-btn-reset button:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: -2px;
}

.matrix-selection-summary {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.matrix-clear-btn {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 9px 14px;
    background: #fff;
    color: #b91c1c;
    font-weight: 700;
    cursor: pointer;
}

.matrix-clear-btn:hover {
    background: #fee2e2;
}

body.dark-mode .matrix-head-day[aria-pressed="true"],
body.dark-mode .matrix-head-period[aria-pressed="true"] {
    background-color: #263b55;
}

body.dark-mode #availability-matrix thead th.has-selected-day {
    background-color: #4b2424 !important;
}

body.dark-mode #availability-matrix thead th.has-selected-day .matrix-head-day {
    background-color: transparent !important;
    color: #fca5a5 !important;
}

body.dark-mode .matrix-clear-btn {
    background: #242526;
    color: #f87171;
}

body.dark-mode .matrix-clear-btn:hover {
    background: #3b2527;
}

@media (max-width: 600px) {
    .matrix-modal-container {
        width: 100vw;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        border-radius: 0;
    }

    .matrix-modal-container .modal-header {
        flex: 0 0 auto;
        padding: 9px 12px;
    }

    .matrix-modal-container .modal-header h2 {
        font-size: 1rem;
    }

    .matrix-modal-body {
        padding: 8px !important;
        gap: 6px;
    }

    .matrix-instruction {
        font-size: 0.7rem;
        padding: 5px 7px;
        line-height: 1.25;
    }

    .matrix-grid-table {
        min-width: 0;
    }

    .matrix-grid-table th:first-child {
        width: 52px;
    }

    .matrix-grid-table thead tr,
    .matrix-grid-table tbody tr {
        height: clamp(24px, calc((94dvh - 180px) / 14), 34px);
    }

    .matrix-grid-table th,
    .matrix-grid-table td {
        padding: 0 !important;
        font-size: 0.67rem;
        line-height: 1;
    }

    .matrix-head-period span {
        font-size: 0.58rem;
        line-height: 1;
        white-space: nowrap;
    }

    .matrix-head-period small {
        line-height: 1;
    }

    .matrix-head-day,
    .matrix-head-period,
    .matrix-btn-reset button {
        padding: 2px 1px;
    }

    .matrix-head-period small {
        font-size: 0.52rem;
        letter-spacing: -0.03em;
    }

    .matrix-modal-footer {
        padding: 8px 10px;
    }
}

.timetable-filter-trigger {
    display: flex !important;
    width: 100%;
    justify-content: center;
    margin: 0 0 8px;
    white-space: nowrap;
}

.busy-filter-summary {
    min-width: 0;
    margin: 0 0 14px;
    padding: 8px 9px;
    border: 1px solid #bfdbfe;
    border-radius: 9px;
    background: #fff;
    color: #334155;
}

.busy-filter-summary__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
    color: #1e3a5f;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.busy-filter-summary__heading button {
    border: 0;
    padding: 1px 5px;
    background: transparent;
    color: #b91c1c;
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
}

.busy-filter-summary__heading button[hidden] {
    display: none;
}

#busy-filter-empty {
    margin: 0;
    color: #64748b;
    font-size: 0.78rem;
}

.busy-day-summary {
    display: flex;
    min-width: 0;
}

.busy-day-chip {
    display: -webkit-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 3px 5px;
    border: 0;
    border-radius: 5px;
    background: #fff;
    color: #1d4ed8;
    font: inherit;
    font-size: 0.72rem;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: ellipsis;
}

.busy-day-chip:hover,
.preference-summary-chip:hover {
    border-color: var(--primary-blue);
}

.busy-day-chip strong {
    flex: 0 0 auto;
    color: #1d4ed8;
}

.preference-filter-trigger {
    display: flex !important;
    width: 100%;
    justify-content: center;
    gap: 7px;
    margin: 0 0 8px;
    white-space: nowrap;
}

.preference-filter-summary {
    margin: 0 0 14px;
    padding: 8px 9px;
    border: 1px solid #bfdbfe;
    border-radius: 9px;
    background: #f8fbff;
}

.preference-filter-summary[hidden] {
    display: none;
}

.preference-filter-summary .busy-filter-summary__heading {
    color: #1e3a5f;
}

.preference-filter-summary .busy-filter-summary__heading button {
    color: #b91c1c;
}

.preference-summary-list {
    display: flex;
    min-width: 0;
}

.preference-summary-chip {
    display: -webkit-box;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 3px 7px;
    border: 0;
    border-radius: 5px;
    background: #f8fbff;
    color: #1d4ed8;
    font: inherit;
    font-size: 0.68rem;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: ellipsis;
}

.preference-modal-container {
    width: min(94vw, 980px);
    height: min(88vh, 760px) !important;
    height: min(88dvh, 760px) !important;
    max-width: none !important;
    max-height: 88vh !important;
    max-height: 88dvh !important;
}

.preference-modal-header {
    flex: 0 0 auto;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
}

.preference-modal-header > div {
    min-width: 0;
}

.preference-modal-header h2 {
    width: auto;
    justify-content: flex-start;
    font-size: 1.15rem;
}

.preference-modal-header p {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 0.82rem;
}

.preference-modal-header .btn-close-modal {
    flex: 0 0 auto;
}

.preference-modal-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 10px;
    padding: 14px;
    overflow: hidden;
    background: #f8fafc;
}

.preference-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: #475569;
    font-size: 0.76rem;
}

.preference-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.preference-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.preference-legend-dot--want {
    background: #16a34a;
}

.preference-legend-dot--avoid {
    background: #dc2626;
}

.preference-course-list {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 9px;
    overflow-y: auto;
    padding: 1px 4px 2px 1px;
}

.preference-course-card {
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 2px 8px rgb(15 23 42 / .035);
}

.preference-course-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
    border-bottom: 1px solid #eef2f6;
    background: #fafbff;
}

.preference-course-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
}

.preference-course-code {
    flex: 0 0 auto;
    padding: 4px 7px;
    border-radius: 6px;
    background: #eaf1ff;
    color: #2457a7;
    font-size: 0.68rem;
    font-weight: 800;
}

.preference-course-name {
    overflow: hidden;
    color: #1e293b;
    font-size: 0.84rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preference-course-meta {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 0.69rem;
}

.preference-group-list,
.preference-teacher-list {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-top: 1px solid #eef2f6;
}

.preference-group-list {
    align-items: flex-start;
}

.preference-teacher-heading {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 700;
    white-space: nowrap;
}

.preference-group-heading {
    color: #2563a8;
}

.preference-instructor-heading {
    color: #2563a8;
}

.preference-group-options {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

.preference-group-option {
    display: inline-flex;
    align-items: center;
    flex: 0 1 auto;
    gap: 5px;
    max-width: 100%;
    padding: 4px 7px;
    border: 1px solid #dbe3ed;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    font-size: 0.68rem;
    cursor: pointer;
}

.preference-group-option input {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    border: 1.5px solid #94a3b8;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.preference-group-option input:checked {
    border-color: var(--primary-blue);
    background: var(--primary-blue);
}

.preference-group-option strong {
    min-width: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.preference-group-option:hover,
.preference-teacher-option:hover {
    border-color: #a5b4fc;
}

.preference-teacher-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 100%;
}

.preference-teacher-option {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 4px 7px;
    border: 1px solid #dbe3ed;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    font-size: 0.68rem;
    cursor: pointer;
}

.preference-teacher-option input {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    border: 1.5px solid #94a3b8;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.preference-teacher-option input:checked {
    border-color: var(--primary-blue);
    background: var(--primary-blue);
}

.preference-group-option input:not(:checked),
.preference-teacher-option input:not(:checked) {
    border-color: #fda4af;
    background: #fff1f2;
}

.preference-group-option input:focus-visible,
.preference-teacher-option input:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.preference-teacher-option strong {
    min-width: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.preference-teacher-option:hover {
    border-color: #fca5a5;
}

.preference-group-option.is-selected {
    border-color: #dbe3ed;
    background: #fff;
    color: #475569;
}

.preference-teacher-option.is-selected {
    border-color: #dbe3ed;
    background: #fff;
    color: #475569;
}

.preference-group-option.is-excluded,
.preference-teacher-option.is-excluded {
    border-color: #fecdd3;
    background: #fff1f2;
    color: #9f1239;
}

.preference-modal-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.preference-modal-footer > div {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.preference-demo-note {
    color: #64748b;
    font-size: 0.72rem;
}

.preference-modal-footer .btn-primary {
    padding: 9px 18px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.busy-day-chip span {
    color: #475569;
}

body.dark-mode .busy-filter-summary {
    border-color: #36506f;
    background: linear-gradient(135deg, #202b39, #202938);
    color: #e2e8f0;
}

body.dark-mode .busy-filter-summary__heading {
    color: #bfdbfe;
}

body.dark-mode #busy-filter-empty,
body.dark-mode .busy-day-chip {
    border-color: #3a4d65;
    background: #202c39;
    color: #bfdbfe;
}

body.dark-mode .busy-day-chip strong {
    color: #93c5fd;
}

body.dark-mode .preference-filter-summary {
    border-color: #36506f;
    background: #202b39;
}

body.dark-mode .preference-filter-summary .busy-filter-summary__heading,
body.dark-mode .preference-filter-summary .busy-filter-summary__heading {
    color: #bfdbfe;
}

body.dark-mode .preference-filter-summary .busy-filter-summary__heading button {
    color: #b91c1c;
}

body.dark-mode .preference-summary-chip {
    background: #202b39;
    color: #bfdbfe;
}

body.dark-mode .preference-modal-body {
    background: #1d1f23;
}

body.dark-mode .preference-course-card,
body.dark-mode .preference-modal-footer {
    border-color: #3c3d42;
    background: #242526;
}

body.dark-mode .preference-course-header {
    border-color: #3c3d42;
    background: #292a2e;
}

body.dark-mode .preference-course-name {
    color: #e5e7eb;
}

body.dark-mode .preference-course-meta,
body.dark-mode .preference-demo-note {
    color: #a1a1aa;
}

body.dark-mode .preference-group-option,
body.dark-mode .preference-teacher-option {
    border-color: #4b5563;
    background: #242526;
    color: #d1d5db;
}

body.dark-mode .preference-group-option.is-excluded,
body.dark-mode .preference-teacher-option.is-excluded {
    border-color: #7f3b4b;
    background: #38272b;
    color: #fda4af;
}

body.dark-mode .preference-group-option input,
body.dark-mode .preference-teacher-option input {
    border-color: #6b7280;
    background: #202124;
}

body.dark-mode .preference-group-option input:checked {
    border-color: var(--primary-blue);
    background: var(--primary-blue);
}

body.dark-mode .preference-teacher-option input:checked {
    border-color: var(--primary-blue);
    background: var(--primary-blue);
}

body.dark-mode .preference-group-option input:not(:checked),
body.dark-mode .preference-teacher-option input:not(:checked) {
    border-color: #9f5360;
    background: #38272b;
}

body.dark-mode .filter-shortcut .busy-filter-summary,
body.dark-mode .filter-shortcut .preference-filter-summary {
    border-color: #36506f;
    background: #202b39;
}

body.dark-mode .preference-group-list,
body.dark-mode .preference-teacher-list {
    border-color: #3c3d42;
}

body.dark-mode .preference-teacher-heading {
    color: #a1a1aa;
}

body.dark-mode .preference-group-heading {
    color: #93c5fd;
}

body.dark-mode .preference-instructor-heading {
    color: #93c5fd;
}

@media (max-height: 700px) and (max-width: 1024px) {
    .busy-filter-summary {
        padding: 2px 6px;
    }

    .busy-filter-summary__heading {
        margin-bottom: 1px;
        font-size: 0.66rem;
    }

    .busy-day-summary {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 2px;
    }

    .busy-day-chip {
        min-width: 0;
        overflow: hidden;
        gap: 2px;
        padding: 1px 3px;
        font-size: 0.5rem;
    }

    .busy-day-chip span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .busy-day-chip.is-long {
        grid-column: span 2;
    }

    .busy-day-chip.is-long span {
        overflow: visible;
        overflow-wrap: anywhere;
        text-overflow: clip;
        white-space: normal;
    }

}

.filter-shortcut .busy-day-chip.is-long span {
    display: inline;
    overflow: visible;
    overflow-wrap: anywhere;
}

.filter-shortcut .busy-day-summary {
    display: block;
}

.filter-shortcut .busy-day-chip {
    display: -webkit-box;
    width: 100%;
    grid-column: 1 / -1;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

@media (max-width: 600px) {
    .busy-filter-summary {
        padding: 8px 9px;
    }

    .filter-bottom {
        max-height: 82%;
        padding-top: 10px;
    }

    .filter-shortcuts {
        flex-basis: auto;
        gap: 10px;
        height: auto;
        max-height: 200px;
    }

    .filter-shortcut .preview-filter-btn {
        min-height: 33px;
    }

    .filter-shortcut .busy-filter-summary,
    .filter-shortcut .preference-filter-summary {
        max-height: 54px;
        padding: 3px 5px;
    }

    .filter-shortcut .busy-filter-summary__heading {
        margin-bottom: 0;
        font-size: 0.64rem;
    }

    .filter-shortcut .busy-day-chip,
    .filter-shortcut .preference-summary-chip {
        padding: 1px 3px;
        font-size: 0.62rem;
    }

    .busy-day-chip {
        font-size: 0.66rem;
        padding: 2px 6px;
    }

    .preference-filter-summary {
        padding: 7px 8px;
    }

    .preference-modal-container {
        width: 100vw;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        border-radius: 0;
    }

    .preference-modal-header {
        padding: 10px 12px;
    }

    .preference-modal-header h2 {
        font-size: 1rem;
    }

    .preference-modal-body {
        gap: 7px;
        padding: 8px;
    }

    .preference-legend {
        gap: 10px;
        font-size: 0.68rem;
    }

    .preference-course-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
        padding: 8px;
    }

    .preference-course-name {
        font-size: 0.75rem;
    }

    .preference-course-meta {
        padding-left: 1px;
        font-size: 0.63rem;
    }

    .preference-group-list,
    .preference-teacher-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 7px 8px;
    }

    .preference-group-options {
        gap: 4px;
    }

    .preference-group-option {
        padding: 3px 5px;
        font-size: 0.62rem;
    }

    .preference-teacher-options {
        gap: 4px;
    }

    .preference-teacher-option {
        padding: 3px 5px;
        font-size: 0.62rem;
    }

    .preference-modal-footer {
        padding: 8px;
    }

    .preference-demo-note {
        max-width: 125px;
        font-size: 0.62rem;
        line-height: 1.2;
    }

    .preference-modal-footer .matrix-clear-btn,
    .preference-modal-footer .btn-primary {
        padding: 8px 10px;
        font-size: 0.75rem;
    }
}

.withdrawal-link {
    color: #000;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: underline;
}

.withdrawal-link:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

body.dark-mode .withdrawal-link {
    color: #fff;
}

body.dark-mode .withdrawal-link:focus-visible {
    outline-color: #93c5fd;
}