/* HDT Assist — API-powered lookup panel */

.hdt-assist-panel {
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: #1a1a1a;
  line-height: 1.5;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hdt-assist-panel h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: #8b0000;
}

.hdt-assist-status {
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.45;
}

.hdt-assist-status.loading {
  background: #e8f4fc;
  border: 1px solid #7eb8d9;
  color: #1a4a66;
}

.hdt-assist-status.ok {
  background: #e8f5e9;
  border: 1px solid #81c784;
  color: #1b5e20;
}

.hdt-assist-status.warn {
  background: #fff8e1;
  border: 1px solid #ffca28;
  color: #6d4c00;
}

.hdt-assist-status.err {
  background: #ffebee;
  border: 1px solid #e57373;
  color: #b71c1c;
}

.hdt-assist-focus-toggle {
  display: block;
  margin: -4px 0 10px;
  font-size: 12px;
  color: #444;
}

.hdt-assist-focus-toggle input {
  vertical-align: middle;
  margin-right: 6px;
}

.hdt-assist-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #c5c5c5;
}

.hdt-assist-section > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #444;
}

.hdt-assist-section:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

/* Ticket list (replaces wide table) */
.hdt-assist-ticket-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 2px;
}

.hdt-assist-ticket-item {
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
}

.hdt-assist-ticket-item a {
  color: #00008b;
  font-weight: 700;
  text-decoration: none;
}

.hdt-assist-ticket-item a:hover {
  text-decoration: underline;
}

.hdt-assist-ticket-item .meta {
  display: block;
  font-size: 11px;
  color: #555;
  margin-top: 2px;
}

.hdt-assist-ticket-item .title {
  margin-top: 4px;
  font-size: 11px;
  color: #222;
  line-height: 1.35;
}

.hdt-assist-dup {
  background: #fff8e6;
  border: 1px solid #e6c200;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 0;
  font-size: 12px;
}

.hdt-assist-dup p {
  margin: 0 0 6px;
  font-weight: 600;
}

.hdt-assist-dup ul {
  margin: 0;
  padding-left: 18px;
}

.hdt-assist-dup li {
  margin-bottom: 6px;
  line-height: 1.4;
}

.hdt-assist-dup a {
  color: #00008b;
  font-weight: 600;
  white-space: nowrap;
}

.hdt-assist-kb ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.hdt-assist-kb a {
  color: #00008b;
}

.hdt-assist-metrics {
  font-size: 11px;
  color: #555;
}

.hdt-assist-metrics dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  margin: 6px 0 0;
}

.hdt-assist-quickfill {
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hdt-assist-btn {
  background: #8b0000;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.hdt-assist-btn:hover {
  background: #6d0000;
}

.hdt-assist-btn:active {
  transform: translateY(1px);
}

.hdt-assist-conflict-warning {
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid #facc15;
  border-radius: 6px;
  background: #fffbeb;
  color: #3d2f00;
  font-size: 12px;
  line-height: 1.45;
}

.hdt-assist-conflict-warning[hidden] {
  display: none !important;
}

.hdt-assist-conflict-lead {
  margin: 0 0 6px;
}

.hdt-assist-conflict-list {
  margin: 0;
  padding-left: 18px;
}

.hdt-assist-conflict-list li {
  margin: 4px 0;
}

.hdt-assist-conflict-choice {
  margin: 1px 2px;
  padding: 2px 6px;
  border: 1px solid #d97706;
  border-radius: 5px;
  background: #fff7ed;
  color: #111827;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.hdt-assist-conflict-choice:hover,
.hdt-assist-conflict-choice:focus {
  background: #fed7aa;
  outline: 1px solid #9a3412;
}

.hdt-assist-preview-section {
  margin-bottom: 12px;
}

.hdt-assist-preview-dl {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 4px 8px;
  margin: 8px 0 0;
}

.hdt-assist-preview-dl dt {
  color: #555;
  font-weight: 700;
  font-size: 11px;
  text-align: right;
  line-height: 1.35;
}

.hdt-assist-preview-dl dd {
  margin: 0;
  min-height: 18px;
  padding: 3px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fafafa;
  font-size: 12px;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.hdt-assist-preview-dl dd[data-confidence="high"] {
  border-color: #81c784;
  background: #e8f5e9;
}

.hdt-assist-preview-dl dd[data-confidence="medium"] {
  border-color: #90caf9;
  background: #e3f2fd;
}

.hdt-assist-preview-dl dd[data-confidence="missing"] {
  border-color: #ddd;
  background: #f5f5f5;
  color: #777;
}

.hdt-assist-preview-dl dd[data-confidence="conflict"] {
  border-color: #facc15;
  background: #fff8e1;
  color: #6d4c00;
  cursor: default;
  font-style: italic;
}

.hdt-assist-fill-hint {
  font-size: 11px;
  color: #555;
  margin-top: 6px;
}

.hdt-assist-autofill-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  background: #d1fae5;
  color: #065f46;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Page layout: assist | form | demo */
.hdt-page-wrap {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-width: 1280px;
  margin: 20px auto 40px;
  padding: 0 20px;
  box-sizing: border-box;
}

.hdt-col-assist {
  flex: 0 0 380px;
  min-width: 0;
}

.hdt-col-main {
  flex: 1 1 720px;
  min-width: 0;
}

.hdt-col-demo {
  flex: 0 0 240px;
  min-width: 0;
}

.hdt-assist-mount,
.hdt-assist-panel-box {
  background: linear-gradient(180deg, #fafafa 0%, #ececec 100%);
  border: 1px solid #9a9a9a;
  border-left: 4px solid #8b0000;
  padding: 16px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.hdt-demo-box {
  background: #f8f9fa;
  border: 1px dashed #999;
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  color: #333;
}

.hdt-demo-box h4 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
}

.hdt-demo-note {
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.45;
  color: #444;
}

.hdt-demo-note-muted {
  color: #666;
  font-size: 10px;
}

.hdt-demo-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.hdt-demo-more {
  margin-top: 10px;
  font-size: 11px;
  color: #555;
}

.hdt-demo-more summary {
  cursor: pointer;
  font-weight: 600;
  color: #666;
}

.hdt-demo-box .ivue-pick {
  font: inherit;
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid #888;
  background: #fff;
}

.hdt-demo-box .ivue-pick:hover {
  background: #e8f4fc;
}

/* Fibre: assist above form in left column layout */
.hdt-fibre-layout .hdt-col-main form {
  width: 100%;
  max-width: none;
  margin: 0;
}

.hdt-assist-inline {
  max-width: 1280px;
  margin: 16px auto 0;
  padding: 0 20px;
}

.hdt-assist-inline .hdt-assist-panel-box {
  margin-bottom: 12px;
}

/* Hide duplicate previous-tickets block in form when Assist is active */
.hdt-has-assist #previousTickets {
  display: none !important;
}

@media (max-width: 1100px) {
  .hdt-page-wrap {
    flex-wrap: wrap;
    max-width: 100%;
  }
  .hdt-col-assist {
    flex: 1 1 100%;
    order: 1;
  }
  .hdt-col-main {
    flex: 1 1 100%;
    order: 2;
  }
  .hdt-col-demo {
    flex: 1 1 100%;
    order: 3;
  }
}
