/* Danh mục chủ đề (topics.html) + mục điều hướng dạng link (index-v4.html). Chỉ bổ sung; kế thừa rtop-ui.css, dashboard*.css */

/* Mục điều hướng là link (<a>) thay vì <button> */
a.nav__item { text-decoration: none; color: inherit; }

.session-chip { display: inline-flex; align-items: center; gap: 6px; align-self: center; font-size: 12.5px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }

/* Tóm tắt: 3 ô nhỏ, cùng kiểu chỉ số phụ của dashboard */
.topic-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 8px; }
.topic-summary .kpi { min-height: 0; }
.topic-summary .sk-card { height: 96px; }
.topic-scope-note { grid-column: 1 / -1; margin: 0 0 8px; font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Thanh tìm kiếm + bộ lọc */
.topic-filters { display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(150px, 1fr)) auto; gap: 12px; align-items: end; }
.topic-filters__meta { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 32px; width: 100%; }

/* Bảng */
.topic-list .card__body { padding-top: 8px; }
.topic-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.topic-table td:first-child { min-width: 200px; }
.topic-desc { max-width: 210px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topic-table .topic-code { display: inline-block; max-width: 160px; white-space: normal; line-height: 1.35; } /* chỉ ngắt sau "_" (<wbr>) */
.topic-table th.th-wrap { white-space: normal; min-width: 96px; line-height: 1.3; }
.topic-table td, .topic-table th { padding-left: 10px; padding-right: 10px; }
.topic-table .pill { white-space: nowrap; }
.topic-table tr.is-inactive td { background: #fafbfc; }
.topic-table tr.is-inactive .cmp-name { color: var(--text-2); }
.topic-actions { white-space: nowrap; }
.topic-act { width: 30px; height: 30px; }
.topic-act.btn--danger-text { color: var(--red-ink); }
.topic-act.is-blocked { color: #b6bcc6; }
.usage-link { font-size: 13.5px; }
.btn--danger-text { color: var(--red-ink); }
.btn--danger-text.is-blocked { color: var(--muted); }
.btn--danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn--danger:hover { background: var(--red-ink); }
.topic-card .r-card__top { justify-content: flex-start; gap: 6px; }
.topic-card.is-inactive { background: #fafbfc; }
.topic-card__actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }

/* Modal + form */
.modal--narrow { max-width: 560px; }
.req { color: var(--red); margin-left: 2px; }
.field__hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.field__error { font-size: 12.5px; color: var(--red-ink); margin-top: 2px; }
.field__warn { font-size: 12.5px; color: var(--amber); margin-top: 2px; display: flex; gap: 6px; align-items: flex-start; }
.field__warn .icon { flex: none; margin-top: 2px; }
textarea.input { height: auto; padding-top: 8px; padding-bottom: 8px; resize: vertical; font: inherit; }
.field--radio { border: 0; padding: 0; margin: 0; gap: 6px; }
.field--radio label { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; margin-right: 18px; }
.code-locked { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.code-locked .topic-code { align-self: flex-start; }
.form-alert, .form-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.form-alert { background: var(--red-soft); color: var(--red-ink); border: 1px solid #f3c7c7; }
.form-note { background: var(--blue-soft); color: var(--text-2); border: 1px solid #cfe6f2; }
.form-alert .icon, .form-note .icon { flex: none; margin-top: 2px; }
.modal__body p { margin: 0; }
.usage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.usage-list li { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.usage-list__survey { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Menu demo: lựa chọn dạng radio */
.menu__item--radio[aria-checked='true'] { color: var(--blue); font-weight: 600; background: var(--blue-soft); }
.menu__item--radio[aria-checked='true']::after { content: '✓'; margin-left: auto; }

@media (max-width: 1199px) {
  .topic-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topic-filters__search { grid-column: span 2; }
}
@media (max-width: 760px) {
  .topic-summary { grid-template-columns: 1fr; gap: 8px; }
  .topic-filters { grid-template-columns: 1fr; }
  .topic-filters__search { grid-column: auto; }
  .page-head__actions { flex-wrap: wrap; }
  .meta-grid { grid-template-columns: 1fr; }
}
