/* Style chuyên biệt cho Bảng Sổ đầu bài điện tử (sodaubai) */

.sdb-table-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
    position: relative;
    margin-bottom: 25px;
}

.table-sodaubai {
    margin-bottom: 0;
    font-size: 13px;
    border-collapse: collapse;
    width: 100%;
    background-color: #ffffff;
    border: 2px solid #222222;
}

.table-sodaubai thead th {
    background-color: #ffffff;
    color: #111827;
    text-align: center;
    vertical-align: middle !important;
    font-weight: 700;
    border: 1px solid #222222;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 6px 4px;
    line-height: 1.25;
}

.table-sodaubai thead tr:nth-child(2) th {
    top: 48px;
    background-color: #ffffff;
    border: 1px solid #222222;
}

.table-sodaubai tbody td {
    vertical-align: middle !important;
    border: 1px solid #222222;
    padding: 4px;
    background-color: #ffffff;
}

.table-sodaubai tbody tr:hover {
    background-color: #f8fafc;
}

/* Đường phân cách rõ rệt giữa các ngày và các buổi */
.table-sodaubai tbody tr.day-start td {
    border-top: 2.5px solid #000000 !important;
}

.table-sodaubai tbody tr.session-start td {
    border-top: 1.8px solid #222222 !important;
}

.table-sodaubai .col-center {
    text-align: center;
}

.table-sodaubai .day-col {
    background-color: #ffffff;
    font-weight: 700;
    color: #111827;
    text-align: center;
    vertical-align: middle !important;
    font-size: 14px;
    width: 65px;
    border-right: 1px solid #222222;
}

.table-sodaubai .session-col {
    background-color: #ffffff;
    font-weight: 600;
    color: #111827;
    text-align: center;
    vertical-align: middle !important;
    font-size: 13px;
    width: 60px;
    border-right: 1px solid #222222;
}

.table-sodaubai .period-col {
    text-align: center;
    font-weight: 700;
    color: #111827;
    font-size: 13px;
    width: 40px;
    vertical-align: middle !important;
}

.sdb-th-sub {
    font-weight: 400;
    font-size: 11px;
    color: #374151;
    display: inline-block;
    margin-top: 1px;
}

/* Các ô input trong bảng */
.sdb-input {
    width: 100%;
    padding: 4px 6px;
    font-size: 13px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out;
}

.sdb-input:focus {
    border-color: #1976d2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.sdb-input[readonly], .sdb-input[disabled] {
    background-color: #f8f9fa;
    color: #495057;
    cursor: not-allowed;
    border-color: #e9ecef;
}

.sdb-score-input {
    width: 55px;
    text-align: center;
    font-weight: 600;
}

.sdb-ppct-input {
    width: 50px;
    text-align: center;
}

/* Badge xếp loại */
.badge-rank {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    min-width: 65px;
    text-align: center;
}

.badge-rank-tot {
    background-color: #2e7d32;
    color: #fff;
}

.badge-rank-kha {
    background-color: #0288d1;
    color: #fff;
}

.badge-rank-dat {
    background-color: #f57c00;
    color: #fff;
}

.badge-rank-chuadat {
    background-color: #d32f2f;
    color: #fff;
}

/* Dòng tiết đã ký */
tr.row-signed {
    background-color: #fbfbfb;
}

tr.row-signed td {
    color: #333;
}

.sign-badge {
    color: #2e7d32;
    font-size: 12px;
    font-weight: bold;
}

/* Khung nhận xét cuối tuần */
.sdb-summary-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 16px;
    margin-bottom: 20px;
}

.avg-score-box {
    font-size: 28px;
    font-weight: bold;
    color: #0d47a1;
}

/* Thẻ thống kê đầu trang Admin */
.sdb-stat-row { margin-bottom: 15px; }
.sdb-stat-card { margin-bottom: 10px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); padding: 12px 10px; }
.sdb-stat-number { font-size: 26px; font-weight: bold; line-height: 1.2; }
.sdb-stat-label { font-size: 12px; text-transform: uppercase; font-weight: 600; }
.sdb-stat-blue { background: #e8f4fd; border: 1px solid #b8daff; }
.sdb-stat-blue .sdb-stat-number { color: #0056b3; }
.sdb-stat-blue .sdb-stat-label { color: #333; }
.sdb-stat-green { background: #eafaf1; border: 1px solid #c3e6cb; }
.sdb-stat-green .sdb-stat-number { color: #1e7e34; }
.sdb-stat-green .sdb-stat-label { color: #333; }
.sdb-stat-yellow { background: #fef9e7; border: 1px solid #ffeeba; }
.sdb-stat-yellow .sdb-stat-number { color: #856404; }
.sdb-stat-yellow .sdb-stat-label { color: #333; }
.sdb-stat-red { background: #fdf2e9; border: 1px solid #f5c6cb; }
.sdb-stat-red .sdb-stat-number { color: #721c24; }
.sdb-stat-red .sdb-stat-label { color: #333; }

/* Form & Bảng Giáo viên */
.sdb-action-bar { margin-bottom: 15px; }
.sdb-form-panel { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); margin-bottom: 20px; }
.sdb-form-heading { line-height: 28px; }
.sdb-form-heading-title { font-size: 15px; }
.sdb-form-body { background: #fafbfc; }
.sdb-method-well { background: #fff; border: 1px solid #dcdfe6; padding: 12px 15px; margin-bottom: 15px; }
.sdb-method-label { margin-bottom: 0; margin-right: 15px; font-weight: bold; color: #333; }
.sdb-radio-create { font-weight: 600; cursor: pointer; color: #0056b3; }
.sdb-radio-link { font-weight: 600; cursor: pointer; margin-left: 20px; color: #28a745; }
.sdb-link-box { background: #eef7fc; padding: 12px 15px; border-radius: 4px; border: 1px solid #bce8f1; margin-bottom: 15px; }
.sdb-edit-header-row { background: #eef2f7; padding: 10px 0; border-radius: 4px; margin-bottom: 15px; }
.sdb-badge-username { font-size: 14px; }
.sdb-status-active-label { cursor: pointer; font-weight: 600; color: #28a745; }
.sdb-status-inactive-label { cursor: pointer; font-weight: 600; color: #dc3545; margin-left: 20px; }
.sdb-btn-save-teacher { padding: 8px 30px; font-weight: bold; }
.sdb-btn-cancel-teacher { margin-left: 10px; }
.sdb-list-panel { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06); }
.sdb-filter-body { background: #f8f9fa; border-bottom: 1px solid #e9ecef; padding: 12px 15px 5px 15px; }
.sdb-filter-item { margin-bottom: 10px; margin-right: 8px; }
.sdb-filter-keyword { width: 220px; }
.sdb-table thead th { background: #f1f3f5; vertical-align: middle; }
.sdb-table tbody td { vertical-align: middle; }
.sdb-teacher-code { font-size: 12px; padding: 4px 6px; }
.sdb-teacher-name { font-size: 14px; }
.sdb-bday-badge { font-size: 11px; }
.sdb-sub-text { font-size: 11px; color: #888; }
.sdb-ajax-alert { padding: 12px 15px; margin-bottom: 15px; }
.sdb-field-msg { display: none; font-size: 12px; margin-top: 4px; }
.sdb-table th.col-stt { width: 45px; text-align: center; }
.sdb-table th.col-teacher-code { width: 85px; text-align: center; }
.sdb-table th.col-birthday { width: 110px; text-align: center; }
.sdb-table th.col-phone { width: 110px; text-align: center; }
.sdb-table th.col-campus { width: 85px; text-align: center; }
.sdb-table th.col-role { width: 120px; text-align: center; }
.sdb-table th.col-status { width: 125px; text-align: center; }
.sdb-table th.col-actions { width: 140px; text-align: center; }
.sdb-hr { margin: 10px 0 15px 0; }
.sdb-list-heading { line-height: 32px; font-size: 15px; }
.sdb-text-user-id { margin-left: 8px; }
.sdb-select-max-w { max-width: 450px; }
.sdb-status-group { padding-top: 6px; }

/* Phân công giảng dạy */
.sdb-classes-container {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.2s ease;
}
.sdb-class-group-well {
    margin-bottom: 10px;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}
.sdb-class-group-header {
    margin-bottom: 6px;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 4px;
}
.sdb-class-item {
    margin-bottom: 6px;
}
.sdb-class-checkbox-label {
    font-weight: normal;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 0;
}
.sdb-header-action-group {
    margin-bottom: 6px;
}
.sdb-table th.col-assign-check { width: 35px; text-align: center; }
.sdb-table th.col-assign-actions { width: 110px; text-align: center; }

/* Chip chọn lớp phong cách hiện đại */
.sdb-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
}
.sdb-chip-btn {
    display: inline-block;
    margin: 0;
    cursor: pointer;
    user-select: none;
}
.sdb-chip-btn input[type="checkbox"] {
    display: none;
}
.sdb-chip-btn .chip-content {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 18px;
    background: #fff;
    border: 1.5px solid #dcdfe6;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.18s ease;
}
.sdb-chip-btn .chip-content:hover {
    background: #f0f4f8;
    border-color: #b0c4de;
}
.sdb-chip-btn input[type="checkbox"]:checked + .chip-content {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.35);
}
.sdb-chip-btn .chip-icon {
    display: none;
    margin-right: 4px;
    font-size: 12px;
}
.sdb-chip-btn input[type="checkbox"]:checked + .chip-content .chip-icon {
    display: inline-block;
}
.sdb-chip-btn.grade-chip-6 input[type="checkbox"]:checked + .chip-content {
    background: #007bff;
    border-color: #007bff;
}
.sdb-chip-btn.grade-chip-7 input[type="checkbox"]:checked + .chip-content {
    background: #28a745;
    border-color: #28a745;
    box-shadow: 0 2px 5px rgba(40, 167, 69, 0.35);
}
.sdb-chip-btn.grade-chip-8 input[type="checkbox"]:checked + .chip-content {
    background: #fd7e14;
    border-color: #fd7e14;
    box-shadow: 0 2px 5px rgba(253, 126, 20, 0.35);
}
.sdb-chip-btn.grade-chip-9 input[type="checkbox"]:checked + .chip-content {
    background: #6f42c1;
    border-color: #6f42c1;
    box-shadow: 0 2px 5px rgba(111, 66, 193, 0.35);
}

/* Badge lớp theo khối */
.sdb-grade-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin: 2px;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.sdb-grade-pill-6 { background-color: #007bff; }
.sdb-grade-pill-7 { background-color: #28a745; }
.sdb-grade-pill-8 { background-color: #fd7e14; }
.sdb-grade-pill-9 { background-color: #6f42c1; }

/* Tabs phân công */
.sdb-assign-tabs {
    margin-bottom: -1px;
    border-bottom: 2px solid #e9ecef;
}
.sdb-assign-tabs > li > a {
    border-radius: 6px 6px 0 0;
    font-size: 13px;
    padding: 9px 16px;
    color: #495057;
}
.sdb-assign-tabs > li.active > a, 
.sdb-assign-tabs > li.active > a:focus, 
.sdb-assign-tabs > li.active > a:hover {
    border-top: 2px solid #007bff;
    color: #007bff;
    font-weight: bold;
    background: #fff;
}
.sdb-auto-note {
    background: #eef7fc;
    border: 1px dashed #bce8f1;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    margin-top: 6px;
    color: #0c5460;
    display: none;
}

/* Khối phân hiệu trong chọn lớp */
.sdb-campus-card {
    background: #fff;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.2s ease;
}
.sdb-campus-card:hover {
    border-color: #b8daff;
}
.sdb-campus-card-header {
    background: #f1f6fa;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 12px;
    line-height: 24px;
}
.sdb-campus-card-title {
    font-size: 13.5px;
    color: #1a365d;
}
.sdb-campus-card-body {
    padding: 10px 12px;
    background: #fafbfc;
}
.sdb-grade-row {
    padding: 6px 0;
    border-bottom: 1px dashed #e9ecef;
}
.sdb-grade-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.sdb-grade-header {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}
.sdb-btn-grade-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    min-width: 58px;
    margin-top: 4px;
}

/* Trang Hồ sơ cá nhân & Đổi mật khẩu */
.sdb-profile-avatar-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(30, 60, 114, 0.25);
    border: 3px solid #fff;
}
.sdb-profile-avatar-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border: 3px solid #fff;
}
.sdb-btn-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border: 2px solid #fff;
}
.sdb-avatar-modal-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    margin-bottom: 10px;
    border: 3px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sdb-header-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}
.sdb-profile-avatar-text {
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
}
.card-header-tabs .nav-link {
    color: #495057;
    border-top: 3px solid transparent;
}
.card-header-tabs .nav-link.active {
    color: #1e3c72;
    border-top: 3px solid #1e3c72;
    background-color: #fff;
}
