/* ==========================================================================
   TDTU FACULTY OF INFORMATION TECHNOLOGY - ENTERPRISE DESIGN SYSTEM
   BỘ QUY CHUẨN THIẾT KẾ GIAO DIỆN HỌC VỤ & RA QUYẾT ĐỊNH (OPTIMIZED UI/UX)
   
   1. BẢNG MÀU GIAO DIỆN CHỦ ĐẠO (CORE PALETTE):
      - Trắng (#ffffff): Nền app, thẻ card, bề mặt bảng dữ liệu, khoảng trắng thoáng đãng.
      - Xanh dương (#003087 - TDTU Navy Blue): Màu chủ đạo nhận diện, header, primary buttons, thanh điều hướng, liên kết, điểm nhấn.
      - Đỏ (#dc2626 - Alert Red): Màu nhấn/bổ trợ, CTA quan trọng, thông báo khẩn, hạn chót deadline, điểm chốt lưu ý.

   2. MÀU CHỮ ĐA DẠNG & TỐI ƯU ĐỘ TƯƠNG PHẢN (HIGH CONTRAST TYPOGRAPHY):
      - Trắng (#ffffff): Tuyệt đối cho TOÀN BỘ chữ trên nền xanh dương, nút primary, nền đỏ alert, banner tối màu.
      - Đen than (#1f2937): Toàn bộ văn bản thông thường, nhãn trường chính, số liệu, tiêu đề trên nền sáng.
      - Xám mô tả (#4b5563): Dành cho đoạn văn mô tả phụ, hướng dẫn, phụ chú giúp giảm tải thị giác.
      - Xanh dương TDTU (#003087): Dành cho tiêu đề thương hiệu, liên kết, mã số sinh viên, trạng thái chọn.
      - Đỏ cảnh báo (#dc2626): Dành cho tiêu đề cảnh báo, hạn chót, sinh viên cần hỗ trợ khẩn.
      - Xanh lá thành công (#15803d): Dành cho trạng thái đã duyệt, đã có nơi thực tập, đạt chuẩn ngoại ngữ.
      - Vàng hổ phách (#b45309): Dành cho trạng thái đang tìm nơi, chờ phỏng vấn, đang xử lý.

   3. CỠ CHỮ CHUẨN MỰC & DỄ NHÌN (ENHANCED READABLE FONT SIZES):
      - Body text cơ bản: 14px (chuẩn web hiện đại, dễ đọc, khoảng cách dòng thoáng 1.6).
      - Subtext / Metadata / Nhãn phụ: 12.5px - 13px.
      - Micro Badges / Pills: 11.5px - 12px.
      - Headings:
        * H1: 28px - 32px (font-bold)
        * H2: 22px - 24px (font-bold)
        * H3 / Widget Title: 17px - 18px (font-bold)
        * H4 / Section Title: 15px - 16px (font-bold)

   4. CĂN CHỈNH & BỐ CỤC:
      - Tiêu đề: text-left (card, table, list) hoặc text-center (banner, modal, page title).
      - Nội dung văn bản (đoạn văn mô tả dài): Căn đều hai bên (text-align: justify).
   ========================================================================== */

:root {
  /* Brand Primary Colors */
  --tdtu-blue: #003087;
  --tdtu-blue-hover: #002266;
  --tdtu-blue-active: #001a4d;
  --tdtu-blue-subtle: #ebf3ff;
  --tdtu-blue-border: #bfdbfe;

  /* Alert / Accent Colors */
  --tdtu-red: #dc2626;
  --tdtu-red-hover: #b91c1c;
  --tdtu-red-subtle: #fef2f2;
  --tdtu-red-border: #fecaca;

  /* Status Colors */
  --status-green: #15803d;
  --status-green-subtle: #f0fdf4;
  --status-green-border: #bbf7d0;
  --status-amber: #b45309;
  --status-amber-subtle: #fffbeb;
  --status-amber-border: #fde68a;

  /* Typography Colors */
  --text-main: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-white: #ffffff;
  --text-blue: #003087;
  --text-alert: #dc2626;

  /* Backgrounds & Surfaces */
  --bg-page: #ffffff;
  --bg-card: #ffffff;
  --border-subtle: #e5e7eb;
  --border-focus: #003087;

  /* Chart Muted/Pastel Palette */
  --chart-blue-1: #003087;
  --chart-blue-2: #2563eb;
  --chart-blue-3: #60a5fa;
  --chart-blue-4: #93c5fd;
  --chart-slate: #64748b;
  --chart-teal: #0d9488;
  --chart-amber: #d97706;
  --chart-red: #dc2626;
  --chart-steel: #475569;

  /* Strict Typography Sizes (Body: 11px - 13px, H1: 24-28px, H2: 18-20px, H3: 14-16px, Font-Weight: 700) */
  --font-body: 12.5px;
  --font-body-sm: 12px;
  --font-meta: 11.5px;
  --font-h1: 26px;
  --font-h2: 19px;
  --font-h3: 15px;
  --font-h4: 13.5px;
}

/* ==========================================================================
   GLOBAL RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page) !important;
  color: var(--text-main);
  font-family: 'Inter', 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--font-body);
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  background-color: var(--bg-page) !important;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ==========================================================================
   HIGH CONTRAST RULES: CHỮ TRẮNG TRÊN NỀN XANH DƯƠNG / NỀN TỐI / NÚT BẤM
   ========================================================================== */

/* Nền Xanh TDTU / Nền tối màu: BẮT BUỘC chữ trắng 100% */
.bg-\[\#003087\], .bg-\[\#002266\], .bg-blue-900, .bg-blue-800, .bg-blue-700,
.bg-tdtu-primary, .hero-pane, .left-hero {
  color: #ffffff !important;
}

.bg-\[\#003087\] h1, .bg-\[\#003087\] h2, .bg-\[\#003087\] h3, .bg-\[\#003087\] h4, .bg-\[\#003087\] p,
.bg-\[\#002266\] h1, .bg-\[\#002266\] h2, .bg-\[\#002266\] h3, .bg-\[\#002266\] h4, .bg-\[\#002266\] p,
.hero-pane h1, .hero-pane h2, .hero-pane h3, .hero-pane h4, .hero-pane p,
.left-hero h1, .left-hero h2, .left-hero h3, .left-hero h4, .left-hero p {
  color: #ffffff !important;
}

/* Các class text-white và màu sáng được bảo vệ toàn diện */
.text-white, .text-white-force {
  color: #ffffff !important;
}
.text-white *, .text-white-force * {
  color: inherit;
}

.text-blue-100 { color: #dbeafe !important; }
.text-blue-200 { color: #bfdbfe !important; }
.text-sky-100 { color: #e0f2fe !important; }
.text-sky-200 { color: #bae6fd !important; }

/* Buttons: Chữ trắng rõ ràng, kích thước chữ 13.5px - 14px */
.btn-primary, button.btn-primary, .btn-alert, button.btn-alert, .btn-cta, button.btn-cta {
  color: #ffffff !important;
}

.btn-primary *, button.btn-primary *, .btn-alert *, button.btn-alert *, .btn-cta *, button.btn-cta * {
  color: #ffffff !important;
}

/* ==========================================================================
   ENHANCED TYPOGRAPHY RULES (CỠ CHỮ TĂNG THÊM & PHÂN CẤP RÕ RÀNG)
   ========================================================================== */

/* Headings Hierarchy (Responsive clamp: giữ nguyên desktop H1 26px, H2 19px, H3 15px) */
h1, .h1, .ds-h1 {
  font-size: clamp(20px, 4.5vw, var(--font-h1)) !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 0;
}

h2, .h2, .ds-h2 {
  font-size: clamp(16.5px, 3.8vw, var(--font-h2)) !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin: 0;
}

h3, .h3, .ds-h3, .card-title, .section-title {
  font-size: clamp(14px, 3.2vw, var(--font-h3)) !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  color: var(--text-main);
  margin: 0;
}

h4, h5, h6, .widget-title, .ds-h4 {
  font-size: var(--font-h4) !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  color: var(--text-main);
  margin: 0;
}

@media screen and (max-width: 767px) {
  :root {
    --font-h1: 20px;
    --font-h2: 17px;
    --font-h3: 14.5px;
  }

  p, .paragraph, .body-desc, .prose p, .text-justify, .content-text {
    text-align: left !important;
    text-justify: auto !important;
    font-size: 13px !important;
  }

  /* Prevent iOS Safari auto-zoom on form fields (< 16px triggers zoom) */
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

.safe-bottom {
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.touch-target {
  min-height: 44px;
  min-width: 44px;
}

.scroll-shadow-x {
  background:
    linear-gradient(to right, white 30%, rgba(255, 255, 255, 0)),
    linear-gradient(to right, rgba(255, 255, 255, 0), white 70%) 0 100%,
    radial-gradient(farthest-side at 0 50%, rgba(0, 48, 135, 0.14), transparent),
    radial-gradient(farthest-side at 100% 50%, rgba(0, 48, 135, 0.14), transparent) 0 100%;
  background-repeat: no-repeat;
  background-color: white;
  background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
  background-position: 0 0, 100% 0, 0 0, 100% 0;
  background-attachment: local, local, scroll, scroll;
}

/* Key Metrics, Numbers must be BOLD */
strong, b, .font-bold, .font-semibold, .font-black,
.key-metric, .metric-value, .metric-number, .field-label, th {
  font-weight: 700 !important;
}

/* Body Content: Căn đều hai bên (text-align: justify) */
p, .paragraph, .body-desc, .prose p, .text-justify, .content-text {
  text-align: justify !important;
  text-justify: inter-word !important;
  hyphens: auto;
  font-size: 12.5px !important;
  line-height: 1.6;
  overflow-wrap: break-word;
}

/* Quy chuẩn cỡ chữ cơ bản (11px – 13px) */
.text-xs {
  font-size: 11.5px !important;
}

.text-sm {
  font-size: 12.5px !important;
}

.text-base {
  font-size: 13.5px !important;
}

table th {
  font-size: 11.5px !important;
  font-weight: 700 !important;
}

table td {
  font-size: 12.5px !important;
}

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  font-size: 12.5px !important;
}

/* Secondary & Subtitle Text Colors */
.text-secondary, .text-desc, .text-sub, .text-gray-600, .text-slate-600 {
  color: var(--text-secondary);
}

.text-muted, .text-gray-500, .text-slate-500 {
  color: var(--text-muted);
}

/* Alert Red Text */
.text-alert, .text-danger, .text-error, .text-urgent, .text-warning-red,
.text-red-500, .text-red-600, .text-red-700 {
  color: var(--text-alert) !important;
}

/* Success Green Text */
.text-success, .text-green-600, .text-green-700, .text-emerald-600, .text-emerald-700 {
  color: var(--status-green) !important;
}

/* Amber / Warning Text */
.text-warning, .text-amber-600, .text-amber-700, .text-amber-800 {
  color: var(--status-amber) !important;
}

/* TDTU Brand Blue Links & Highlights */
a, .text-link, .link-primary, .text-primary-blue, .text-blue-700, .text-blue-800 {
  color: var(--tdtu-blue);
  text-decoration: none;
}
a:hover {
  color: var(--tdtu-blue-hover);
  text-decoration: underline;
}

/* ==========================================================================
   ALIGNMENT RULES
   ========================================================================== */
.text-left, .card-header, .table-header, .section-header {
  text-align: left !important;
}

.text-center, .banner-title, .modal-title, .title-center {
  text-align: center !important;
}

/* ==========================================================================
   CARDS & CONTAINERS (Nền trắng, viền sắc nét, khoảng trắng thoáng đãng)
   ========================================================================== */
.ds-card {
  background-color: #ffffff !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 12px !important;
  padding: 24px !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ds-card:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 12px 0 rgba(0, 48, 135, 0.06) !important;
}

/* ==========================================================================
   BUTTONS (Primary: Xanh dương #003087, CTA/Alert: Đỏ #dc2626, Outline)
   QUY CHUẨN: KHÔNG HẸP SÁT CHỮ, ĐỆM THOÁNG ĐÃNG, TỰ THÍCH ỨNG MOBILE
   ========================================================================== */
button {
  white-space: nowrap;
  max-width: 100%;
}

/* Universal Action Buttons Safeguard (Không ghi đè display:none của .hidden hay nút icon/phân trang nhỏ) */
button[class*="bg-[#003087]"]:not([class*="px-2"]):not([class*="w-8"]):not([class*="w-9"]):not([class*="p-1"]):not([class*="p-2"]),
button[class*="bg-primary"]:not([class*="px-2"]):not([class*="w-8"]):not([class*="w-9"]),
button[class*="bg-[#dc2626]"]:not([class*="px-2"]):not([class*="w-8"]):not([class*="w-9"]):not([class*="p-1"]),
button[class*="bg-blue-"]:not([class*="px-2"]):not([class*="w-8"]):not([class*="w-9"]),
button[class*="bg-emerald-"]:not([class*="px-2"]):not([class*="w-8"]):not([class*="w-9"]),
.btn,
.btn-primary,
.btn-alert,
.btn-outline {
  padding-left: 20px !important;
  padding-right: 20px !important;
  min-height: 38px !important;
  white-space: nowrap;
  align-items: center;
  justify-content: center;
  box-sizing: border-box !important;
}

.btn,
.btn-primary,
.btn-alert,
.btn-outline {
  display: inline-flex;
}

@media (max-width: 640px) {
  button {
    white-space: normal;
  }

  button[class*="bg-[#003087]"]:not([class*="px-2"]):not([class*="w-8"]):not([class*="w-9"]):not([class*="p-1"]):not([class*="p-2"]),
  button[class*="bg-primary"]:not([class*="px-2"]):not([class*="w-8"]):not([class*="w-9"]),
  button[class*="bg-[#dc2626]"]:not([class*="px-2"]):not([class*="w-8"]):not([class*="w-9"]):not([class*="p-1"]),
  button[class*="bg-blue-"]:not([class*="px-2"]):not([class*="w-8"]):not([class*="w-9"]),
  button[class*="bg-emerald-"]:not([class*="px-2"]):not([class*="w-8"]):not([class*="w-9"]),
  .btn,
  .btn-primary,
  .btn-alert,
  .btn-outline {
    padding-left: 14px !important;
    padding-right: 14px !important;
    min-width: 0 !important;
    white-space: normal !important;
    text-align: center;
    line-height: 1.35;
  }

  .ds-card {
    padding: 16px !important;
  }

  th {
    padding: 10px 12px !important;
    font-size: 11px !important;
  }

  td {
    padding: 10px 12px !important;
  }
}

.btn-primary, button.btn-primary {
  background-color: var(--tdtu-blue) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 12.5px !important;
  padding: 9px 22px !important;
  min-height: 38px !important;
  min-width: 120px;
  white-space: nowrap !important;
  border-radius: 8px !important;
  border: 1px solid var(--tdtu-blue) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 0.15s ease !important;
}

.btn-primary:hover {
  background-color: var(--tdtu-blue-hover) !important;
  border-color: var(--tdtu-blue-hover) !important;
}

.btn-alert, .btn-cta, button.btn-alert {
  background-color: var(--tdtu-red) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 12.5px !important;
  padding: 9px 22px !important;
  min-height: 38px !important;
  min-width: 120px;
  white-space: nowrap !important;
  border-radius: 8px !important;
  border: 1px solid var(--tdtu-red) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 0.15s ease !important;
}

.btn-alert:hover, .btn-cta:hover {
  background-color: var(--tdtu-red-hover) !important;
  border-color: var(--tdtu-red-hover) !important;
}

.btn-outline, button.btn-outline {
  background-color: #ffffff !important;
  color: var(--tdtu-blue) !important;
  font-weight: 700 !important;
  font-size: 12.5px !important;
  padding: 9px 22px !important;
  min-height: 38px !important;
  min-width: 110px;
  white-space: nowrap !important;
  border-radius: 8px !important;
  border: 1px solid var(--tdtu-blue) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 0.15s ease !important;
}

.btn-outline:hover {
  background-color: var(--tdtu-blue-subtle) !important;
}

/* ==========================================================================
   BADGES & STATUS PILLS (Xanh dương, Đỏ, Xanh lá, Hổ phách, Trung tính)
   ========================================================================== */
.badge-blue {
  background-color: var(--tdtu-blue-subtle) !important;
  color: var(--tdtu-blue) !important;
  border: 1px solid var(--tdtu-blue-border) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 3.5px 11px !important;
  border-radius: 9999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.badge-red {
  background-color: var(--tdtu-red-subtle) !important;
  color: var(--tdtu-red) !important;
  border: 1px solid var(--tdtu-red-border) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 3.5px 11px !important;
  border-radius: 9999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.badge-green {
  background-color: var(--status-green-subtle) !important;
  color: var(--status-green) !important;
  border: 1px solid var(--status-green-border) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 3.5px 11px !important;
  border-radius: 9999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.badge-amber {
  background-color: var(--status-amber-subtle) !important;
  color: var(--status-amber) !important;
  border: 1px solid var(--status-amber-border) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 3.5px 11px !important;
  border-radius: 9999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.badge-neutral {
  background-color: #ffffff !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-subtle) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 3.5px 11px !important;
  border-radius: 9999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

/* ==========================================================================
   DATA TABLES (Thanh lịch, khoảng cách rộng rãi, chữ 13.5px dễ đọc)
   ========================================================================== */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

th {
  background-color: #f8fafc !important;
  color: var(--text-main) !important;
  font-weight: 700 !important;
  text-align: left;
  padding: 13px 18px !important;
  border-bottom: 2px solid var(--border-subtle) !important;
  text-transform: uppercase;
  font-size: 12px !important;
  letter-spacing: 0.03em;
}

td {
  padding: 14px 18px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  color: var(--text-main);
  vertical-align: middle;
}

tr:hover td {
  background-color: #f8fafc !important;
}

/* ==========================================================================
   INPUTS & FORM CONTROLS (Thoải mái, chữ 14px, padding 10px 14px)
   ========================================================================== */
input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]), textarea {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Custom Styled Select Dropdown (Hiện đại, sang trọng chuẩn TDTU, loại bỏ mũi tên mặc định) */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23003087'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px !important;
  padding-right: 38px !important;
  padding-left: 14px !important;
  padding-top: 9px !important;
  padding-bottom: 9px !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 12px !important;
  color: var(--text-main) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  outline: none !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

select:hover {
  border-color: var(--tdtu-blue) !important;
  background-color: #f8fafc !important;
}

select:focus {
  border-color: var(--tdtu-blue) !important;
  box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.16) !important;
  background-color: #ffffff !important;
}

input:not([type="checkbox"]):not([type="radio"]):focus, textarea:focus {
  border-color: var(--tdtu-blue);
  box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.12);
}

/* Tiện ích ẩn scrollbar khi cần thiết theo yêu cầu */
.no-scrollbar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.no-scrollbar {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

/* Thin Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #ffffff;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   PRINT MEDIA STYLES (@media print) - BÁO CÁO IN A4 CHUẨN VĂN BẢN TDTU
   ========================================================================== */
.print-only {
  display: none !important;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 12mm 15mm;
  }

  html, body, #root {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt !important;
    font-family: 'Times New Roman', 'Inter', serif !important;
  }

  /* Ẩn triệt để Sidebar, Navbar, Header web, các nút thao tác và thanh công cụ khi in */
  aside,
  header,
  nav,
  .no-print,
  button.no-print,
  input.no-print,
  .btn-print-hide {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  /* Gỡ khóa chiều cao h-screen và overflow-hidden của App shell */
  #root > div,
  #root > div > div,
  main {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .documents-page-root {
    padding: 0 !important;
    margin: 0 !important;
  }

  .overflow-x-auto {
    overflow: visible !important;
  }

  /* Định dạng Bảng in chuẩn công văn */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    page-break-inside: auto;
    font-size: 9.5pt !important;
    margin-top: 10px !important;
    margin-bottom: 15px !important;
  }

  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  thead {
    display: table-header-group;
  }

  th, td {
    border: 1px solid #1f2937 !important;
    padding: 5px 7px !important;
    font-size: 9pt !important;
    color: #000000 !important;
    vertical-align: middle !important;
  }

  th {
    background-color: #f3f4f6 !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    text-align: center !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Phần ký tên cuối trang in */
  .print-signatures {
    page-break-inside: avoid;
    break-inside: avoid;
    margin-top: 25px;
    display: flex !important;
    justify-content: space-between !important;
    text-align: center !important;
    font-size: 10pt !important;
  }

  .print-signatures > div {
    flex: 1;
  }

  /* Chế độ in biểu mẫu giảng viên chuyên biệt (Print Document Template) */
  .print-active-document {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  .page-break-avoid {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .page-break-before {
    page-break-before: always !important;
    break-before: page !important;
  }

  .a4-print-scale-reset {
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
  }
}

/* ==========================================================================
   UNIFIED MODAL / POPUP SCALE & FORM READABILITY
   Tăng tỉ lệ hiển thị, cỡ chữ và khoảng cách cho tất cả form pop-up trên desktop/tablet
   ========================================================================== */
@media (min-width: 640px) {
  .fixed.inset-0 > div.sm\:max-w-md,
  .fixed.inset-0 > div.max-w-md {
    max-width: 36rem !important;
  }
  .fixed.inset-0 > div.sm\:max-w-lg,
  .fixed.inset-0 > div.max-w-lg {
    max-width: 44rem !important;
  }
  .fixed.inset-0 > div.sm\:max-w-xl,
  .fixed.inset-0 > div.max-w-xl {
    max-width: 50rem !important;
  }
  .fixed.inset-0 > div.sm\:max-w-2xl,
  .fixed.inset-0 > div.max-w-2xl {
    max-width: 56rem !important;
  }
  .fixed.inset-0 > div.sm\:max-w-3xl,
  .fixed.inset-0 > div.max-w-3xl {
    max-width: 64rem !important;
  }
  .fixed.inset-0 > div.sm\:max-w-4xl,
  .fixed.inset-0 > div.max-w-4xl {
    max-width: 72rem !important;
  }
}

.fixed.inset-0 h3 {
  font-size: 1.05rem !important;
  line-height: 1.4 !important;
}

.fixed.inset-0 form {
  font-size: 0.875rem !important;
}

.fixed.inset-0 form label {
  font-size: 0.84rem !important;
}

.fixed.inset-0 form input:not([type="checkbox"]):not([type="radio"]),
.fixed.inset-0 form select,
.fixed.inset-0 form textarea {
  font-size: 0.875rem !important;
  padding-top: 0.575rem !important;
  padding-bottom: 0.575rem !important;
}

.fixed.inset-0 form button[type="submit"],
.fixed.inset-0 form button[type="button"] {
  font-size: 0.84rem !important;
}
