/* Module tiepcanthongtin - Chuyên mục về tiếp cận thông tin (Danh mục thông tin phải được công khai, 19 nhóm Điều 17 Luật TCTT).
   Màu lấy từ biến của theme (--gdnn-*) nên tự đổi theo chế độ tối / tương phản cao; phần riêng cho chế độ tối ở cuối tệp. */
.tctt-page { margin-bottom: 30px; }
.tctt-page [id] { scroll-margin-top: calc(var(--gdnn-header-h, 64px) + 16px); }

/* Đầu trang: 2 cột - trái: tiêu đề, căn cứ, lời giới thiệu, nút tải/in (đáy cột); phải: 3 số liệu + 4 lối tắt 2x2 lấp đầy chiều cao */
.tctt-hero { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 22px; background: linear-gradient(135deg, var(--gdnn-primary-light, #e6f3ec), var(--gdnn-surface, #fff) 72%); border: 1px solid var(--gdnn-border, #dfe6e2); border-radius: var(--gdnn-radius, 10px); padding: 18px 20px; margin: 8px 0 22px; }
.tctt-hero-main { min-width: 0; display: flex; flex-direction: column; }
.tctt-kicker { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--gdnn-secondary, #AE5510); }
.tctt-title { font-size: 22px; line-height: 1.3; margin: 0 0 6px; color: var(--gdnn-primary-dark, #06643a); font-weight: 700; }
.tctt-legal { margin: 0 0 10px; font-size: 13px; line-height: 1.55; color: var(--gdnn-text-muted, #5f6b65); }
.tctt-intro { margin: 0 0 14px; font-size: 15px; line-height: 1.6; }
.tctt-intro p:last-child { margin-bottom: 0; }
.tctt-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.tctt-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.tctt-hero-side { display: flex; flex-direction: column; gap: 10px; padding-left: 20px; border-left: 1px dashed var(--gdnn-border, #dfe6e2); }
.tctt-stats { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 8px; }
.tctt-stat { background: var(--gdnn-surface, #fff); border: 1px solid var(--gdnn-border, #dfe6e2); border-radius: var(--gdnn-radius-sm, 6px); padding: 8px 6px; text-align: center; }
.tctt-stat strong { display: block; font-size: 19px; line-height: 1.2; color: var(--gdnn-primary, #088040); font-weight: 800; white-space: nowrap; }
.tctt-stat strong small { font-size: 13px; color: var(--gdnn-text-muted, #5f6b65); font-weight: 600; }
.tctt-stat span { display: block; margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--gdnn-text-muted, #5f6b65); }

/* Lối tắt tới các phần của chuyên mục (cột phải đầu trang) */
.tctt-tabs { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 8px; }
.tctt-tabs a { display: flex; align-items: center; gap: 9px; padding: 9px 11px; background: var(--gdnn-surface, #fff); border: 1px solid var(--gdnn-border, #dfe6e2); border-radius: var(--gdnn-radius-sm, 6px); font-weight: 600; font-size: 13.5px; line-height: 1.3; color: var(--gdnn-text, #1f2a24); text-decoration: none; transition: border-color .15s, box-shadow .15s, color .15s; }
.tctt-tabs a:hover, .tctt-tabs a:focus { border-color: var(--gdnn-primary, #088040); color: var(--gdnn-primary-dark, #06643a); box-shadow: var(--gdnn-shadow); }
.tctt-tabs a span { min-width: 0; }
.tctt-tabs a strong { display: block; font-size: 14.5px; font-weight: 700; }
.tctt-tabs a small { display: block; font-size: 12px; font-weight: 500; color: var(--gdnn-text-muted, #5f6b65); }
.tctt-tabs .fa { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; background: var(--gdnn-primary-light, #e6f3ec); color: var(--gdnn-primary, #088040); }

.tctt-section { margin-bottom: 22px; }
.tctt-h2 { font-size: 18px; font-weight: 700; color: var(--gdnn-primary-dark, #06643a); margin: 6px 0 10px; padding-left: 10px; border-left: 4px solid var(--gdnn-secondary, #AE5510); }
.tctt-hint { font-size: 13.5px; color: var(--gdnn-text-muted, #5f6b65); margin: -4px 0 12px; }

/* Thẻ 19 nhóm */
/* 19 thẻ cố định: hàng cuối luôn lấp đầy - máy tính 5+5+5+4 (lưới 20 cột, thẻ chiếm 4, 4 thẻ cuối chiếm 5); máy tính bảng 4/hàng
   (lưới 12, 3 thẻ cuối chiếm 4); điện thoại 2/hàng (thẻ cuối chiếm cả hàng) */
.tctt-grid { display: grid; grid-template-columns: repeat(20, 1fr); gap: 10px; }
.tctt-card { grid-column: span 4; }
.tctt-card:nth-child(n+16) { grid-column: span 5; }
.tctt-card { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 128px; padding: 12px 12px 10px; background: var(--gdnn-surface, #fff); border: 1px solid var(--gdnn-border, #dfe6e2); border-top: 4px solid var(--gdnn-border, #dfe6e2); border-radius: var(--gdnn-radius, 10px); color: var(--gdnn-text, #1f2a24); text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tctt-card:hover, .tctt-card:focus { transform: translateY(-2px); box-shadow: var(--gdnn-shadow-lg); color: var(--gdnn-text, #1f2a24); text-decoration: none; }
.tctt-card-stt { position: absolute; right: 10px; top: 8px; font-weight: 800; font-size: 15px; color: var(--gdnn-text-muted, #5f6b65); letter-spacing: .5px; }
.tctt-card-icon { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; background: var(--gdnn-bg-alt, #f4f7f5); color: var(--gdnn-text-muted, #5f6b65); }
.tctt-card-title { font-weight: 700; font-size: 14px; line-height: 1.3; flex: 1; padding-right: 20px; }
.tctt-card-count { font-size: 12.5px; font-weight: 600; color: var(--gdnn-text-muted, #5f6b65); }
.tctt-card-co { border-top-color: var(--gdnn-primary, #088040); }
.tctt-card-co .tctt-card-icon { background: var(--gdnn-primary, #088040); color: #fff; }
.tctt-card-co .tctt-card-stt, .tctt-card-co .tctt-card-count { color: var(--gdnn-primary-dark, #06643a); }
.tctt-card-tt0 { border-top-color: #d99a3f; }
.tctt-card-tt0 .tctt-card-count { color: #8a5a12; }
.tctt-card-tt1, .tctt-card-tt2 { background: var(--gdnn-bg-alt, #f4f7f5); }
.tctt-legend { list-style: none; padding: 0; margin: 10px 0 20px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--gdnn-text-muted, #5f6b65); }
.tctt-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tctt-dot-co { background: var(--gdnn-primary, #088040); }
.tctt-dot-tt0 { background: #d99a3f; }
.tctt-dot-tt1 { background: #9aa8a0; }
.tctt-dot-tt2 { background: #c9d2cd; }

/* Công cụ lọc */
.tctt-toolbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 0 0 10px; }
.tctt-search { position: relative; flex: 1 1 320px; max-width: 520px; }
.tctt-search .fa { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gdnn-text-muted, #5f6b65); }
.tctt-search .form-control { padding-left: 34px; height: 40px; border-radius: 20px; }
.tctt-only { font-weight: 500; margin: 0; cursor: pointer; }
.tctt-found { font-size: 13px; color: var(--gdnn-text-muted, #5f6b65); }

/* Bảng danh mục đúng mẫu */
.tctt-table-wrap { border: 1px solid var(--gdnn-border, #dfe6e2); border-radius: var(--gdnn-radius, 10px); overflow: hidden; background: var(--gdnn-surface, #fff); }
.tctt-table { width: 100%; border-collapse: collapse; font-size: 14.5px; table-layout: fixed; } /* độ rộng cột theo dòng tiêu đề, URL dài không làm phình cột */
.tctt-table thead th { background: var(--gdnn-primary, #088040); color: #fff; font-weight: 700; font-size: 13.5px; text-align: center; vertical-align: middle; padding: 10px 8px; border-right: 1px solid rgba(255,255,255,.25); }
.tctt-table td, .tctt-table tbody th { padding: 9px 10px; vertical-align: top; border-top: 1px solid var(--gdnn-border, #dfe6e2); border-right: 1px solid var(--gdnn-border, #dfe6e2); }
.tctt-table td:last-child, .tctt-table thead th:last-child { border-right: 0; }
.tctt-table thead .c-tt { width: 56px; }
.tctt-table thead .c-nhom { width: 23%; }
.tctt-table thead .c-ngay { width: 116px; }
.tctt-table thead .c-ht { width: 28%; }
.tctt-table tbody .c-tt { text-align: center; font-weight: 800; color: var(--gdnn-primary-dark, #06643a); background: var(--gdnn-primary-light, #e6f3ec); }
.tctt-table tbody .c-nhom { background: var(--gdnn-primary-light, #e6f3ec); font-size: 14px; line-height: 1.4; }
.tctt-table .c-nhom .fa { color: var(--gdnn-primary, #088040); margin-right: 2px; }
.tctt-table tbody .c-ngay { text-align: center; white-space: nowrap; }
.tctt-group { border-top: 2px solid var(--gdnn-primary-soft, #d4ead9); }
.tctt-group:target .c-tt, .tctt-group:target .c-nhom, .tctt-flash .c-tt, .tctt-flash .c-nhom { animation: tctt-flash 2.2s ease-out; }
@keyframes tctt-flash { 0%, 35% { background: #fff1c9; } 100% { background: var(--gdnn-primary-light, #e6f3ec); } }
.tctt-row:hover td:not(.c-nhom) { background: var(--gdnn-bg-alt, #f4f7f5); }
.tctt-no { color: var(--gdnn-text-muted, #5f6b65); font-weight: 600; }
.tctt-name { font-weight: 600; }
.tctt-code { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 10px; background: var(--gdnn-secondary-light, #f5ebe2); color: var(--gdnn-secondary-dark, #8b440d); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.tctt-file { display: inline-block; margin-left: 6px; font-size: 12.5px; white-space: nowrap; }
.tctt-note { display: block; margin-top: 3px; font-size: 13px; font-style: italic; color: var(--gdnn-text-muted, #5f6b65); }
.tctt-ht { display: block; font-size: 13.5px; }
.tctt-url { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.tctt-meta { display: block; font-size: 12px; color: var(--gdnn-text-muted, #5f6b65); }
.tctt-lbl { display: none; }
.tctt-row-empty .c-empty { color: var(--gdnn-text-muted, #5f6b65); vertical-align: middle; }
.tctt-state { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; }
.tctt-state-0 { background: #fdf0db; color: #7a4d0b; }
.tctt-state-1 { background: var(--gdnn-bg-alt, #f4f7f5); color: var(--gdnn-text-muted, #5f6b65); }
.tctt-state-2 { background: var(--gdnn-bg-alt, #f4f7f5); color: var(--gdnn-text-muted, #5f6b65); }
p.tctt-state { margin: 0; }
.tctt-noresult { margin: 12px 0; color: var(--gdnn-text-muted, #5f6b65); }
.tctt-row[hidden], .tctt-group[hidden] { display: none; }

/* Đầu mối, Quy chế, tài liệu */
.tctt-info { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tctt-panel { background: var(--gdnn-surface, #fff); border: 1px solid var(--gdnn-border, #dfe6e2); border-radius: var(--gdnn-radius, 10px); padding: 14px 18px; }
.tctt-panel .tctt-h2 { border-left: 0; padding-left: 0; }
.tctt-panel .tctt-h2 .fa { color: var(--gdnn-secondary, #AE5510); margin-right: 4px; }
.tctt-box > :last-child { margin-bottom: 0; }
.tctt-box ul { padding-left: 20px; }
.tctt-box li { margin-bottom: 5px; }
.tctt-qr { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px dashed var(--gdnn-border, #dfe6e2); border-radius: var(--gdnn-radius, 10px); font-size: 13.5px; color: var(--gdnn-text-muted, #5f6b65); }
.tctt-qr img { flex: 0 0 96px; background: #fff; padding: 4px; border-radius: 6px; }
.tctt-qr p { margin: 0; word-break: break-all; }

/* Mục lục 19 nhóm ghim bên trái cửa sổ: hiện khi đã cuộn qua đầu trang, ẩn khi về đầu trang / tới chân trang (js: .is-on);
   nhóm đang xem trong bảng được đánh dấu (.is-active). Lề trái đủ rộng: dải số La Mã 52px, rê chuột / Tab → bung tên nhóm và số mục.
   Lề trái hẹp, điện thoại (js: .is-drawer): tab "19 nhóm" sát mép trái, chạm để mở / đóng (.is-open). */
.tctt-rail { position: fixed; z-index: 1020; left: 10px; top: 50%; display: flex; align-items: center; opacity: 0; visibility: hidden; transform: translate(calc(-100% - 12px), -50%); transition: transform .25s ease, opacity .25s ease, visibility 0s linear .25s; }
.tctt-rail.is-on { opacity: 1; visibility: visible; transform: translate(0, -50%); transition: transform .25s ease, opacity .25s ease; }
.tctt-rail-toggle { display: none; }
.tctt-rail-list { position: relative; list-style: none; margin: 0; padding: 6px; width: 52px; max-height: calc(100vh - 140px); overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; interpolate-size: allow-keywords; background: var(--gdnn-surface, #fff); border: 1px solid var(--gdnn-border, #dfe6e2); border-radius: 12px; box-shadow: var(--gdnn-shadow-lg); transition: width .2s ease; }
.tctt-rail-list li + li { margin-top: 2px; }
.tctt-rail-item { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 2px; border-radius: 8px; color: var(--gdnn-text, #1f2a24); text-decoration: none; white-space: nowrap; }
.tctt-rail-item:hover, .tctt-rail-item:focus { background: var(--gdnn-bg-alt, #f4f7f5); color: var(--gdnn-primary-dark, #06643a); text-decoration: none; }
.tctt-rail-stt { flex: 0 0 36px; height: 24px; line-height: 22px; text-align: center; border: 1px solid var(--gdnn-border, #dfe6e2); border-radius: 6px; background: var(--gdnn-surface, #fff); color: var(--gdnn-text-muted, #5f6b65); font-size: 11.5px; font-weight: 800; }
.tctt-rail-co .tctt-rail-stt { background: var(--gdnn-primary, #088040); border-color: var(--gdnn-primary, #088040); color: #fff; }
.tctt-rail-tt0 .tctt-rail-stt { border-color: #d99a3f; color: #8a5a12; }
.tctt-rail-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .15s; }
.tctt-rail-count { flex: 0 0 auto; min-width: 24px; margin-right: 2px; padding: 0 6px; border-radius: 10px; background: var(--gdnn-bg-alt, #f4f7f5); color: var(--gdnn-text-muted, #5f6b65); font-size: 11.5px; font-weight: 700; line-height: 18px; text-align: center; opacity: 0; transition: opacity .15s; }
.tctt-rail-co .tctt-rail-count { background: var(--gdnn-primary-light, #e6f3ec); color: var(--gdnn-primary-dark, #06643a); }
.tctt-rail:not(.is-drawer):hover .tctt-rail-list, .tctt-rail:not(.is-drawer):focus-within .tctt-rail-list, .tctt-rail.is-open .tctt-rail-list { width: max-content; max-width: calc(100vw - 90px); } /* bung vừa tên dài nhất - đủ chữ */
.tctt-rail:not(.is-drawer):hover .tctt-rail-name, .tctt-rail:not(.is-drawer):focus-within .tctt-rail-name, .tctt-rail.is-open .tctt-rail-name,
.tctt-rail:not(.is-drawer):hover .tctt-rail-count, .tctt-rail:not(.is-drawer):focus-within .tctt-rail-count, .tctt-rail.is-open .tctt-rail-count { opacity: 1; }
.tctt-rail-item.is-active { background: var(--gdnn-primary-light, #e6f3ec); }
.tctt-rail-item.is-active .tctt-rail-stt { box-shadow: 0 0 0 2px var(--gdnn-secondary, #AE5510); }
.tctt-rail-item.is-active .tctt-rail-name { color: var(--gdnn-primary-dark, #06643a); }
.tctt-rail.is-drawer { left: 0; align-items: flex-start; }
.tctt-rail.is-open { z-index: 1036; } /* trên nút lên đầu trang (.back-to-top 1034) khi đang mở */
.tctt-rail.is-drawer .tctt-rail-toggle { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 34px; padding: 10px 0; border: 0; border-radius: 0 10px 10px 0; background: var(--gdnn-primary, #088040); color: #fff; font-size: 12px; font-weight: 700; box-shadow: var(--gdnn-shadow-lg); cursor: pointer; }
.tctt-rail.is-drawer .tctt-rail-toggle span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.tctt-rail.is-drawer .tctt-rail-list { display: none; margin-left: 6px; }
.tctt-rail.is-drawer.is-open .tctt-rail-list { display: block; width: min(400px, calc(100vw - 52px)); max-width: none; }
/* Dạng tab (màn hẹp): tên dài xuống dòng, không cắt */
.tctt-rail.is-drawer .tctt-rail-item { height: auto; min-height: 28px; padding-top: 3px; padding-bottom: 3px; white-space: normal; }
.tctt-rail.is-drawer .tctt-rail-name { overflow: visible; line-height: 1.3; }
.tctt-rail.is-drawer .tctt-rail-stt { align-self: flex-start; }
@media (prefers-reduced-motion: reduce) {
    .tctt-rail, .tctt-rail.is-on, .tctt-rail-list, .tctt-rail-name, .tctt-rail-count { transition: none; }
}

@media (max-width: 1199px) {
    .tctt-hero { grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; }
    .tctt-hero-side { padding-left: 18px; }
}
@media (max-width: 991px) {
    .tctt-hero { grid-template-columns: 1fr; gap: 14px; }
    .tctt-hero-side { padding: 14px 0 0; border-left: 0; border-top: 1px dashed var(--gdnn-border, #dfe6e2); }
    .tctt-tabs { grid-template-columns: repeat(4, 1fr); }
    .tctt-info { grid-template-columns: 1fr; gap: 0; }
    .tctt-grid { grid-template-columns: repeat(12, 1fr); }
    .tctt-card, .tctt-card:nth-child(n+16) { grid-column: span 3; }
    .tctt-card:nth-child(n+17) { grid-column: span 4; }
    .tctt-table thead .c-nhom { width: 26%; }
}
/* Điện thoại: bảng chuyển thành thẻ theo nhóm */
@media (max-width: 767px) {
    .tctt-hero { padding: 14px; }
    .tctt-title { font-size: 19px; }
    .tctt-intro { font-size: 14.5px; }
    .tctt-actions .btn { flex: 1 1 auto; justify-content: center; padding-left: 8px; padding-right: 8px; }
    .tctt-stat strong { font-size: 17px; }
    .tctt-tabs { grid-template-columns: 1fr 1fr; }
    .tctt-tabs a { font-size: 13px; padding: 8px; gap: 7px; }
    .tctt-tabs a strong { font-size: 13.5px; }
    .tctt-tabs .fa { flex-basis: 26px; width: 26px; height: 26px; font-size: 13px; }
    .tctt-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .tctt-card, .tctt-card:nth-child(n+16), .tctt-card:nth-child(n+17) { grid-column: span 1; }
    .tctt-card:nth-child(19) { grid-column: span 2; }
    .tctt-card { min-height: 112px; padding: 10px; }
    .tctt-table-wrap { border: 0; background: transparent; overflow: visible; }
    .tctt-table, .tctt-table tbody { display: block; }
    .tctt-table thead { display: none; }
    .tctt-group { display: block; margin-bottom: 12px; border: 1px solid var(--gdnn-border, #dfe6e2); border-radius: var(--gdnn-radius, 10px); overflow: hidden; background: var(--gdnn-surface, #fff); }
    .tctt-row { display: flex; flex-wrap: wrap; }
    .tctt-table td, .tctt-table tbody th { display: block; border-right: 0; width: auto; }
    .tctt-table tbody .c-tt { flex: 0 0 52px; display: flex; align-items: center; justify-content: center; font-size: 15px; border-top: 0; }
    .tctt-table tbody .c-nhom { flex: 1 1 0; border-top: 0; font-size: 13.5px; }
    .tctt-table .c-ten, .tctt-table .c-ht, .tctt-table .c-empty { flex: 0 0 100%; }
    .tctt-table tbody .c-ngay { flex: 0 0 100%; text-align: left; padding-top: 0; padding-bottom: 2px; border-top: 0; font-size: 13.5px; }
    .tctt-table .c-ht { border-top: 0; padding-top: 2px; }
    .tctt-lbl { display: inline; color: var(--gdnn-text-muted, #5f6b65); }
    .tctt-table .c-ngay.is-empty { display: none; }
    .tctt-url { white-space: normal; word-break: break-all; }
    .tctt-qr { flex-direction: row; }
}

/* In trực tiếp từ trang (Ctrl+P): chỉ giữ bảng danh mục */
@media print {
    .tctt-tabs, .tctt-grid, .tctt-legend, .tctt-toolbar, .tctt-actions, .tctt-hint, .tctt-hero-side, .tctt-rail { display: none !important; }
    .tctt-hero { display: block; background: #fff; }
    .tctt-table thead th { position: static; color: #000; background: #fff; border: 1px solid #000; }
    .tctt-table td, .tctt-table tbody th { border: 1px solid #000; background: #fff !important; }
    .tctt-url { white-space: normal; word-break: break-all; }
}
/* Chế độ tối: style.css mục 29.15 */
