/*
| He so chu toan he thong.
|
| Moi co chu px trong tep nay va trong tailadmin-shell.css deu nhan voi
| bien nay, con co chu khai bang rem thi neo vao html{font-size} ben duoi
| (cung nhan he so). Muon to/nho hon chi sua DUNG mot so o day.
|
|   1    = co goc
|   1.3  = to hon 30%
|   1.17 = to hon 17% (dang dung: 1.3 roi ha 10%)
*/
:root {
    --sis-font-scale: 1.17;
}

/*
| Thang chữ chung toàn hệ thống (SIS).
|
| Vì sao có file này: giao diện gốc dùng bộ chữ nén 10.5-13px rải rác ở nhiều
| stylesheet với !important, chỉnh từng chỗ vừa dễ sót vừa dễ lệch. File này nạp
| SAU CÙNG và khai báo lại cỡ chữ theo từng nhóm phần tử để cả hệ thống dùng
| chung một thang, chỉnh hoặc gỡ chỉ ở một nơi.
|
| Thang áp dụng (nén -> dễ đọc):
|   nền trang 13 -> 14.5 | bảng 12 -> 13.5 | nhãn 11.5 -> 13
|   ô nhập 12 -> 14      | nút 12 -> 14    | chú thích 11 -> 12.5
|
| Selector nhân đôi lớp (.edu-compact-theme.edu-compact-theme) để đủ độ ưu tiên
| so với các rule [data-page-family] trong bộ CSS gốc, không cần tăng !important.
*/

.edu-compact-theme {
    --edu-font-base: calc(15.5px * var(--sis-font-scale, 1.17));
    --edu-font-table: calc(14.5px * var(--sis-font-scale, 1.17));
    --edu-font-label: calc(14px * var(--sis-font-scale, 1.17));
    --edu-font-control: calc(15px * var(--sis-font-scale, 1.17));
    --edu-font-small: calc(13.5px * var(--sis-font-scale, 1.17));
    font-size: var(--edu-font-base);
    line-height: 1.5;
}

.edu-compact-theme.edu-compact-theme :where(.app-content, .portal-content, .fp-content, .hssv-main, .v-application, .app-page-shell) {
    font-size: var(--edu-font-base) !important;
    line-height: 1.5 !important;
}

/* Tiêu đề: giữ đúng thứ bậc, chỉ nâng đều một nấc. */
.edu-compact-theme.edu-compact-theme :where(h1, .h1) { font-size: calc(24px * var(--sis-font-scale, 1.17)) !important; }
.edu-compact-theme.edu-compact-theme :where(h2, .h2) { font-size: calc(20px * var(--sis-font-scale, 1.17)) !important; }
.edu-compact-theme.edu-compact-theme :where(h3, .h3) { font-size: calc(18px * var(--sis-font-scale, 1.17)) !important; }
.edu-compact-theme.edu-compact-theme :where(h4, .h4) { font-size: calc(16px * var(--sis-font-scale, 1.17)) !important; }
.edu-compact-theme.edu-compact-theme :where(h5, .h5) { font-size: calc(15px * var(--sis-font-scale, 1.17)) !important; }
.edu-compact-theme.edu-compact-theme :where(h6, .h6) { font-size: calc(14.5px * var(--sis-font-scale, 1.17)) !important; }

/* Thẻ / khối nội dung. */
.edu-compact-theme.edu-compact-theme :where(.card-header, .panel-heading, .box-header, .app-card__header, .ui-card__header, .sis-card__header) {
    font-size: calc(15px * var(--sis-font-scale, 1.17)) !important;
}

.edu-compact-theme.edu-compact-theme :where(.card-body, .panel-body, .box-body, .app-card__body, .ui-card__body, .sis-card__body) {
    font-size: var(--edu-font-base) !important;
}

/* Bảng dữ liệu: nâng vừa phải để vẫn xem được nhiều dòng. */
.edu-compact-theme.edu-compact-theme :where(table, .table, .dataTable) {
    font-size: var(--edu-font-table) !important;
}

.edu-compact-theme.edu-compact-theme :where(.table > thead > tr > th, .table > tbody > tr > td, table > thead > tr > th, table > tbody > tr > td) {
    font-size: var(--edu-font-table) !important;
    line-height: 1.45 !important;
}

/* Biểu mẫu. */
.edu-compact-theme.edu-compact-theme :where(label, .form-label, .control-label) {
    font-size: var(--edu-font-label) !important;
    line-height: 1.35 !important;
}

.edu-compact-theme.edu-compact-theme :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea, .form-control, .form-select, .select2-selection__rendered) {
    font-size: var(--edu-font-control) !important;
    min-height: calc(36px * var(--sis-font-scale, 1.17)) !important;
    line-height: 1.4 !important;
}

/*
| Ô chọn phải giữ kích thước ô chọn.
| Rule trên trước đây bắt cả input[type=checkbox]/[type=radio] nên min-height 36px
| kéo ô tick phình to bằng cả một ô nhập. Tách riêng và chốt kích thước thật.
*/
.edu-compact-theme.edu-compact-theme :where(input[type="checkbox"], input[type="radio"]) {
    width: calc(16px * var(--sis-font-scale, 1.17)) !important;
    height: calc(16px * var(--sis-font-scale, 1.17)) !important;
    min-height: 0 !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    vertical-align: middle !important;
}

.edu-compact-theme.edu-compact-theme :where(textarea, .form-control[rows]) {
    min-height: 0 !important;
}

.edu-compact-theme.edu-compact-theme :where(.form-text, .help-block, .invalid-feedback) {
    font-size: var(--edu-font-small) !important;
}

/* Nút. */
.edu-compact-theme.edu-compact-theme :where(.btn, button, [type="button"], [type="submit"], .v-btn) {
    font-size: var(--edu-font-control) !important;
    min-height: calc(34px * var(--sis-font-scale, 1.17)) !important;
    line-height: 1.3 !important;
}

.edu-compact-theme.edu-compact-theme :where(.btn-sm, .btn-xs, .v-btn--size-small) {
    font-size: calc(13px * var(--sis-font-scale, 1.17)) !important;
    min-height: calc(30px * var(--sis-font-scale, 1.17)) !important;
}

.edu-compact-theme.edu-compact-theme :where(.btn i, button i) {
    font-size: calc(13px * var(--sis-font-scale, 1.17)) !important;
}

/* Chữ phụ, nhãn trạng thái, điều hướng. */
.edu-compact-theme.edu-compact-theme :where(small, .small, .text-muted, .muted) {
    font-size: var(--edu-font-small) !important;
}

.edu-compact-theme.edu-compact-theme :where(.badge, .label, .chip, .tag, .status-pill) {
    font-size: calc(12px * var(--sis-font-scale, 1.17)) !important;
}

.edu-compact-theme.edu-compact-theme :where(.breadcrumb, .sis-breadcrumb, .erpui-menu-trail) {
    font-size: var(--edu-font-label) !important;
}

.edu-compact-theme.edu-compact-theme :where(.nav-link, .nav-tabs > li > a, .nav-pills > li > a, .pagination > li > a, .page-link) {
    font-size: var(--edu-font-control) !important;
}

/* Menu trái và thanh trên. */
.edu-compact-theme.edu-compact-theme :where(.app-sidebar a, .sidebar a, .app-sidebar .menu-item, .sidebar-menu a) {
    font-size: var(--edu-font-control) !important;
}

.edu-compact-theme.edu-compact-theme :where(.app-topbar, .sis-topbar, .portal-topbar, .navbar, .main-header) {
    font-size: var(--edu-font-control) !important;
}

/* Cảnh báo / thông báo. */
.edu-compact-theme.edu-compact-theme :where(.alert, .toast, .flash-message) {
    font-size: var(--edu-font-base) !important;
}

/*
| Gốc rem cho các màn khai cỡ chữ bằng rem.
|
| Nhiều màn danh sách (Lead, hồ sơ tuyển sinh, dashboard Marketing MIX / Lead Hub)
| khai font-size bằng rem với hệ số 0.68-0.86. rem neo vào <html>, không neo vào
| body, nên mọi thang px ở trên không với tới được: .68rem vẫn ra ~10.9px và chữ
| phụ nhỏ hơn chữ chính gần một nửa - đó là chỗ gây cảm giác lệch.
|
| Nâng gốc rem lên 17px kéo cả nhóm đó lên ~6% mà không phải sửa từng màn.
| Muốn to/nhỏ hơn nữa thì chỉ đổi đúng một con số này.
*/
html {
    font-size: calc(17px * var(--sis-font-scale, 1.17));
}

/*
| Sàn cỡ chữ cho chữ phụ: chốt dưới bằng px để hệ số rem nhỏ không tụt quá thấp,
| đồng thời vẫn theo rem khi rem lớn hơn sàn.
*/
.edu-compact-theme.edu-compact-theme :where(td, th) :where(small, .small, .text-muted, .muted, .cell-sub, .sub, .meta) {
    font-size: max(calc(13px * var(--sis-font-scale, 1.17)), .84rem) !important;
}

.edu-compact-theme.edu-compact-theme :where(.badge, .label, .chip, .tag, .status-pill) {
    font-size: max(calc(12.5px * var(--sis-font-scale, 1.17)), .76rem) !important;
}

/*
| Nút bên trong bảng: thu cỡ chữ và đệm cho vừa ô.
|
| Thang nút chung (15px, min-height 34px) đúng cho nút đứng riêng trên thanh công
| cụ, nhưng trong ô "Thao tác" thường có 3 nút liền nhau (Xem / Sửa / Xóa) nên cả
| nhóm tràn khỏi ô và chữ bị cắt. Ở đây hạ một nấc để nút vừa khung, không đổi
| cỡ nút ngoài bảng.
*/
.edu-compact-theme.edu-compact-theme :where(td, th) :where(.btn, button, .v-btn) {
    font-size: calc(12.5px * var(--sis-font-scale, 1.17)) !important;
    min-height: calc(28px * var(--sis-font-scale, 1.17)) !important;
    padding: 3px 8px !important;
    line-height: 1.25 !important;
}

.edu-compact-theme.edu-compact-theme :where(td, th) :where(.btn i, button i, .btn .fa, button .fa) {
    font-size: calc(12px * var(--sis-font-scale, 1.17)) !important;
    margin-right: 3px !important;
}

.edu-compact-theme.edu-compact-theme :where(td, th) :where(.btn-sm, .btn-xs) {
    font-size: calc(12px * var(--sis-font-scale, 1.17)) !important;
    min-height: calc(26px * var(--sis-font-scale, 1.17)) !important;
    padding: 2px 7px !important;
}

/* Giữ cả nhóm nút trên một dòng để không đội cao dòng bảng. */
.edu-compact-theme.edu-compact-theme :where(td) :where(.btn-group, .btn-toolbar) {
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}
