:root {
  --ink: #1e293b;
  --muted: #64748b;
  --line: rgba(226, 232, 240, 0.8);
  --surface: #ffffff;
  --soft: #f8fafc;
  --primary: #0f766e;
  --primary-dark: #075b55;
  --orange: #f97316;
  --orange-soft: #fff4e9;
  --blue-soft: #edf6ff;
  --radius: 14px;
  --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
  --glass-border: 1px solid rgba(255, 255, 255, 0.9);
  --glass-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.08);
  --glass-shadow-hover: 0 12px 24px 0 rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 50% 0%, #edf2f7, #f8fafc 85%);
  font-family: "Be Vietnam Pro", Arial, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -50px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
}

.skip-link:focus {
  top: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex: none;
}

.brand-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

.brand-logo:hover {
  opacity: 1;
}

.agent-link {
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 14px;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.agent-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
}

.agent-link[aria-pressed="true"] {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.3);
  border-color: #ffffff;
  font-weight: 700;
}

main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 0 28px 12px;
  display: flex;
  flex-direction: column;
}

.hero {
  display: block;
  padding: 22px 28px;
  margin: 16px 0 20px 0;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 91% 8%, rgba(68, 211, 190, 0.18), transparent 35%),
    linear-gradient(125deg, #0e3652 0%, #0f766e 100%);
  border-radius: 16px;
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.12);
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.hero-copy {
  flex: 1;
  min-width: 0;
}

.hero h1 {
  max-width: 730px;
  margin: 0 0 12px;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.search-wrap {
  position: relative;
  max-width: 620px;
}

.search-wrap input {
  width: 100%;
  min-height: 46px;
  height: 46px;
  padding: 0 48px 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-size: 0.88rem;
  transition: all 0.25s ease;
}

.search-wrap input:focus {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 180, 103, 0.4), 0 6px 18px rgba(0, 0, 0, 0.12);
}

.search-icon {
  position: absolute;
  top: 11px;
  right: 16px;
  color: var(--primary);
  font-size: 1.4rem;
  line-height: 1;
  pointer-events: none;
}

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(260px, 0.33fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 16px;
  align-items: stretch;
}

/* Glassmorphism Card Style */
.topic-panel,
.article-panel {
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  transition: all 0.25s ease;
}

.topic-panel:hover,
.article-panel:hover {
  box-shadow: 0 10px 28px -4px rgba(15, 23, 42, 0.10);
  border-color: #94a3b8;
}

.topic-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 210px);
  min-height: 480px;
  overflow: hidden;
}

.panel-heading {
  flex: none;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.panel-title-wrap {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 7px;
  min-width: 0;
}

.panel-title-wrap svg {
  flex: none;
  display: block;
}

.panel-title-wrap h2 {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  line-height: 1;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-icon-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  flex: none;
}

.toggle-icon-btn:hover {
  background: #f1f5f9;
  color: #0f766e;
  border-color: #0d9488;
}

.count-badge {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #0f766e;
  background: #e0f2fe;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.topic-list {
  flex: 1;
  min-height: 0;
  padding: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.topic-group {
  padding: 6px 0;
  border-bottom: 1px solid rgba(240, 242, 246, 0.8);
}

.topic-group:last-child {
  border-bottom: 0;
}

.topic-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  color: #334155;
  background: transparent;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.topic-group-title:hover {
  color: var(--primary);
  background: rgba(15, 118, 110, 0.04);
}

.chevron {
  transition: transform 0.2s ease;
  color: var(--primary);
}

.topic-group.is-collapsed .chevron {
  transform: rotate(-90deg);
}

.topic-items {
  display: grid;
  gap: 2px;
  margin-top: 3px;
}

.topic-group.is-collapsed .topic-items {
  display: none;
}

.topic-item {
  padding: 8px 10px 8px 24px;
  border: 0;
  border-radius: 7px;
  color: #64748b;
  background: transparent;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.35;
  transition: all 0.2s ease;
}

.topic-item:hover {
  color: var(--primary-dark);
  background: rgba(15, 118, 110, 0.06);
}

.topic-item.is-active {
  color: #0f766e;
  background: #f0fdfa;
  font-weight: 700;
}

.empty-state {
  padding: 22px 13px;
  color: var(--muted);
  text-align: center;
  font-size: 0.82rem;
}

.article-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 210px);
  min-height: 480px;
  overflow: hidden;
}

.article-hero {
  padding: 24px 28px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.tag {
  padding: 3px 9px;
  border-radius: 999px;
  color: #0369a1;
  background: #e0f2fe;
  font-size: 0.72rem;
  font-weight: 600;
}

.tag.alt {
  color: #c2410c;
  background: #ffedd5;
}

.article-hero h2 {
  max-width: 830px;
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  line-height: 1.3;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.agent-note {
  display: none;
  max-width: 740px;
  margin: 10px 0 0;
  padding: 8px 12px;
  border: 1px solid rgba(201, 230, 255, 0.8);
  border-radius: 8px;
  color: #1e3a8a;
  background: rgba(237, 246, 255, 0.8);
  font-size: 0.8rem;
  backdrop-filter: blur(6px);
}

body.agent-mode .agent-note {
  display: block;
}

.article-body {
  flex: 1;
  min-height: 0;
  display: block;
  padding: 20px 24px 28px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.source-guide {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: block;
}

.source-guide p {
  margin: 0 0 14px 0;
  color: #334155;
  font-size: 0.93rem;
  line-height: 1.7;
}

.source-guide ul,
.source-guide ol {
  margin: 12px 0 16px 20px;
  padding: 0;
}

.source-guide li {
  margin-bottom: 8px;
  color: #334155;
  font-size: 0.93rem;
  line-height: 1.6;
}

.source-guide a {
  color: #0f766e;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid #99f6e4;
  transition: all 0.18s ease;
  word-break: break-word;
}

.source-guide a:hover {
  color: #075b55;
  border-color: #0f766e;
  background: #f0fdfa;
}

/* Nội dung do admin soạn: chọn theo thẻ, không theo class,
   để HTML từ trình soạn thảo hiển thị đúng mà không cần gắn class thủ công. */
.source-guide p {
  margin: 0 0 12px 0;
  color: #1e293b;
  font-size: 0.92rem;
  line-height: 1.7;
}

.source-guide>*:last-child {
  margin-bottom: 0;
}

.source-guide strong,
.source-guide b {
  color: #0f172a;
  font-weight: 700;
}

.source-guide h3,
.source-guide h4 {
  margin: 4px 0 8px;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
}

.source-guide a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
}

.source-guide a:hover {
  color: var(--primary-dark);
}

.source-guide ul,
.source-guide ol {
  margin: 0 0 12px 0;
  padding-left: 24px;
  color: #1e293b;
  font-size: 0.92rem;
  line-height: 1.7;
}

.source-guide li {
  margin-bottom: 6px;
}

.source-guide blockquote {
  margin: 0 0 12px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--primary);
  color: #475569;
}

.source-gap {
  padding: 18px 20px;
  border: var(--glass-border);
  border-radius: 12px;
  color: #475569;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.source-gap strong {
  display: block;
  margin-bottom: 6px;
  color: #1e293b;
}

.source-gap p {
  margin: 0;
  color: #475569 !important;
  line-height: 1.55;
}

.checklist-card {
  padding: 18px 20px;
  border: var(--glass-border);
  border-radius: 12px;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.checklist-card:hover {
  box-shadow: var(--glass-shadow-hover);
}

.checklist {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 22px;
  color: #475569;
  font-size: 0.83rem;
  line-height: 1.5;
  font-weight: 500;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

.warning {
  margin-top: 16px;
  padding: 14px 16px;
  border: var(--glass-border);
  border-radius: 12px;
  color: #475569;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.85) 100%);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.82rem;
  line-height: 1.55;
  transition: all 0.3s ease;
}

.warning:hover {
  box-shadow: var(--glass-shadow-hover);
}

.warning strong {
  color: #1e293b;
}

.primary-button,
.secondary-button,
.text-button {
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.primary-button {
  padding: 12px 18px;
  border: 1px solid var(--primary);
  color: #fff;
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}

.primary-button:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.35);
  transform: translateY(-1px);
}

.secondary-button {
  padding: 11px 16px;
  border: 1px solid #cbd5e1;
  color: #334155;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.secondary-button:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.text-button {
  border: 0;
  padding: 7px 0;
  color: var(--primary);
  background: transparent;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  max-width: 1280px;
  width: 100%;
  box-sizing: border-box;
  margin: auto auto 0;
  padding: 14px 28px 18px;
  color: #64748b;
  font-size: 0.72rem;
}

.ticket-dialog {
  width: min(650px, calc(100% - 30px));
  padding: 30px;
  border: var(--glass-border);
  border-radius: 18px;
  background: var(--glass-bg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.ticket-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.ticket-dialog h2 {
  margin-bottom: 8px;
  font-size: 1.6rem;
  color: #0f172a;
}

.ticket-dialog>p:not(.eyebrow):not(.dialog-note) {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 0.85rem;
}

.ticket-dialog label {
  display: block;
  margin-bottom: 7px;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
}

.ticket-dialog textarea {
  width: 100%;
  resize: vertical;
  padding: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  outline: none;
  color: #334155;
  background: rgba(248, 250, 252, 0.8);
  font-size: 0.78rem;
  line-height: 1.55;
}

.ticket-dialog textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.dialog-close {
  position: absolute;
  top: 15px;
  right: 17px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #475569;
  background: #f1f5f9;
  font-size: 1.4rem;
  transition: all 0.2s ease;
}

.dialog-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}

.dialog-note {
  margin: 14px 0 0;
  color: #94a3b8;
  font-size: 0.72rem;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  max-width: 330px;
  padding: 12px 16px;
  border-radius: 12px;
  color: #fff;
  background: #0f172a;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  font-size: .8rem;
  font-weight: 500;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 950px) {
  .workspace {
    grid-template-columns: 1fr;
    flex: none;
  }

  .topic-panel,
  .article-panel {
    height: auto;
    min-height: 0;
  }

  .topic-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 16px;
    max-height: 380px;
  }

  .article-body {
    grid-template-columns: 1fr;
    overflow-y: visible;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 64px;
    padding: 0 18px;
  }

  .header-nav {
    gap: 12px;
  }

  .header-nav a {
    display: none;
  }

  main {
    padding: 0 16px 45px;
  }

  .hero {
    padding: 22px 18px;
    margin: 0 -16px 16px;
    border-radius: 0 0 18px 18px;
  }

  .hero-content {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 14px;
  }

  .brand-logo {
    height: 36px;
  }

  .hero h1 {
    font-size: 1.25rem;
  }

  .topic-list {
    grid-template-columns: 1fr;
  }

  .article-hero,
  .article-body {
    padding-left: 21px;
    padding-right: 21px;
  }

  .site-footer {
    flex-direction: column;
    padding: 20px 16px 28px;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions button {
    width: 100%;
  }
}
/* ── Mẫu yêu cầu hỗ trợ ─────────────────────────────────────
   Form nhập liệu lấy nguyên văn từ file Excel nguồn: giữ đúng
   xuống dòng và thụt lề để khách sao chép gửi đi không sai mẫu. */
.request-form {
  margin-top: 20px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}

.request-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: var(--orange-soft);
}

.request-form-head h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #9a3412;
}

.request-form-head p {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: #7c2d12;
}

.copy-form-button {
  flex: none;
  padding: 8px 14px;
  border: 1px solid #fdba74;
  border-radius: 8px;
  background: #ffffff;
  color: #9a3412;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.18s ease;
}

.copy-form-button:hover {
  background: #fff7ed;
  border-color: var(--orange);
}

.request-form-body {
  margin: 0;
  padding: 16px 18px;
  max-height: 420px;
  overflow: auto;
  color: #1e293b;
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 640px) {
  .request-form-head { flex-direction: column; }
  .copy-form-button { width: 100%; }
}
