/* Tra cứu Từ điển dữ liệu dùng chung ngành Y tế (tu_dien_du_lieu.php) */
.tdd-wrap [hidden], .tdd-modal [hidden] { display: none !important; }
.tdd-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tdd-header .profile-header__title { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tdd-header__sub { margin: 4px 0 0; font-size: 13.5px; color: var(--c-text-soft); }
.tdd-header__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tdd-ver {
    font-size: 12px; font-weight: 600; color: #0369a1; background: #e0f2fe; border: 1px solid #bae6fd;
    border-radius: 999px; padding: 2px 10px; line-height: 1.5;
}

.tdd-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-border); margin: 14px 0 12px; overflow-x: auto; }
.tdd-tab {
    border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--c-text-soft);
    padding: 9px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.tdd-tab .ui-icon { width: 16px; height: 16px; }
.tdd-tab:hover { color: var(--c-text); }
.tdd-tab.is-active { color: var(--c-primary); border-bottom-color: var(--c-primary); }

.tdd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tdd-stat { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 10px 14px; display: flex; flex-direction: column; }
.tdd-stat__num { font-size: 22px; font-weight: 700; color: var(--c-text); line-height: 1.2; font-variant-numeric: tabular-nums; }
.tdd-stat__label { font-size: 12.5px; color: var(--c-text-soft); }

.tdd-lv { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tdd-chip {
    border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text); font: inherit; font-size: 13px;
    border-radius: 999px; padding: 5px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.tdd-chip b { font-weight: 600; color: var(--c-text-soft); font-variant-numeric: tabular-nums; }
.tdd-chip:hover { border-color: var(--c-primary); }
.tdd-chip.is-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.tdd-chip.is-active b { color: rgba(255, 255, 255, .85); }

.tdd-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.tdd-search { flex: 1 1 380px; display: flex; align-items: center; gap: 6px; color: var(--c-text-soft); }
.tdd-search input { flex: 1; }
.tdd-filters select { flex: 0 1 230px; min-width: 0; }
.tdd-count { font-size: 13px; color: var(--c-text-soft); min-height: 18px; margin-bottom: 6px; }
.tdd-note { font-size: 13px; color: var(--c-text-soft); margin: 0 0 10px; }
.tdd-err { color: #b91c1c; }
.tdd-linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--c-primary); cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.tdd-linkbtn:hover { text-decoration: underline; }
.tdd-linkbtn .ui-icon { width: 13px; height: 13px; }

.tdd-table td { vertical-align: top; }
.tdd-table mark { background: #fef08a; color: inherit; padding: 0 1px; border-radius: 2px; }
.tdd-row { cursor: pointer; }
.tdd-row:hover td, .tdd-row:focus td { background: #f0f9ff; }
.tdd-row:focus { outline: none; }
.tdd-grp td {
    background: #f1f5f9 !important; font-size: 12.5px; color: var(--c-text-soft); padding-top: 7px !important; padding-bottom: 7px !important;
}
.tdd-grp b { color: var(--c-text); font-weight: 600; }
.tdd-grp span { color: #94a3b8; }
.tdd-code {
    display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; font-weight: 600;
    border-radius: 6px; padding: 1px 6px; margin: 0 4px 3px 0; white-space: nowrap;
}
.tdd-code--ma { background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; }
.tdd-code--cde { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.tdd-ten { display: block; font-weight: 600; color: var(--c-text); }
.tdd-dn {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-size: 13px; color: var(--c-text-soft); margin-top: 2px;
}
.tdd-path { display: block; font-size: 12px; color: #64748b; margin-top: 3px; }
.tdd-c-truong code { font-size: 12.5px; color: #0f172a; background: #f8fafc; border: 1px solid var(--c-border); border-radius: 5px; padding: 1px 5px; word-break: break-all; }
.tdd-type { font-weight: 600; font-size: 13px; }
.tdd-type small { font-weight: 400; color: var(--c-text-soft); }
.tdd-sub { display: block; font-size: 12px; color: var(--c-text-soft); margin-top: 2px; }
.tdd-sub-inline { font-size: 12px; color: var(--c-text-soft); }
.tdd-none { color: #94a3b8; }
.tdd-num { text-align: center; font-variant-numeric: tabular-nums; }
.tdd-empty { text-align: center; color: var(--c-text-soft); padding: 24px 8px !important; }
.tdd-more { text-align: center; margin: 12px 0 4px; }

/* Giới thiệu */
.tdd-gt { display: flex; flex-direction: column; gap: 12px; }
.tdd-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 14px 18px; }
.tdd-card h3 { margin: 0 0 8px; font-size: 15.5px; display: flex; align-items: center; gap: 6px; }
.tdd-card h3 .ui-icon { width: 17px; height: 17px; }
.tdd-card p { margin: 0 0 8px; line-height: 1.55; text-align: justify; }
.tdd-card p:last-child { margin-bottom: 0; }
.tdd-card ul { margin: 0 0 8px; padding-left: 20px; line-height: 1.55; }
.tdd-card a { display: inline-flex; align-items: center; gap: 4px; }
.tdd-card code { font-size: 12.5px; }
.tdd-table--scope td { font-size: 13px; line-height: 1.45; }
.tdd-cc + .tdd-cc { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--c-border); }
.tdd-gt__xem { display: flex; margin-top: 6px; font-size: 12.5px; }

/* Modal chi tiết */
.tdd-modal .modal-box { max-width: 760px; text-align: left; position: relative; max-height: 92vh; overflow-y: auto; }
.tdd-modal .modal-box__title { padding-right: 36px; }
.tdd-modal__close {
    position: absolute; top: 10px; right: 10px; border: 0; background: none; color: var(--c-text-soft);
    width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.tdd-modal__close:hover { background: #f1f5f9; color: var(--c-text); }
.tdd-m__codes { margin: 2px 0 4px; }
.tdd-m__path { font-size: 12.5px; color: var(--c-text-soft); margin: 0 0 12px; }
.tdd-dl { margin: 0; border-top: 1px solid var(--c-border); }
.tdd-dl__row { display: grid; grid-template-columns: 170px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--c-border); }
.tdd-dl dt { font-size: 13px; font-weight: 600; color: var(--c-text-soft); }
.tdd-dl dd { margin: 0; font-size: 14px; line-height: 1.5; color: var(--c-text); white-space: pre-line; }
.tdd-dl dd a { display: inline-flex; align-items: center; gap: 4px; }
.tdd-dl dd code { font-size: 13px; }
.tdd-m__h4 { margin: 14px 0 6px; font-size: 14px; }
.tdd-m__list { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.6; max-height: 220px; overflow-y: auto; }
.tdd-modal .modal-box__actions { justify-content: flex-end; margin-top: 14px; }

@media (max-width: 760px) {
    .tdd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .tdd-stat { padding: 8px 10px; }
    .tdd-stat__num { font-size: 18px; }
    .tdd-filters select { flex: 1 1 100%; }
    .tdd-table:not(.tdd-table--scope) thead { display: none; }
    .tdd-table:not(.tdd-table--scope), .tdd-table:not(.tdd-table--scope) tbody,
    .tdd-table:not(.tdd-table--scope) tr, .tdd-table:not(.tdd-table--scope) td { display: block; width: 100%; }
    .tdd-table:not(.tdd-table--scope) tr.tdd-row { border: 1px solid var(--c-border); border-radius: var(--radius); margin-bottom: 8px; padding: 6px 0; background: var(--c-surface); }
    .tdd-table:not(.tdd-table--scope) td { border: 0 !important; padding: 3px 12px; }
    .tdd-table tr.tdd-grp td { border-radius: var(--radius); margin: 10px 0 6px; }
    .tdd-dl__row { grid-template-columns: 1fr; gap: 2px; }
}
