@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/lato-400-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/lato-700-latin.woff2") format("woff2");
}

:root {
  --tblr-primary: #0b6f68;
  --answerbot-accent: #61bbb2;
  --answerbot-bg: #f5f2e9;
  --answerbot-ink: #1c2a39;
}

body {
  background: var(--answerbot-bg);
  color: var(--answerbot-ink);
  font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.admin-page {
  min-height: 100vh;
}

.admin-sidebar {
  border-right: 1px solid rgba(28, 42, 57, 0.1);
  background: #ffffff;
}

.admin-brand {
  display: grid;
  gap: 4px;
  align-items: start;
  min-height: auto;
  padding: 24px 16px 10px;
  white-space: normal;
}

.admin-brand span,
.admin-kicker,
.stat-label {
  color: #0b6f68;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.admin-brand strong {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.admin-sidebar .nav-link {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #2a3a4b;
  font-weight: 700;
  text-align: left;
}

.admin-sidebar .nav-link.active,
.admin-sidebar .nav-link:hover {
  background: rgba(97, 187, 178, 0.18);
  color: #0b6f68;
}

.admin-topbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(28, 42, 57, 0.08);
  backdrop-filter: blur(14px);
}

.admin-topbar .container-xl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.admin-session {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.module-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  margin: 0;
}

.module-switcher span {
  color: #0b6f68;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.module-switcher .form-select {
  min-width: 190px;
  border-color: rgba(11, 111, 104, 0.32);
  background-color: #f7fcf9;
}

.admin-card,
.stat-card {
  border: 1px solid rgba(28, 42, 57, 0.08);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(28, 42, 57, 0.07);
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.label-help {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border: 1px solid rgba(11, 111, 104, 0.32);
  border-radius: 999px;
  background: rgba(97, 187, 178, 0.14);
  color: #0b6f68;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.admin-filter-panel {
  margin-right: 0;
  margin-left: 0;
  padding: 16px;
  border: 1px solid rgba(97, 187, 178, 0.26);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(247, 252, 249, 0.98) 0%, rgba(236, 248, 245, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.admin-filter-panel .form-label {
  color: #264252;
  font-weight: 700;
}

.login-card {
  max-width: 860px;
  margin: 40px auto;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.diagnostic-card {
  min-height: 180px;
  padding: 16px;
  border: 1px solid rgba(28, 42, 57, 0.12);
  border-radius: 16px;
  background: linear-gradient(135deg, #f7fcf9 0%, #ffffff 100%);
}

.diagnostic-card-title {
  color: #0b6f68;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.diagnostic-card-status {
  margin-top: 10px;
  font-size: 20px;
  font-weight: 700;
}

.diagnostic-card-detail {
  min-height: 48px;
  margin: 8px 0 14px;
  color: #617084;
}

.diagnostic-card.is-ok {
  border-color: rgba(40, 167, 69, 0.28);
  background: linear-gradient(135deg, rgba(240, 251, 243, 0.98) 0%, #ffffff 100%);
}

.diagnostic-card.is-degraded {
  border-color: rgba(214, 51, 63, 0.28);
  background: linear-gradient(135deg, rgba(255, 245, 245, 0.98) 0%, #ffffff 100%);
}

.diagnostic-card.is-disabled {
  border-color: rgba(108, 117, 125, 0.24);
  background: linear-gradient(135deg, rgba(248, 249, 250, 0.98) 0%, #ffffff 100%);
}

.metric-card {
  min-height: 112px;
  padding: 14px;
  border: 1px solid rgba(11, 111, 104, 0.16);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(239, 250, 246, 0.98) 0%, rgba(255, 252, 242, 0.9) 100%);
}

.metric-label {
  color: #617084;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 12px;
  color: #1c2a39;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.admin-pre {
  min-height: 80px;
  max-height: 440px;
  overflow: auto;
  padding: 14px;
  border: 1px solid #dbe3ea;
  border-radius: 14px;
  background: #111814;
  color: #e9f7f4;
  white-space: pre-wrap;
}

.admin-pre.tall {
  min-height: 360px;
}

.kb-table-wrap {
  max-height: 680px;
  overflow: auto;
  border: 1px solid #edf1f4;
  border-radius: 14px;
}

.kb-row {
  cursor: pointer;
}

.kb-row.active td {
  background: rgba(97, 187, 178, 0.18);
}

.kb-content-panel {
  padding: 18px;
  border: 1px solid rgba(11, 111, 104, 0.26);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(232, 248, 244, 0.98) 0%, rgba(255, 250, 229, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 28px rgba(28, 42, 57, 0.06);
}

.kb-content-panel-heading,
.kb-metadata-heading {
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
}

.kb-content-panel-heading strong,
.kb-metadata-heading strong {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.kb-content-panel-heading p {
  max-width: 720px;
  margin: 0;
  color: #586879;
}

.kb-primary-label {
  color: #0b6f68;
  font-weight: 900;
}

.kb-question-field {
  min-height: 96px;
  font-size: 16px;
}

.kb-content-panel .EasyMDEContainer {
  border-radius: 14px;
  background: #ffffff;
}

.kb-metadata-panel {
  padding: 16px;
  border: 1px solid #edf1f4;
  border-radius: 18px;
  background: #fbfcfb;
}

.tag-input {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbe3ea;
  border-radius: 14px;
  background: #ffffff;
}

.tag-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border: 1px solid rgba(11, 111, 104, 0.22);
  border-radius: 999px;
  background: rgba(97, 187, 178, 0.16);
  color: #0b6f68;
  font-weight: 700;
}

.tag-pill button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(11, 111, 104, 0.14);
  color: #0b6f68;
  line-height: 1;
}

.tag-entry {
  border-color: #eef3f5;
  box-shadow: none;
}

.tag-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% - 4px);
  right: 10px;
  left: 10px;
  overflow: hidden;
  border: 1px solid #dbe3ea;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(28, 42, 57, 0.14);
}

.tag-suggestion {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #edf1f4;
  background: #ffffff;
  color: #1c2a39;
  text-align: left;
}

.tag-suggestion:hover,
.tag-suggestion:focus {
  background: rgba(97, 187, 178, 0.14);
}

.tag-suggestion.new-tag {
  color: #0b6f68;
  font-weight: 700;
}

.ticket-answer-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(74, 123, 183, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(239, 247, 255, 0.98) 0%, rgba(255, 250, 233, 0.96) 100%);
}

.ticket-ai-review-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(11, 111, 104, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(245, 252, 248, 0.98) 0%, rgba(255, 252, 239, 0.96) 100%);
}

.ticket-answer-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ticket-answer-heading .btn {
  margin-left: auto;
}

.ticket-answer-heading strong {
  font-weight: 900;
}

.ticket-answer-meta {
  margin: 0;
  color: #667789;
  font-size: 13px;
}

.ticket-generated-answer {
  min-height: 140px;
  max-height: 300px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid #dbe3ea;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: #1c2a39;
  white-space: pre-wrap;
}

.ticket-ai-subtitle {
  margin: 0 0 8px;
  color: #0b6f68;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ticket-ai-result {
  min-height: 160px;
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid #dbe3ea;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: #1c2a39;
  white-space: pre-wrap;
}

.triage-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.triage-lane {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid rgba(28, 42, 57, 0.1);
  border-radius: 16px;
  background: #ffffff;
  color: #1c2a39;
  text-align: left;
  box-shadow: 0 8px 20px rgba(28, 42, 57, 0.05);
}

.triage-lane.active,
.triage-lane:hover {
  border-color: rgba(11, 111, 104, 0.35);
  background: rgba(97, 187, 178, 0.14);
}

.triage-lane strong {
  font-size: 20px;
}

.triage-lane span {
  color: #5e6d7d;
  font-size: 12px;
  font-weight: 700;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.settings-item {
  padding: 14px;
  border: 1px solid #dbe3ea;
  border-radius: 16px;
  background: #fbfcfb;
}

.settings-item .form-label {
  font-weight: 900;
}

.settings-item p {
  min-height: 38px;
  margin: 0 0 10px;
  color: #667789;
  font-size: 13px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  border: 1px dashed #cbd5df;
  border-radius: 18px;
  color: #667789;
  text-align: center;
}

.editor-toolbar button::before,
.editor-toolbar a::before {
  display: none !important;
}

.editor-toolbar button,
.editor-toolbar a {
  width: auto !important;
  min-width: 34px;
  padding: 0 10px !important;
  color: #1c2a39 !important;
  font-weight: 700;
  text-decoration: none !important;
}

.EasyMDEContainer,
.CodeMirror {
  border-color: #dbe3ea;
  border-radius: 14px;
}

.CodeMirror {
  min-height: 320px;
}

.worker-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid #dbe3ea;
  border-radius: 16px;
  background: #f7fbfb;
}

.message {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #dbe3ea;
  border-radius: 14px;
  background: #ffffff;
}

.message-role {
  margin-bottom: 8px;
  color: #0b6f68;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.message-body {
  white-space: pre-wrap;
}

.message-section {
  margin-top: 16px;
}

.message-section:first-child {
  margin-top: 0;
}

.message-section-title {
  display: block;
  margin-bottom: 6px;
  font-weight: 900;
}

.kb-hero {
  padding: 22px 26px;
  border: 1px solid rgba(28, 42, 57, 0.08);
  border-radius: 22px;
  background:
    radial-gradient(circle at 20% 0%, rgba(97, 187, 178, 0.22), transparent 32%),
    linear-gradient(135deg, #fffaf0 0%, #f3fbfa 100%);
  box-shadow: 0 12px 30px rgba(28, 42, 57, 0.07);
}

.kb-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.kb-hero p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: #667789;
}

.kb-public-list {
  display: grid;
  gap: 10px;
}

.kb-public-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #dbe3ea;
  border-radius: 14px;
  background: #fff;
  color: var(--answerbot-ink);
  text-align: left;
}

.kb-public-item-text {
  display: grid;
  gap: 4px;
}

.kb-public-item.active,
.kb-public-item:hover {
  border-color: rgba(11, 111, 104, 0.34);
  background: rgba(97, 187, 178, 0.12);
}

.kb-public-item-meta {
  color: #667789;
  font-size: 13px;
}

.kb-public-item-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(11, 111, 104, 0.22);
  border-radius: 999px;
  color: #0b6f68;
  font-weight: 900;
  transition: transform 0.16s ease, background 0.16s ease;
}

.kb-public-item:hover .kb-public-item-arrow,
.kb-public-item.active .kb-public-item-arrow {
  background: #0b6f68;
  color: #fff;
  transform: translateY(2px);
}

.kb-topic-item {
  font-variant-numeric: tabular-nums;
}

.kb-public-question {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid rgba(11, 111, 104, 0.22);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(214, 238, 234, 0.98), rgba(245, 241, 222, 0.94));
  color: #152432;
}

.kb-public-question #kb-public-detail-question,
.kb-public-question .kb-public-question-body {
  color: #152432;
  font-weight: 700;
}

.kb-public-question #kb-public-detail-question p,
.kb-public-question .kb-public-question-body p {
  font-size: 18px;
  line-height: 1.45;
}

.kb-public-question p:last-child {
  margin-bottom: 0;
}

.kb-public-answer {
  font-size: 17px;
  line-height: 1.65;
}

.kb-public-section {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(11, 111, 104, 0.16);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(248, 253, 251, 0.98), rgba(255, 252, 243, 0.94));
}

.kb-public-section:first-child {
  margin-top: 0;
}

.kb-public-section h3 {
  margin-bottom: 10px;
  color: #0b6f68;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kb-public-section-body > :last-child {
  margin-bottom: 0;
}

.kb-public-section p:last-child,
.kb-public-section ul:last-child,
.kb-public-section ol:last-child {
  margin-bottom: 0;
}

.kb-public-section table {
  width: 100%;
  margin: 12px 0;
  border-collapse: collapse;
  font-size: 15px;
}

.kb-public-section th,
.kb-public-section td {
  padding: 9px 10px;
  border: 1px solid #dbe3ea;
  vertical-align: top;
}

.kb-public-section th {
  background: rgba(97, 187, 178, 0.12);
}

.kb-public-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.kb-public-tag {
  border: 1px solid rgba(11, 111, 104, 0.18);
  border-radius: 999px;
  background: rgba(97, 187, 178, 0.11);
  color: #0b6f68;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
}

.kb-public-tag:hover {
  background: rgba(11, 111, 104, 0.12);
}

.kb-public-inline-preview {
  margin: -2px 0 6px 0;
  padding: 16px;
  border: 1px solid rgba(11, 111, 104, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(235, 250, 247, 0.98), rgba(255, 250, 240, 0.94));
  box-shadow: inset 3px 0 0 rgba(11, 111, 104, 0.38);
}

.kb-public-inline-preview .kb-public-question {
  margin-top: 0;
}

.kb-public-inline-preview .kb-public-section {
  margin-top: 14px;
}

.kb-public-inline-block + .kb-public-inline-block {
  margin-top: 12px;
}

.kb-public-inline-block > strong {
  display: block;
  margin-bottom: 4px;
  color: #0b6f68;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kb-public-inline-block p:last-child {
  margin-bottom: 0;
}

.learning-detail {
  border: 1px solid rgba(11, 111, 104, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(248, 253, 251, 0.98), rgba(255, 252, 243, 0.94));
  padding: 18px;
}

.learning-copy {
  border: 1px solid rgba(11, 111, 104, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
  line-height: 1.55;
}

.learning-pre {
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
}

@media (max-width: 991px) {
  .admin-topbar .container-xl,
  .admin-card-header,
  .worker-control {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-sidebar {
    position: static;
  }
}
