/* NAMING-GOVERNANCE-01 — "Quy tắc mã & đặt tên".
   Layout rules here exist so the screen survives a 1366 laptop and an 820 tablet: the rule table is
   wide (eight columns) and a pattern like PO{YY}{MM}{SEQ3}_{SUPPLIER_CODE}_{CONTENT} does not wrap
   at a convenient place. The table scrolls inside its own box rather than pushing the page sideways. */

.naming-admin .naming-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 16px;
}

.naming-admin .naming-modules button {
  border: 1px solid var(--border, #d7dee8);
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

.naming-admin .naming-modules button.active {
  background: var(--primary, #1f6feb);
  border-color: var(--primary, #1f6feb);
  color: #fff;
}

/* The one rule that keeps eight columns usable on a laptop. */
.naming-admin .naming-rules,
.naming-admin .naming-versions,
.naming-admin .naming-names {
  width: 100%;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

.naming-admin .naming-rules tr.is-selected { background: #eef5ff; }

.naming-pattern {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: #f4f6fa;
  padding: 2px 6px;
  border-radius: 4px;
}

.naming-ref {
  font-size: 11px;
  color: #8a6d1f;
  background: #fdf5dd;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
}

.naming-detail-host { margin-top: 18px; border-top: 1px solid var(--border, #e3e8ef); padding-top: 14px; }
.naming-detail header h4 { margin: 0 0 2px; }

.naming-facts {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 6px 14px;
  margin: 12px 0;
  font-size: 13px;
}
.naming-facts dt { color: #5b6470; }
.naming-facts dd { margin: 0; }

/* A callout, not a disabled button: when somebody may not publish their own draft the screen has to
   say why. A greyed-out control with no sentence teaches people the system is broken. */
.naming-callout {
  background: #fdf5dd;
  border-left: 3px solid #d9a919;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin: 10px 0;
}

.naming-note { font-size: 13px; color: #4a525c; }

.naming-editor {
  background: #f8fafc;
  border: 1px solid var(--border, #e3e8ef);
  border-radius: 6px;
  padding: 12px 14px;
  margin: 12px 0;
}
.naming-editor h5 { margin: 0 0 10px; }
.naming-editor label { display: block; margin-bottom: 10px; font-size: 13px; }
.naming-editor input[type="text"] {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 7px 9px;
  border: 1px solid var(--border, #d7dee8);
  border-radius: 4px;
  box-sizing: border-box;
}
.naming-editor__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.naming-preview {
  background: #eef8f0;
  border-left: 3px solid #2f9e44;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 14px;
}
.naming-preview code { font-size: 14px; font-weight: 600; }

.naming-detail__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }

@media (max-width: 900px) {
  .naming-facts { grid-template-columns: 1fr; gap: 2px 0; }
  .naming-facts dt { margin-top: 8px; font-weight: 600; }
  .naming-admin .naming-modules button { padding: 5px 11px; font-size: 12px; }
}

/* The preview chain: key → canonical project name → quotation. Indented under the headline result
   because they are consequences of it, not separate answers. */
.naming-preview p { margin: 0 0 6px; }
.naming-preview__chain-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 3px 0 3px 14px;
  border-left: 2px solid rgba(47, 158, 68, 0.35);
  font-size: 13px;
}
.naming-preview__chain-row span { color: #4a525c; min-width: 150px; }
.naming-preview__note { margin-top: 8px; font-size: 12px; color: #4a525c; }

.field-hint { font-size: 12px; color: #5b6470; margin: 4px 0 0; line-height: 1.45; }
.field-hint code { background: #f4f6fa; padding: 1px 4px; border-radius: 3px; }

@media (max-width: 900px) {
  .naming-preview__chain-row { flex-direction: column; gap: 2px; }
  .naming-preview__chain-row span { min-width: 0; }
}
